Refresh account combo after creating/deleting accounts. Kolab issue 247.

svn path=/branches/proko2/kdepim/; revision=329930
wilder-work
David Faure 22 years ago
parent 8317469d53
commit 53cdc95cfb
  1. 13
      accountcombobox.cpp
  2. 1
      configuredialog.cpp

@ -31,15 +31,17 @@
#include "kmfolder.h"
#include "kmfolderdir.h"
#include "kmacctmgr.h"
#include <kdebug.h>
using namespace KMail;
AccountComboBox::AccountComboBox( bool needsInbox, QWidget* parent, const char* name )
: QComboBox( parent, name ), mNeedsInbox( needsInbox )
{
// Currently there's no auto-refresh of the account list,
// since this combo is only used within the configuration dialog itself
// OK it could be useful when using Apply - TODO: signal from kmacctmgr
connect( kmkernel->acctMgr(), SIGNAL( accountAdded( KMAccount* ) ),
this, SLOT( slotRefreshAccounts() ) );
connect( kmkernel->acctMgr(), SIGNAL( accountRemoved( KMAccount* ) ),
this, SLOT( slotRefreshAccounts() ) );
slotRefreshAccounts();
}
@ -90,16 +92,19 @@ QValueList<KMAccount *> KMail::AccountComboBox::applicableAccounts() const
QValueList<KMAccount *> lst;
for( KMAccount *a = kmkernel->acctMgr()->first(); a;
a = kmkernel->acctMgr()->next() ) {
Q_ASSERT( a->folder() );
if ( a && a->folder() ) {
bool ok = false;
if ( mNeedsInbox ) {
KMFolderDir* child = a->folder()->child();
Q_ASSERT( child );
if ( child ) {
for (KMFolderNode* node = child->first(); node; node = child->next())
for (KMFolderNode* node = child->first(); node; node = child->next()) {
if (!node->isDir() && node->name() == "INBOX") {
ok = true;
break;
}
}
}
} else
ok = true;

@ -3833,7 +3833,6 @@ MiscPageFolderTab::MiscPageFolderTab( QWidget * parent, const char * name )
// temp. vars:
QVBoxLayout *vlay;
QHBoxLayout *hlay;
QGroupBox *group;
QLabel *label;
vlay = new QVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() );

Loading…
Cancel
Save