Diffstat (limited to 'noncore/net/mail/accountview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/accountview.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp index 9f4f358..62cbf62 100644 --- a/noncore/net/mail/accountview.cpp +++ b/noncore/net/mail/accountview.cpp @@ -568,25 +568,25 @@ AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) { connect( this, SIGNAL( selectionChanged( QListViewItem * ) ), SLOT( refresh( QListViewItem * ) ) ); connect( this, SIGNAL( mouseButtonPressed(int, QListViewItem *,const QPoint&,int ) ),this, SLOT( slotHold( int, QListViewItem *,const QPoint&,int ) ) ); setSorting(0); } AccountView::~AccountView() { imapAccounts.clear(); - mboxAccounts.clear(); + mhAccounts.clear(); } void AccountView::slotContextMenu(int id) { AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); if (!view) return; view->contextMenuSelected(id); } void AccountView::slotHold(int button, QListViewItem * item,const QPoint&,int) { if (button==1) {return;} @@ -596,27 +596,27 @@ void AccountView::slotHold(int button, QListViewItem * item,const QPoint&,int) 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(); - mboxAccounts.clear(); + mhAccounts.clear(); - mboxAccounts.append(new MBOXviewItem(AbstractMail::defaultLocalfolder(),this)); + mhAccounts.append(new MHviewItem(AbstractMail::defaultLocalfolder(),this)); Account *it; for ( it = list.first(); it; it = list.next() ) { if ( it->getType().compare( "IMAP" ) == 0 ) { IMAPaccount *imap = static_cast<IMAPaccount *>(it); qDebug( "added IMAP " + imap->getAccountName() ); imapAccounts.append(new IMAPviewItem( imap, this )); } else if ( it->getType().compare( "POP3" ) == 0 ) { POP3account *pop3 = static_cast<POP3account *>(it); qDebug( "added POP3 " + pop3->getAccountName() ); /* must not be hold 'cause it isn't required */ (void) new POP3viewItem( pop3, this ); @@ -657,28 +657,28 @@ RecBody AccountView::fetchBody(const RecMail&aMail) { QListViewItem*item = selectedItem (); if (!item) return RecBody(); AccountViewItem *view = static_cast<AccountViewItem *>(item); return view->fetchBody(aMail); } void AccountView::setupFolderselect(Selectstore*sels) { sels->showMaximized(); QStringList sFolders; unsigned int i = 0; - for (i=0; i < mboxAccounts.count();++i) { - mboxAccounts[i]->refresh(false); - sFolders = mboxAccounts[i]->subFolders(); - sels->addAccounts(mboxAccounts[i]->getWrapper(),sFolders); + 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::downloadMails(Folder*fromFolder,AbstractMail*fromWrapper) { AbstractMail*targetMail = 0; @@ -695,205 +695,205 @@ void AccountView::downloadMails(Folder*fromFolder,AbstractMail*fromWrapper) if (sels.newFolder() && !targetMail->createMbox(targetFolder)) { QMessageBox::critical(0,tr("Error creating new Folder"), tr("<center>Error while creating<br>new folder - breaking.</center>")); return; } qDebug("Targetfolder: %s",targetFolder.latin1()); qDebug("Fromfolder: %s",fromFolder->getName().latin1()); fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails()); refreshCurrent(); } /** - * MBOX Account stuff + * MH Account stuff */ -MBOXviewItem::MBOXviewItem( const QString&aPath, AccountView *parent ) +MHviewItem::MHviewItem( const QString&aPath, AccountView *parent ) : AccountViewItem( parent ) { m_Path = aPath; /* be carefull - the space within settext is wanted - thats why the string twice */ wrapper = AbstractMail::getWrapper( m_Path,"Local Folders"); setPixmap( 0, PIXMAP_LOCALFOLDER ); setText( 0, " Local Folders" ); setOpen( true ); } -MBOXviewItem::~MBOXviewItem() +MHviewItem::~MHviewItem() { delete wrapper; } -AbstractMail *MBOXviewItem::getWrapper() +AbstractMail *MHviewItem::getWrapper() { return wrapper; } -void MBOXviewItem::refresh( QList<RecMail> & ) +void MHviewItem::refresh( QList<RecMail> & ) { refresh(false); } -void MBOXviewItem::refresh(bool force) +void MHviewItem::refresh(bool force) { if (childCount()>0 && force==false) return; QList<Folder> *folders = wrapper->listFolders(); QListViewItem *child = firstChild(); while ( child ) { QListViewItem *tmp = child; child = child->nextSibling(); delete tmp; } Folder *it; QListViewItem*item = 0; for ( it = folders->first(); it; it = folders->next() ) { - item = new MBOXfolderItem( it, this , item ); + item = new MHfolderItem( it, this , item ); item->setSelectable(it->may_select()); } // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! folders->setAutoDelete(false); delete folders; } -RecBody MBOXviewItem::fetchBody( const RecMail &mail ) +RecBody MHviewItem::fetchBody( const RecMail &mail ) { - qDebug( "MBOX fetchBody" ); + qDebug( "MH fetchBody" ); return wrapper->fetchBody( mail ); } -QPopupMenu * MBOXviewItem::getContextMenu() +QPopupMenu * MHviewItem::getContextMenu() { QPopupMenu *m = new QPopupMenu(0); if (m) { m->insertItem(QObject::tr("Refresh folder list",contextName),0); m->insertItem(QObject::tr("Create new folder",contextName),1); } return m; } -void MBOXviewItem::createFolder() +void MHviewItem::createFolder() { Newmdirdlg ndirdlg(0,0,true); ndirdlg.showMaximized(); if (ndirdlg.exec()) { QString ndir = ndirdlg.Newdir(); if (wrapper->createMbox(ndir)) { refresh(true); } } } -QStringList MBOXviewItem::subFolders() +QStringList MHviewItem::subFolders() { QStringList result; QListViewItem *child = firstChild(); while ( child ) { - MBOXfolderItem *tmp = (MBOXfolderItem*)child; + MHfolderItem *tmp = (MHfolderItem*)child; child = child->nextSibling(); - result.append(tmp->getFolder()->getName()); + result.append(tmp->getFolder()->getDisplayName()); } qDebug("Size of result: %i",result.count()); return result; } -void MBOXviewItem::contextMenuSelected(int which) +void MHviewItem::contextMenuSelected(int which) { switch (which) { case 0: refresh(true); break; case 1: createFolder(); break; default: break; } } -MBOXfolderItem::~MBOXfolderItem() +MHfolderItem::~MHfolderItem() { delete folder; } -MBOXfolderItem::MBOXfolderItem( Folder *folderInit, MBOXviewItem *parent , QListViewItem*after ) +MHfolderItem::MHfolderItem( Folder *folderInit, MHviewItem *parent , QListViewItem*after ) : AccountViewItem( parent,after ) { folder = folderInit; mbox = parent; if (folder->getDisplayName().lower() == "outgoing") { setPixmap( 0, PIXMAP_OUTBOXFOLDER ); } else if (folder->getDisplayName().lower() == "inbox") { setPixmap( 0, PIXMAP_INBOXFOLDER); } else { setPixmap( 0, PIXMAP_MBOXFOLDER ); } setText( 0, folder->getDisplayName() ); } -Folder*MBOXfolderItem::getFolder() +Folder*MHfolderItem::getFolder() { return folder; } -void MBOXfolderItem::refresh(QList<RecMail>&target) +void MHfolderItem::refresh(QList<RecMail>&target) { if (folder->may_select()) mbox->getWrapper()->listMessages( folder->getName(),target ); } -RecBody MBOXfolderItem::fetchBody(const RecMail&aMail) +RecBody MHfolderItem::fetchBody(const RecMail&aMail) { return mbox->getWrapper()->fetchBody(aMail); } -void MBOXfolderItem::deleteFolder() +void MHfolderItem::deleteFolder() { int yesno = QMessageBox::warning(0,QObject::tr("Delete folder",contextName), QObject::tr("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>",contextName).arg(folder->getDisplayName()), QObject::tr("Yes",contextName), QObject::tr("No",contextName),QString::null,1,1); qDebug("Auswahl: %i",yesno); if (yesno == 0) { if (mbox->getWrapper()->deleteMbox(folder)) { QListView*v=listView(); - MBOXviewItem * box = mbox; + MHviewItem * box = mbox; /* be carefull - after that this object is destroyd so don't use * any member of it after that call!!*/ mbox->refresh(true); if (v) { v->setSelected(box,true); } } } } -QPopupMenu * MBOXfolderItem::getContextMenu() +QPopupMenu * MHfolderItem::getContextMenu() { QPopupMenu *m = new QPopupMenu(0); if (m) { m->insertItem(QObject::tr("Delete all mails",contextName),0); m->insertItem(QObject::tr("Delete folder",contextName),1); m->insertItem(QObject::tr("Move/Copie all mails",contextName),2); } return m; } -void MBOXfolderItem::downloadMails() +void MHfolderItem::downloadMails() { AccountView*bl = mbox->accountView(); if (!bl) return; bl->downloadMails(folder,mbox->getWrapper()); } -void MBOXfolderItem::contextMenuSelected(int which) +void MHfolderItem::contextMenuSelected(int which) { switch(which) { case 0: deleteAllMail(mbox->getWrapper(),folder); break; case 1: deleteFolder(); break; case 2: downloadMails(); break; default: |