<commit_before>/*
 * $Id$
 *
 * Copyright(C) 1998-2006 <NAME>
 * All rights reserved.
 *
 */

#include <qmdocument.h>

#include <boost/bind.hpp>

#include "activesync.h"
#include "../sync/syncqueue.h"


/****************************************************************************
 *
 * ActiveSyncInvoker
 *
 */

qm::ActiveSyncInvoker::ActiveSyncInvoker(Document* pDocument,
										 SyncQueue* pSyncQueue) :
	pDocument_(pDocument),
	pSyncQueue_(pSyncQueue)
{
	const Document::AccountList& l = pDocument_->getAccounts();
	std::for_each(l.begin(), l.end(), boost::bind(&Account::setHook, _1, this));
	pDocument_->addAccountManagerHandler(this);
}

qm::ActiveSyncInvoker::~ActiveSyncInvoker()
{
	const Document::AccountList& l = pDocument_->getAccounts();
	std::for_each(l.begin(), l.end(),
		boost::bind(&Account::setHook, _1, static_cast<AccountHook*>(0)));
	pDocument_->removeAccountManagerHandler(this);<commit_msg>Use ActiveSync::setHook.<commit_after>/*
 * $Id$
 *
 * Copyright(C) 1998-2006 <NAME>
 * All rights reserved.
 *
 */

#include <qmdocument.h>

#include <boost/bind.hpp>

#include "activesync.h"
#include "../sync/syncqueue.h"


/****************************************************************************
 *
 * ActiveSyncInvoker
 *
 */

qm::ActiveSyncInvoker::ActiveSyncInvoker(Document* pDocument,
										 SyncQueue* pSyncQueue) :
	pDocument_(pDocument),
	pSyncQueue_(pSyncQueue)
{
	const Document::AccountList& l = pDocument_->getAccounts();
	std::for_each(l.begin(), l.end(),
		boost::bind(&ActiveSyncInvoker::setHook, _1, this));
	pDocument_->addAccountManagerHandler(this);
}

qm::ActiveSyncInvoker::~ActiveSyncInvoker()
{
	const Document::AccountList& l = pDocument_->getAccounts();
	std::for_each(l.begin(), l.end(),
		boost::bind(&ActiveSyncInvoker::setHook, _1, static_cast<AccountHook*>(0)));
	pDocument_->removeAccountManagerHandler(this);
{'fraction_non_alphanumeric': 0.242116515232496, 'fraction_numerical': 0.011758417958311064, 'mean_word_length': 6.578947368421052, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '900309', 'n_tokens_mistral': 649, 'n_tokens_neox': 605, 'n_words': 88}