author | zautrix <zautrix> | 2005-03-26 17:26:28 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-26 17:26:28 (UTC) |
commit | 36dd498ad2f5a2cf43fc08c621669fe42198e5eb (patch) (side-by-side diff) | |
tree | 78f826bd02a35e0624d245f267ec5b595350574e | |
parent | e3f00322eb77bd03250eb66a2574b640de9aebb4 (diff) | |
download | kdepimpi-36dd498ad2f5a2cf43fc08c621669fe42198e5eb.zip kdepimpi-36dd498ad2f5a2cf43fc08c621669fe42198e5eb.tar.gz kdepimpi-36dd498ad2f5a2cf43fc08c621669fe42198e5eb.tar.bz2 |
fix
-rw-r--r-- | kmicromail/accountview.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kmicromail/accountview.cpp b/kmicromail/accountview.cpp index e9be224..6227f6d 100644 --- a/kmicromail/accountview.cpp +++ b/kmicromail/accountview.cpp @@ -42,128 +42,130 @@ void AccountView::slotContextMenu(int id) view->contextMenuSelected(id); } void AccountView::slotHold(int button, QListViewItem * item,const QPoint&,int) { if (button==1) {return;} if (!item) return; AccountViewItem *view = static_cast<AccountViewItem *>(item); QPopupMenu*m = view->getContextMenu(); if (!m) return; connect(m,SIGNAL(activated(int)),this,SLOT(slotContextMenu(int))); m->setFocus(); m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); delete m; } void AccountView::populate( QList<Account> list ) { clear(); imapAccounts.clear(); mhAccounts.clear(); mhAccounts.append(new MHviewItem(AbstractMail::defaultLocalfolder(),this)); Account *it; for ( it = list.first(); it; it = list.next() ) { if ( it->getType() == MAILLIB::A_IMAP ) { IMAPaccount *imap = static_cast<IMAPaccount *>(it); imapAccounts.append(new IMAPviewItem( imap, this )); } else if ( it->getType() == MAILLIB::A_POP3 ) { POP3account *pop3 = static_cast<POP3account *>(it); /* must not be hold 'cause it isn't required */ (void) new POP3viewItem( pop3, this ); } else if ( it->getType() == MAILLIB::A_NNTP ) { NNTPaccount *nntp = static_cast<NNTPaccount *>(it); /* must not be hold 'cause it isn't required */ (void) new NNTPviewItem( nntp, this ); } } } void AccountView::refresh(QListViewItem *item) { if ( item ) { m_currentItem = item; QValueList<RecMailP> headerlist; AccountViewItem *view = static_cast<AccountViewItem *>(item); view->refresh(headerlist); emit refreshMailview(headerlist); } } void AccountView::refreshOutgoing() { m_currentItem = currentItem(); if ( !m_currentItem ) return; AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); + if ( !view->getFolder() ) + return; QString bName = view->getFolder()->getDisplayName(); if (bName.startsWith("/")&&bName.length()>1) { bName.replace(0,1,""); } int pos = bName.findRev("/"); if (pos > 0) { bName.replace(0,pos+1,""); } //qDebug("name *%s* ",bName.lower().latin1() ); if ( bName.lower() == "outgoing" || bName.lower() == "sent" || bName.lower() == "sendfailed" ) { refreshCurrent(); // qDebug("refresh "); } } void AccountView::refreshCurrent() { m_currentItem = currentItem(); if ( !m_currentItem ) return; QValueList<RecMailP> headerlist; AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); view->refresh(headerlist); emit refreshMailview(headerlist); } void AccountView::refreshAll() { } RecBodyP AccountView::fetchBody(const RecMailP&aMail) { QListViewItem*item = selectedItem (); if (!item) return new RecBody(); AccountViewItem *view = static_cast<AccountViewItem *>(item); return view->fetchBody(aMail); } void AccountView::setupFolderselect(Selectstore*sels) { #ifndef DESKTOP_VERSION sels->showMaximized(); #else sels->show(); #endif QStringList sFolders; unsigned int i = 0; for (i=0; i < mhAccounts.count();++i) { mhAccounts[i]->refresh(false); sFolders = mhAccounts[i]->subFolders(); sels->addAccounts(mhAccounts[i]->getWrapper(),sFolders); } for (i=0; i < imapAccounts.count();++i) { if (imapAccounts[i]->offline()) continue; imapAccounts[i]->refreshFolders(false); sels->addAccounts(imapAccounts[i]->getWrapper(),imapAccounts[i]->subFolders()); } } void AccountView::downloadMailsInbox(const FolderP&fromFolder,AbstractMail*fromWrapper) |