Diffstat (limited to 'noncore/net/mail/accountview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/accountview.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp index 9f07f56..2ce89db 100644 --- a/noncore/net/mail/accountview.cpp +++ b/noncore/net/mail/accountview.cpp | |||
@@ -1,15 +1,15 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | #include "accountview.h" | 2 | #include "accountview.h" |
3 | #include "mailtypes.h" | 3 | #include <libmailwrapper/mailtypes.h> |
4 | #include "defines.h" | 4 | #include "defines.h" |
5 | #include "newmaildir.h" | 5 | #include "newmaildir.h" |
6 | #include <qmessagebox.h> | 6 | #include <qmessagebox.h> |
7 | #include <qpopupmenu.h> | 7 | #include <qpopupmenu.h> |
8 | 8 | ||
9 | /** | 9 | /** |
10 | * POP3 Account stuff | 10 | * POP3 Account stuff |
11 | */ | 11 | */ |
12 | POP3viewItem::POP3viewItem( POP3account *a, QListView *parent ) | 12 | POP3viewItem::POP3viewItem( POP3account *a, QListView *parent ) |
13 | : AccountViewItem( parent ) | 13 | : AccountViewItem( parent ) |
14 | { | 14 | { |
15 | account = a; | 15 | account = a; |
@@ -154,39 +154,39 @@ IMAPfolderItem*IMAPviewItem::findSubItem(const QString&path,IMAPfolderItem*start | |||
154 | } | 154 | } |
155 | 155 | ||
156 | void IMAPviewItem::refresh(QList<RecMail>&) | 156 | void IMAPviewItem::refresh(QList<RecMail>&) |
157 | { | 157 | { |
158 | refreshFolders(false); | 158 | refreshFolders(false); |
159 | } | 159 | } |
160 | 160 | ||
161 | void IMAPviewItem::refreshFolders(bool force) | 161 | void IMAPviewItem::refreshFolders(bool force) |
162 | { | 162 | { |
163 | if (childCount()>0 && force==false) return; | 163 | if (childCount()>0 && force==false) return; |
164 | QList<Folder> *folders = wrapper->listFolders(); | 164 | QList<Folder> *folders = wrapper->listFolders(); |
165 | 165 | ||
166 | QListViewItem *child = firstChild(); | 166 | QListViewItem *child = firstChild(); |
167 | while ( child ) { | 167 | while ( child ) { |
168 | QListViewItem *tmp = child; | 168 | QListViewItem *tmp = child; |
169 | child = child->nextSibling(); | 169 | child = child->nextSibling(); |
170 | delete tmp; | 170 | delete tmp; |
171 | } | 171 | } |
172 | 172 | ||
173 | Folder *it; | 173 | Folder *it; |
174 | QListViewItem*item = 0; | 174 | QListViewItem*item = 0; |
175 | QListViewItem*titem = 0; | 175 | QListViewItem*titem = 0; |
176 | QString fname,del,search; | 176 | QString fname,del,search; |
177 | int pos; | 177 | int pos; |
178 | // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 178 | // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
179 | folders->setAutoDelete(false); | 179 | folders->setAutoDelete(false); |
180 | 180 | ||
181 | for ( it = folders->first(); it; it = folders->next() ) { | 181 | for ( it = folders->first(); it; it = folders->next() ) { |
182 | if (it->getDisplayName().lower()=="inbox") { | 182 | if (it->getDisplayName().lower()=="inbox") { |
183 | item = new IMAPfolderItem( it, this , item ); | 183 | item = new IMAPfolderItem( it, this , item ); |
184 | folders->remove(it); | 184 | folders->remove(it); |
185 | qDebug("inbox found"); | 185 | qDebug("inbox found"); |
186 | break; | 186 | break; |
187 | } | 187 | } |
188 | } | 188 | } |
189 | for ( it = folders->first(); it; it = folders->next() ) { | 189 | for ( it = folders->first(); it; it = folders->next() ) { |
190 | fname = it->getDisplayName(); | 190 | fname = it->getDisplayName(); |
191 | pos = fname.findRev(it->Separator()); | 191 | pos = fname.findRev(it->Separator()); |
192 | if (pos != -1) { | 192 | if (pos != -1) { |
@@ -408,25 +408,25 @@ void AccountViewItem::deleteAllMail(AbstractMail*wrapper,Folder*folder) | |||
408 | AccountView * view = (AccountView*)listView(); | 408 | AccountView * view = (AccountView*)listView(); |
409 | if (view) view->refreshCurrent(); | 409 | if (view) view->refreshCurrent(); |
410 | } | 410 | } |
411 | } | 411 | } |
412 | } | 412 | } |
413 | 413 | ||
414 | AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) | 414 | AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) |
415 | : QListView( parent, name, flags ) | 415 | : QListView( parent, name, flags ) |
416 | { | 416 | { |
417 | connect( this, SIGNAL( selectionChanged( QListViewItem * ) ), | 417 | connect( this, SIGNAL( selectionChanged( QListViewItem * ) ), |
418 | SLOT( refresh( QListViewItem * ) ) ); | 418 | SLOT( refresh( QListViewItem * ) ) ); |
419 | connect( this, SIGNAL( mouseButtonPressed(int, QListViewItem *,const QPoint&,int ) ),this, | 419 | connect( this, SIGNAL( mouseButtonPressed(int, QListViewItem *,const QPoint&,int ) ),this, |
420 | SLOT( slotHold( int, QListViewItem *,const QPoint&,int ) ) ); | 420 | SLOT( slotHold( int, QListViewItem *,const QPoint&,int ) ) ); |
421 | 421 | ||
422 | setSorting(0); | 422 | setSorting(0); |
423 | } | 423 | } |
424 | 424 | ||
425 | void AccountView::slotContextMenu(int id) | 425 | void AccountView::slotContextMenu(int id) |
426 | { | 426 | { |
427 | AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); | 427 | AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); |
428 | if (!view) return; | 428 | if (!view) return; |
429 | view->contextMenuSelected(id); | 429 | view->contextMenuSelected(id); |
430 | } | 430 | } |
431 | 431 | ||
432 | void AccountView::slotHold(int button, QListViewItem * item,const QPoint&,int) | 432 | void AccountView::slotHold(int button, QListViewItem * item,const QPoint&,int) |
@@ -598,25 +598,25 @@ MBOXfolderItem::~MBOXfolderItem() | |||
598 | } | 598 | } |
599 | 599 | ||
600 | MBOXfolderItem::MBOXfolderItem( Folder *folderInit, MBOXviewItem *parent , QListViewItem*after ) | 600 | MBOXfolderItem::MBOXfolderItem( Folder *folderInit, MBOXviewItem *parent , QListViewItem*after ) |
601 | : AccountViewItem( parent,after ) | 601 | : AccountViewItem( parent,after ) |
602 | { | 602 | { |
603 | folder = folderInit; | 603 | folder = folderInit; |
604 | mbox = parent; | 604 | mbox = parent; |
605 | if (folder->getDisplayName().lower() == "outgoing") { | 605 | if (folder->getDisplayName().lower() == "outgoing") { |
606 | setPixmap( 0, PIXMAP_OUTBOXFOLDER ); | 606 | setPixmap( 0, PIXMAP_OUTBOXFOLDER ); |
607 | } else if (folder->getDisplayName().lower() == "inbox") { | 607 | } else if (folder->getDisplayName().lower() == "inbox") { |
608 | setPixmap( 0, PIXMAP_INBOXFOLDER); | 608 | setPixmap( 0, PIXMAP_INBOXFOLDER); |
609 | } else { | 609 | } else { |
610 | setPixmap( 0, PIXMAP_MBOXFOLDER ); | 610 | setPixmap( 0, PIXMAP_MBOXFOLDER ); |
611 | } | 611 | } |
612 | setText( 0, folder->getDisplayName() ); | 612 | setText( 0, folder->getDisplayName() ); |
613 | } | 613 | } |
614 | 614 | ||
615 | void MBOXfolderItem::refresh(QList<RecMail>&target) | 615 | void MBOXfolderItem::refresh(QList<RecMail>&target) |
616 | { | 616 | { |
617 | if (folder->may_select()) | 617 | if (folder->may_select()) |
618 | mbox->getWrapper()->listMessages( folder->getName(),target ); | 618 | mbox->getWrapper()->listMessages( folder->getName(),target ); |
619 | } | 619 | } |
620 | 620 | ||
621 | RecBody MBOXfolderItem::fetchBody(const RecMail&aMail) | 621 | RecBody MBOXfolderItem::fetchBody(const RecMail&aMail) |
622 | { | 622 | { |