Ejemplo n.º 1
0
void FavoriteFolderView::checkMail()
{
    bool found = false;
    for(QListViewItemIterator it(this); it.current(); ++it)
    {
        KMFolderTreeItem *fti = static_cast<KMFolderTreeItem *>(it.current());
        if(fti->folder()->folderType() == KMFolderTypeImap || fti->folder()->folderType() == KMFolderTypeCachedImap)
        {
            if(!found)
                if(!kmkernel->askToGoOnline())
                    break;
            found = true;
            if(fti->folder()->folderType() == KMFolderTypeImap)
            {
                KMFolderImap *imap = static_cast<KMFolderImap *>(fti->folder()->storage());
                imap->getAndCheckFolder();
            }
            else if(fti->folder()->folderType() == KMFolderTypeCachedImap)
            {
                KMFolderCachedImap *f = static_cast<KMFolderCachedImap *>(fti->folder()->storage());
                f->account()->processNewMailSingleFolder(fti->folder());
            }
        }
    }
}
void KMail::FolderDialogACLTab::initializeWithValuesFromFolder( KMFolder* folder )
{
  // This can be simplified once KMFolderImap and KMFolderCachedImap have a common base class
  mFolderType = folder->folderType();
  if ( mFolderType == KMFolderTypeImap ) {
    KMFolderImap* folderImap = static_cast<KMFolderImap*>( folder->storage() );
    mImapPath = folderImap->imapPath();
    mImapAccount = folderImap->account();
    mUserRights = folderImap->userRights();
  }
  else if ( mFolderType == KMFolderTypeCachedImap ) {
    KMFolderCachedImap* folderImap = static_cast<KMFolderCachedImap*>( folder->storage() );
    mImapPath = folderImap->imapPath();
    mImapAccount = folderImap->account();
    mUserRights = folderImap->userRights();
  }
  else
    assert( 0 ); // see KMFolderDialog constructor
}