1
//=============================================================================
3
// File : KviKvsAsyncOperation.cpp
4
// Creation date : Sat 09 Jul 2005 04:54:24 by Szymon Stefanek
6
// This file is part of the KVIrc IRC Client distribution
7
// Copyright (C) 2005-2010 Szymon Stefanek <pragma at kvirc dot net>
9
// This program is FREE software. You can redistribute it and/or
10
// modify it under the terms of the GNU General Public License
11
// as published by the Free Software Foundation; either version 2
12
// of the License, or (at your opinion) any later version.
14
// This program is distributed in the HOPE that it will be USEFUL,
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
// See the GNU General Public License for more details.
19
// You should have received a copy of the GNU General Public License
20
// along with this program. If not, write to the Free Software Foundation,
21
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23
//=============================================================================
27
#include "KviKvsAsyncOperation.h"
28
#include "KviKvsKernel.h"
29
#include "KviWindow.h"
31
KviKvsAsyncOperation::KviKvsAsyncOperation(KviWindow * pWnd)
35
KviKvsKernel::instance()->asyncOperationManager()->registerOperation(this);
38
KviKvsAsyncOperation::~KviKvsAsyncOperation()
40
KviKvsKernel::instance()->asyncOperationManager()->unregisterOperation(this);
44
KviKvsAsyncOperationManager::KviKvsAsyncOperationManager()
46
m_pOperationList = new KviPointerList<KviKvsAsyncOperation>;
47
m_pOperationList->setAutoDelete(false);
50
KviKvsAsyncOperationManager::~KviKvsAsyncOperationManager()
52
while(m_pOperationList->first())
53
delete m_pOperationList->first();
54
delete m_pOperationList;
57
void KviKvsAsyncOperationManager::registerOperation(KviKvsAsyncOperation * o)
59
m_pOperationList->append(o);
62
void KviKvsAsyncOperationManager::unregisterOperation(KviKvsAsyncOperation * o)
64
m_pOperationList->removeRef(o);