SieveDebugDialog::SieveDebugDialog( QWidget *parent )
:   KDialog( parent ),
    mSieveJob( 0 )
{
    setCaption( i18n( "Sieve Diagnostics" ) );
    setButtons( Ok );
    // Collect all accounts
    AccountManager *am = kmkernel->acctMgr();
    assert( am );
    QList<KMAccount*>::iterator accountIt = am->begin();
    while ( accountIt != am->end() ) {
      KMAccount *account = *accountIt;
      ++accountIt;
      mAccountList.append( account );
    }

    mEdit = new KTextEdit( this );
    mEdit->setReadOnly( true );
    setMainWidget( mEdit );

    mEdit->setText( i18n( "Collecting diagnostic information about Sieve support...\n\n" ) );

    setInitialSize( QSize( 640, 480 ) );

    if ( !mAccountList.isEmpty() )
        QTimer::singleShot( 0, this, SLOT( slotDiagNextAccount() ) );
}
예제 #2
0
 KUrl Vacation::findURL() const {
   AccountManager * am = kmkernel->acctMgr();
   assert( am );
   QList<KMAccount*>::iterator accountIt = am->begin();
   while ( accountIt != am->end() ) {
     KMAccount *account = *accountIt;
     ++accountIt;
     if ( KMail::ImapAccountBase * iab = dynamic_cast<KMail::ImapAccountBase*>( account ) ) {
       KUrl u = findUrlForAccount( iab );
       if ( !u.isEmpty() )
         return u;
     }
   }
   return KUrl();
 }