You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.2 KiB
60 lines
1.2 KiB
// kmacctfolder.cpp |
|
|
|
#include "kmacctfolder.h" |
|
#include "kmaccount.h" |
|
#include "kmacctmgr.h" |
|
#include "kmglobal.h" |
|
#include <stdlib.h> |
|
|
|
#define MAX_ACCOUNTS 16 |
|
|
|
//----------------------------------------------------------------------------- |
|
KMAccount* KMAcctFolder::account(void) |
|
{ |
|
if (mAcctList) return mAcctList->first(); |
|
return NULL; |
|
} |
|
|
|
|
|
//----------------------------------------------------------------------------- |
|
KMAccount* KMAcctFolder::nextAccount(void) |
|
{ |
|
if (mAcctList) return mAcctList->next(); |
|
return NULL; |
|
} |
|
|
|
|
|
//----------------------------------------------------------------------------- |
|
void KMAcctFolder::addAccount(KMAccount* aAcct) |
|
{ |
|
if (!aAcct) return; |
|
if (!mAcctList) mAcctList = new KMAcctList; |
|
|
|
mAcctList->append(aAcct); |
|
aAcct->setFolder(this); |
|
} |
|
|
|
|
|
//----------------------------------------------------------------------------- |
|
void KMAcctFolder::clearAccountList(void) |
|
{ |
|
if (mAcctList) mAcctList->clear(); |
|
} |
|
|
|
|
|
//----------------------------------------------------------------------------- |
|
void KMAcctFolder::removeAccount(KMAccount* aAcct) |
|
{ |
|
if (!aAcct || !mAcctList) return; |
|
|
|
mAcctList->remove(aAcct); |
|
aAcct->setFolder(NULL); |
|
if (mAcctList->count() <= 0) |
|
{ |
|
delete mAcctList; |
|
mAcctList = NULL; |
|
} |
|
} |
|
|
|
|
|
|
|
|