kmail Library API Documentation

kmacctfolder.cpp

00001 // kmacctfolder.cpp
00002 
00003 #ifdef HAVE_CONFIG_H
00004 #include <config.h>
00005 #endif
00006 
00007 #include "kmacctfolder.h"
00008 #include "kmacctmgr.h"
00009 #include <stdlib.h>
00010 
00011 #define MAX_ACCOUNTS 16
00012 
00013 //-----------------------------------------------------------------------------
00014 KMAccount* KMAcctFolder::account(void)
00015 {
00016   if (mAcctList) return mAcctList->first();
00017   return 0;
00018 }
00019 
00020 
00021 //-----------------------------------------------------------------------------
00022 KMAccount* KMAcctFolder::nextAccount(void)
00023 {
00024   if (mAcctList) return mAcctList->next();
00025   return 0;
00026 }
00027 
00028 
00029 //-----------------------------------------------------------------------------
00030 void KMAcctFolder::addAccount(KMAccount* aAcct)
00031 {
00032   if (!aAcct) return;
00033   if (!mAcctList) mAcctList = new KMAcctList;
00034 
00035   mAcctList->append(aAcct);
00036   aAcct->setFolder(this);
00037 }
00038 
00039 
00040 //-----------------------------------------------------------------------------
00041 void KMAcctFolder::clearAccountList(void)
00042 {
00043   if (mAcctList) mAcctList->clear();
00044 }
00045 
00046 
00047 //-----------------------------------------------------------------------------
00048 void KMAcctFolder::removeAccount(KMAccount* aAcct)
00049 {
00050   if (!aAcct || !mAcctList) return;
00051 
00052   mAcctList->remove(aAcct);
00053   aAcct->setFolder(0);
00054   if (mAcctList->count() <= 0)
00055   {
00056     delete mAcctList;
00057     mAcctList = 0;
00058   }
00059 }
00060 
00061 
00062 
KDE Logo
This file is part of the documentation for kmail Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:37:19 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003