-rw-r--r-- | kmicromail/accountitem.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/kmicromail/accountitem.cpp b/kmicromail/accountitem.cpp index 7b9b881..59c8abb 100644 --- a/kmicromail/accountitem.cpp +++ b/kmicromail/accountitem.cpp | |||
@@ -1,204 +1,206 @@ | |||
1 | 1 | ||
2 | #include "accountitem.h" | 2 | #include "accountitem.h" |
3 | #include "accountview.h" | 3 | #include "accountview.h" |
4 | #include "newmaildir.h" | 4 | #include "newmaildir.h" |
5 | #include "nntpgroupsdlg.h" | 5 | #include "nntpgroupsdlg.h" |
6 | #include "defines.h" | 6 | #include "defines.h" |
7 | 7 | ||
8 | #include <libmailwrapper/mailtypes.h> | 8 | #include <libmailwrapper/mailtypes.h> |
9 | #include <libmailwrapper/abstractmail.h> | 9 | #include <libmailwrapper/abstractmail.h> |
10 | #include <libmailwrapper/mailwrapper.h> | 10 | #include <libmailwrapper/mailwrapper.h> |
11 | /* OPIE */ | 11 | /* OPIE */ |
12 | //#include <qpe/qpeapplication.h> | 12 | //#include <qpe/qpeapplication.h> |
13 | 13 | ||
14 | /* QT */ | 14 | /* QT */ |
15 | #include <qpopupmenu.h> | 15 | #include <qpopupmenu.h> |
16 | #include <qmessagebox.h> | 16 | #include <qmessagebox.h> |
17 | #include <kiconloader.h> | 17 | #include <kiconloader.h> |
18 | 18 | ||
19 | #define GET_NEW_MAILS 101 | ||
20 | |||
19 | using namespace Opie::Core; | 21 | using namespace Opie::Core; |
20 | #define SETPIX(x) if (!account->getOffline()) {setPixmap( 0,x);} else {setPixmap( 0, PIXMAP_OFFLINE );} | 22 | #define SETPIX(x) if (!account->getOffline()) {setPixmap( 0,x);} else {setPixmap( 0, PIXMAP_OFFLINE );} |
21 | /** | 23 | /** |
22 | * POP3 Account stuff | 24 | * POP3 Account stuff |
23 | */ | 25 | */ |
24 | POP3viewItem::POP3viewItem( POP3account *a, AccountView *parent ) | 26 | POP3viewItem::POP3viewItem( POP3account *a, AccountView *parent ) |
25 | : AccountViewItem( parent ) | 27 | : AccountViewItem( parent ) |
26 | { | 28 | { |
27 | account = a; | 29 | account = a; |
28 | wrapper = AbstractMail::getWrapper( account ); | 30 | wrapper = AbstractMail::getWrapper( account ); |
29 | SETPIX(PIXMAP_POP3FOLDER); | 31 | SETPIX(PIXMAP_POP3FOLDER); |
30 | #if 0 | 32 | #if 0 |
31 | if (!account->getOffline()) | 33 | if (!account->getOffline()) |
32 | { | 34 | { |
33 | setPixmap( 0, ); | 35 | setPixmap( 0, ); |
34 | } | 36 | } |
35 | else | 37 | else |
36 | { | 38 | { |
37 | setPixmap( 0, PIXMAP_OFFLINE ); | 39 | setPixmap( 0, PIXMAP_OFFLINE ); |
38 | } | 40 | } |
39 | #endif | 41 | #endif |
40 | setText( 0, account->getAccountName() ); | 42 | setText( 0, account->getAccountName() ); |
41 | setOpen( true ); | 43 | setOpen( true ); |
42 | } | 44 | } |
43 | 45 | ||
44 | POP3viewItem::~POP3viewItem() | 46 | POP3viewItem::~POP3viewItem() |
45 | { | 47 | { |
46 | delete wrapper; | 48 | delete wrapper; |
47 | } | 49 | } |
48 | 50 | ||
49 | AbstractMail *POP3viewItem::getWrapper() | 51 | AbstractMail *POP3viewItem::getWrapper() |
50 | { | 52 | { |
51 | return wrapper; | 53 | return wrapper; |
52 | } | 54 | } |
53 | 55 | ||
54 | void POP3viewItem::refresh(QValueList<Opie::Core::OSmartPointer<RecMail> > & ) | 56 | void POP3viewItem::refresh(QValueList<Opie::Core::OSmartPointer<RecMail> > & ) |
55 | { | 57 | { |
56 | refresh(); | 58 | refresh(); |
57 | } | 59 | } |
58 | 60 | ||
59 | void POP3viewItem::refresh() | 61 | void POP3viewItem::refresh() |
60 | { | 62 | { |
61 | if (account->getOffline()) return; | 63 | if (account->getOffline()) return; |
62 | QValueList<FolderP> *folders = wrapper->listFolders(); | 64 | QValueList<FolderP> *folders = wrapper->listFolders(); |
63 | QListViewItem *child = firstChild(); | 65 | QListViewItem *child = firstChild(); |
64 | while ( child ) | 66 | while ( child ) |
65 | { | 67 | { |
66 | QListViewItem *tmp = child; | 68 | QListViewItem *tmp = child; |
67 | child = child->nextSibling(); | 69 | child = child->nextSibling(); |
68 | delete tmp; | 70 | delete tmp; |
69 | } | 71 | } |
70 | QValueList<FolderP>::ConstIterator it; | 72 | QValueList<FolderP>::ConstIterator it; |
71 | QListViewItem*item = 0; | 73 | QListViewItem*item = 0; |
72 | for ( it = folders->begin(); it!=folders->end(); ++it) | 74 | for ( it = folders->begin(); it!=folders->end(); ++it) |
73 | { | 75 | { |
74 | item = new POP3folderItem( (*it), this , item ); | 76 | item = new POP3folderItem( (*it), this , item ); |
75 | item->setSelectable( (*it)->may_select()); | 77 | item->setSelectable( (*it)->may_select()); |
76 | } | 78 | } |
77 | delete folders; | 79 | delete folders; |
78 | } | 80 | } |
79 | 81 | ||
80 | RECBODYP POP3viewItem::fetchBody( const RecMailP &mail ) | 82 | RECBODYP POP3viewItem::fetchBody( const RecMailP &mail ) |
81 | { | 83 | { |
82 | 84 | ||
83 | return wrapper->fetchBody( mail ); | 85 | return wrapper->fetchBody( mail ); |
84 | } | 86 | } |
85 | 87 | ||
86 | QPopupMenu * POP3viewItem::getContextMenu() | 88 | QPopupMenu * POP3viewItem::getContextMenu() |
87 | { | 89 | { |
88 | QPopupMenu *m = new QPopupMenu(0); | 90 | QPopupMenu *m = new QPopupMenu(0); |
89 | if (m) | 91 | if (m) |
90 | { | 92 | { |
91 | if (!account->getOffline()) | 93 | if (!account->getOffline()) |
92 | { | 94 | { |
93 | m->insertItem(QObject::tr("Disconnect",contextName),0); | 95 | m->insertItem(QObject::tr("Disconnect",contextName),0); |
94 | m->insertItem(QObject::tr("Set offline",contextName),1); | 96 | m->insertItem(QObject::tr("Set offline",contextName),1); |
95 | m->insertItem(QObject::tr("Download new INBOX messages",contextName),2); | 97 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); |
96 | } | 98 | } |
97 | else | 99 | else |
98 | { | 100 | { |
99 | m->insertItem(QObject::tr("Set online",contextName),1); | 101 | m->insertItem(QObject::tr("Set online",contextName),1); |
100 | m->insertItem(QObject::tr("Download new INBOX messages",contextName),2); | 102 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); |
101 | } | 103 | } |
102 | } | 104 | } |
103 | return m; | 105 | return m; |
104 | } | 106 | } |
105 | 107 | ||
106 | void POP3viewItem::disconnect() | 108 | void POP3viewItem::disconnect() |
107 | { | 109 | { |
108 | QListViewItem *child = firstChild(); | 110 | QListViewItem *child = firstChild(); |
109 | while ( child ) | 111 | while ( child ) |
110 | { | 112 | { |
111 | QListViewItem *tmp = child; | 113 | QListViewItem *tmp = child; |
112 | child = child->nextSibling(); | 114 | child = child->nextSibling(); |
113 | delete tmp; | 115 | delete tmp; |
114 | } | 116 | } |
115 | wrapper->logout(); | 117 | wrapper->logout(); |
116 | } | 118 | } |
117 | 119 | ||
118 | void POP3viewItem::setOnOffline() | 120 | void POP3viewItem::setOnOffline() |
119 | { | 121 | { |
120 | if (!account->getOffline()) | 122 | if (!account->getOffline()) |
121 | { | 123 | { |
122 | disconnect(); | 124 | disconnect(); |
123 | } | 125 | } |
124 | account->setOffline(!account->getOffline()); | 126 | account->setOffline(!account->getOffline()); |
125 | account->save(); | 127 | account->save(); |
126 | SETPIX(PIXMAP_POP3FOLDER); | 128 | SETPIX(PIXMAP_POP3FOLDER); |
127 | refresh(); | 129 | refresh(); |
128 | } | 130 | } |
129 | 131 | ||
130 | void POP3viewItem::contextMenuSelected(int which) | 132 | void POP3viewItem::contextMenuSelected(int which) |
131 | { | 133 | { |
132 | switch (which) | 134 | switch (which) |
133 | { | 135 | { |
134 | case 0: | 136 | case 0: |
135 | disconnect(); | 137 | disconnect(); |
136 | break; | 138 | break; |
137 | case 1: | 139 | case 1: |
138 | setOnOffline(); | 140 | setOnOffline(); |
139 | break; | 141 | break; |
140 | case 2: // daunlood | 142 | case GET_NEW_MAILS: // daunlood |
141 | if (account->getOffline()) | 143 | if (account->getOffline()) |
142 | setOnOffline(); | 144 | setOnOffline(); |
143 | AccountView*bl = accountView(); | 145 | AccountView*bl = accountView(); |
144 | if (!bl) return; | 146 | if (!bl) return; |
145 | AccountViewItem* in = findSubItem( "inbox" , 0); | 147 | AccountViewItem* in = findSubItem( "inbox" , 0); |
146 | if ( ! in ) | 148 | if ( ! in ) |
147 | return; | 149 | return; |
148 | bl->downloadMailsInbox(in->getFolder() ,getWrapper()); | 150 | bl->downloadMailsInbox(in->getFolder() ,getWrapper()); |
149 | setOnOffline(); | 151 | setOnOffline(); |
150 | break; | 152 | break; |
151 | } | 153 | } |
152 | } | 154 | } |
153 | 155 | ||
154 | POP3folderItem::~POP3folderItem() | 156 | POP3folderItem::~POP3folderItem() |
155 | {} | 157 | {} |
156 | 158 | ||
157 | POP3folderItem::POP3folderItem( const FolderP&folderInit, POP3viewItem *parent , QListViewItem*after ) | 159 | POP3folderItem::POP3folderItem( const FolderP&folderInit, POP3viewItem *parent , QListViewItem*after ) |
158 | : AccountViewItem(folderInit,parent,after ) | 160 | : AccountViewItem(folderInit,parent,after ) |
159 | { | 161 | { |
160 | pop3 = parent; | 162 | pop3 = parent; |
161 | if (folder->getDisplayName().lower()!="inbox") | 163 | if (folder->getDisplayName().lower()!="inbox") |
162 | { | 164 | { |
163 | setPixmap( 0, PIXMAP_POP3FOLDER ); | 165 | setPixmap( 0, PIXMAP_POP3FOLDER ); |
164 | } | 166 | } |
165 | else | 167 | else |
166 | { | 168 | { |
167 | setPixmap( 0, PIXMAP_INBOXFOLDER); | 169 | setPixmap( 0, PIXMAP_INBOXFOLDER); |
168 | } | 170 | } |
169 | setText( 0, folder->getDisplayName() ); | 171 | setText( 0, folder->getDisplayName() ); |
170 | } | 172 | } |
171 | 173 | ||
172 | void POP3folderItem::refresh(QValueList<RecMailP>&target) | 174 | void POP3folderItem::refresh(QValueList<RecMailP>&target) |
173 | { | 175 | { |
174 | if (folder->may_select()) | 176 | if (folder->may_select()) |
175 | pop3->getWrapper()->listMessages( folder->getName(),target ); | 177 | pop3->getWrapper()->listMessages( folder->getName(),target ); |
176 | } | 178 | } |
177 | 179 | ||
178 | RECBODYP POP3folderItem::fetchBody(const RecMailP&aMail) | 180 | RECBODYP POP3folderItem::fetchBody(const RecMailP&aMail) |
179 | { | 181 | { |
180 | return pop3->getWrapper()->fetchBody(aMail); | 182 | return pop3->getWrapper()->fetchBody(aMail); |
181 | } | 183 | } |
182 | 184 | ||
183 | QPopupMenu * POP3folderItem::getContextMenu() | 185 | QPopupMenu * POP3folderItem::getContextMenu() |
184 | { | 186 | { |
185 | QPopupMenu *m = new QPopupMenu(0); | 187 | QPopupMenu *m = new QPopupMenu(0); |
186 | if (m) | 188 | if (m) |
187 | { | 189 | { |
188 | m->insertItem(QObject::tr("Refresh header list",contextName),0); | 190 | m->insertItem(QObject::tr("Refresh header list",contextName),0); |
189 | m->insertItem(QObject::tr("Delete all mails",contextName),1); | 191 | m->insertItem(QObject::tr("Delete all mails",contextName),1); |
190 | m->insertItem(QObject::tr("Move/Copie all mails",contextName),2); | 192 | m->insertItem(QObject::tr("Move/Copie all mails",contextName),2); |
191 | } | 193 | } |
192 | return m; | 194 | return m; |
193 | } | 195 | } |
194 | 196 | ||
195 | void POP3folderItem::downloadMails() | 197 | void POP3folderItem::downloadMails() |
196 | { | 198 | { |
197 | AccountView*bl = pop3->accountView(); | 199 | AccountView*bl = pop3->accountView(); |
198 | if (!bl) return; | 200 | if (!bl) return; |
199 | bl->downloadMails(folder,pop3->getWrapper()); | 201 | bl->downloadMails(folder,pop3->getWrapper()); |
200 | } | 202 | } |
201 | 203 | ||
202 | void POP3folderItem::contextMenuSelected(int which) | 204 | void POP3folderItem::contextMenuSelected(int which) |
203 | { | 205 | { |
204 | AccountView * view = (AccountView*)listView(); | 206 | AccountView * view = (AccountView*)listView(); |
@@ -456,189 +458,189 @@ const QStringList&IMAPviewItem::subFolders() | |||
456 | 458 | ||
457 | void IMAPviewItem::refreshFolders(bool force) | 459 | void IMAPviewItem::refreshFolders(bool force) |
458 | { | 460 | { |
459 | if (childCount()>0 && force==false) return; | 461 | if (childCount()>0 && force==false) return; |
460 | if (account->getOffline()) return; | 462 | if (account->getOffline()) return; |
461 | 463 | ||
462 | removeChilds(); | 464 | removeChilds(); |
463 | currentFolders.clear(); | 465 | currentFolders.clear(); |
464 | QValueList<FolderP> * folders = wrapper->listFolders(); | 466 | QValueList<FolderP> * folders = wrapper->listFolders(); |
465 | 467 | ||
466 | QValueList<FolderP>::Iterator it; | 468 | QValueList<FolderP>::Iterator it; |
467 | QListViewItem*item = 0; | 469 | QListViewItem*item = 0; |
468 | QListViewItem*titem = 0; | 470 | QListViewItem*titem = 0; |
469 | QString fname,del,search; | 471 | QString fname,del,search; |
470 | int pos; | 472 | int pos; |
471 | 473 | ||
472 | for ( it = folders->begin(); it!=folders->end(); ++it) | 474 | for ( it = folders->begin(); it!=folders->end(); ++it) |
473 | { | 475 | { |
474 | if ((*it)->getDisplayName().lower()=="inbox") | 476 | if ((*it)->getDisplayName().lower()=="inbox") |
475 | { | 477 | { |
476 | item = new IMAPfolderItem( (*it), this , item ); | 478 | item = new IMAPfolderItem( (*it), this , item ); |
477 | folders->remove(it); | 479 | folders->remove(it); |
478 | break; | 480 | break; |
479 | } | 481 | } |
480 | } | 482 | } |
481 | for ( it = folders->begin(); it!=folders->end(); ++it) | 483 | for ( it = folders->begin(); it!=folders->end(); ++it) |
482 | { | 484 | { |
483 | fname = (*it)->getDisplayName(); | 485 | fname = (*it)->getDisplayName(); |
484 | currentFolders.append((*it)->getName()); | 486 | currentFolders.append((*it)->getName()); |
485 | pos = fname.findRev((*it)->Separator()); | 487 | pos = fname.findRev((*it)->Separator()); |
486 | if (pos != -1) | 488 | if (pos != -1) |
487 | { | 489 | { |
488 | fname = fname.left(pos); | 490 | fname = fname.left(pos); |
489 | } | 491 | } |
490 | IMAPfolderItem*pitem = (IMAPfolderItem*)findSubItem(fname); | 492 | IMAPfolderItem*pitem = (IMAPfolderItem*)findSubItem(fname); |
491 | if (pitem) | 493 | if (pitem) |
492 | { | 494 | { |
493 | titem = item; | 495 | titem = item; |
494 | item = new IMAPfolderItem( (*it),pitem,pitem->firstChild(),this); | 496 | item = new IMAPfolderItem( (*it),pitem,pitem->firstChild(),this); |
495 | /* setup the short name */ | 497 | /* setup the short name */ |
496 | item->setText(0,(*it)->getDisplayName().right((*it)->getDisplayName().length()-pos-1)); | 498 | item->setText(0,(*it)->getDisplayName().right((*it)->getDisplayName().length()-pos-1)); |
497 | item = titem; | 499 | item = titem; |
498 | } | 500 | } |
499 | else | 501 | else |
500 | { | 502 | { |
501 | item = new IMAPfolderItem( (*it), this , item ); | 503 | item = new IMAPfolderItem( (*it), this , item ); |
502 | } | 504 | } |
503 | } | 505 | } |
504 | delete folders; | 506 | delete folders; |
505 | } | 507 | } |
506 | 508 | ||
507 | QPopupMenu * IMAPviewItem::getContextMenu() | 509 | QPopupMenu * IMAPviewItem::getContextMenu() |
508 | { | 510 | { |
509 | QPopupMenu *m = new QPopupMenu(0); | 511 | QPopupMenu *m = new QPopupMenu(0); |
510 | if (m) | 512 | if (m) |
511 | { | 513 | { |
512 | if (!account->getOffline()) | 514 | if (!account->getOffline()) |
513 | { | 515 | { |
514 | m->insertItem(QObject::tr("Refresh folder list",contextName),0); | 516 | m->insertItem(QObject::tr("Refresh folder list",contextName),0); |
515 | m->insertItem(QObject::tr("Create new folder",contextName),1); | 517 | m->insertItem(QObject::tr("Create new folder",contextName),1); |
516 | m->insertSeparator(); | 518 | m->insertSeparator(); |
517 | m->insertItem(QObject::tr("Disconnect",contextName),2); | 519 | m->insertItem(QObject::tr("Disconnect",contextName),2); |
518 | m->insertItem(QObject::tr("Set offline",contextName),3); | 520 | m->insertItem(QObject::tr("Set offline",contextName),3); |
519 | m->insertSeparator(); | 521 | m->insertSeparator(); |
520 | m->insertItem(QObject::tr("Download new INBOX messages",contextName),4); | 522 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); |
521 | } | 523 | } |
522 | else | 524 | else |
523 | { | 525 | { |
524 | m->insertItem(QObject::tr("Set online",contextName),3); | 526 | m->insertItem(QObject::tr("Set online",contextName),3); |
525 | m->insertSeparator(); | 527 | m->insertSeparator(); |
526 | m->insertItem(QObject::tr("Download new INBOX messages",contextName),4); | 528 | m->insertItem(QObject::tr("Get new messages",contextName),GET_NEW_MAILS); |
527 | } | 529 | } |
528 | } | 530 | } |
529 | return m; | 531 | return m; |
530 | } | 532 | } |
531 | 533 | ||
532 | void IMAPviewItem::createNewFolder() | 534 | void IMAPviewItem::createNewFolder() |
533 | { | 535 | { |
534 | Newmdirdlg ndirdlg; | 536 | Newmdirdlg ndirdlg; |
535 | 537 | ||
536 | ndirdlg.showMaximized(); | 538 | ndirdlg.showMaximized(); |
537 | if ( ndirdlg.exec() ) | 539 | if ( ndirdlg.exec() ) |
538 | { | 540 | { |
539 | QString ndir = ndirdlg.Newdir(); | 541 | QString ndir = ndirdlg.Newdir(); |
540 | bool makesubs = ndirdlg.subpossible(); | 542 | bool makesubs = ndirdlg.subpossible(); |
541 | QString delemiter = "/"; | 543 | QString delemiter = "/"; |
542 | IMAPfolderItem*item = (IMAPfolderItem*)firstChild(); | 544 | IMAPfolderItem*item = (IMAPfolderItem*)firstChild(); |
543 | if (item) | 545 | if (item) |
544 | { | 546 | { |
545 | delemiter = item->Delemiter(); | 547 | delemiter = item->Delemiter(); |
546 | } | 548 | } |
547 | if (wrapper->createMbox(ndir,0,delemiter,makesubs)) | 549 | if (wrapper->createMbox(ndir,0,delemiter,makesubs)) |
548 | { | 550 | { |
549 | refreshFolders(true); | 551 | refreshFolders(true); |
550 | } | 552 | } |
551 | } | 553 | } |
552 | } | 554 | } |
553 | 555 | ||
554 | void IMAPviewItem::contextMenuSelected(int id) | 556 | void IMAPviewItem::contextMenuSelected(int id) |
555 | { | 557 | { |
556 | 558 | ||
557 | switch (id) | 559 | switch (id) |
558 | { | 560 | { |
559 | case 0: | 561 | case 0: |
560 | refreshFolders(true); | 562 | refreshFolders(true); |
561 | break; | 563 | break; |
562 | case 1: | 564 | case 1: |
563 | createNewFolder(); | 565 | createNewFolder(); |
564 | break; | 566 | break; |
565 | case 2: | 567 | case 2: |
566 | removeChilds(); | 568 | removeChilds(); |
567 | wrapper->logout(); | 569 | wrapper->logout(); |
568 | break; | 570 | break; |
569 | case 3: | 571 | case 3: |
570 | if (account->getOffline()==false) | 572 | if (account->getOffline()==false) |
571 | { | 573 | { |
572 | removeChilds(); | 574 | removeChilds(); |
573 | wrapper->logout(); | 575 | wrapper->logout(); |
574 | } | 576 | } |
575 | account->setOffline(!account->getOffline()); | 577 | account->setOffline(!account->getOffline()); |
576 | account->save(); | 578 | account->save(); |
577 | SETPIX(PIXMAP_IMAPFOLDER); | 579 | SETPIX(PIXMAP_IMAPFOLDER); |
578 | refreshFolders(false); | 580 | refreshFolders(false); |
579 | break; | 581 | break; |
580 | case 4: // daunlood | 582 | case GET_NEW_MAILS: // daunlood |
581 | { | 583 | { |
582 | if (account->getOffline()) { | 584 | if (account->getOffline()) { |
583 | contextMenuSelected( 3 ); | 585 | contextMenuSelected( 3 ); |
584 | } | 586 | } |
585 | AccountView*bl = accountView(); | 587 | AccountView*bl = accountView(); |
586 | if (!bl) return; | 588 | if (!bl) return; |
587 | AccountViewItem* in = findSubItem( "inbox" , 0); | 589 | AccountViewItem* in = findSubItem( "inbox" , 0); |
588 | if ( ! in ) | 590 | if ( ! in ) |
589 | return; | 591 | return; |
590 | bl->downloadMailsInbox(in->getFolder(),getWrapper()); | 592 | bl->downloadMailsInbox(in->getFolder(),getWrapper()); |
591 | } | 593 | } |
592 | break; | 594 | break; |
593 | default: | 595 | default: |
594 | break; | 596 | break; |
595 | } | 597 | } |
596 | } | 598 | } |
597 | 599 | ||
598 | RECBODYP IMAPviewItem::fetchBody(const RecMailP&) | 600 | RECBODYP IMAPviewItem::fetchBody(const RecMailP&) |
599 | { | 601 | { |
600 | return new RecBody(); | 602 | return new RecBody(); |
601 | } | 603 | } |
602 | 604 | ||
603 | bool IMAPviewItem::offline() | 605 | bool IMAPviewItem::offline() |
604 | { | 606 | { |
605 | return account->getOffline(); | 607 | return account->getOffline(); |
606 | } | 608 | } |
607 | 609 | ||
608 | IMAPfolderItem::IMAPfolderItem( const FolderP& folderInit, IMAPviewItem *parent , QListViewItem*after ) | 610 | IMAPfolderItem::IMAPfolderItem( const FolderP& folderInit, IMAPviewItem *parent , QListViewItem*after ) |
609 | : AccountViewItem( folderInit, parent , after ) | 611 | : AccountViewItem( folderInit, parent , after ) |
610 | { | 612 | { |
611 | imap = parent; | 613 | imap = parent; |
612 | if (folder->getDisplayName().lower()!="inbox") | 614 | if (folder->getDisplayName().lower()!="inbox") |
613 | { | 615 | { |
614 | setPixmap( 0, PIXMAP_IMAPFOLDER ); | 616 | setPixmap( 0, PIXMAP_IMAPFOLDER ); |
615 | } | 617 | } |
616 | else | 618 | else |
617 | { | 619 | { |
618 | setPixmap( 0, PIXMAP_INBOXFOLDER); | 620 | setPixmap( 0, PIXMAP_INBOXFOLDER); |
619 | } | 621 | } |
620 | setText( 0, folder->getDisplayName() ); | 622 | setText( 0, folder->getDisplayName() ); |
621 | } | 623 | } |
622 | 624 | ||
623 | IMAPfolderItem::IMAPfolderItem(const FolderP &folderInit, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ) | 625 | IMAPfolderItem::IMAPfolderItem(const FolderP &folderInit, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ) |
624 | : AccountViewItem(folderInit, parent,after ) | 626 | : AccountViewItem(folderInit, parent,after ) |
625 | { | 627 | { |
626 | imap = master; | 628 | imap = master; |
627 | if (folder->getDisplayName().lower()!="inbox") | 629 | if (folder->getDisplayName().lower()!="inbox") |
628 | { | 630 | { |
629 | setPixmap( 0, PIXMAP_IMAPFOLDER ); | 631 | setPixmap( 0, PIXMAP_IMAPFOLDER ); |
630 | } | 632 | } |
631 | else | 633 | else |
632 | { | 634 | { |
633 | setPixmap( 0, PIXMAP_INBOXFOLDER); | 635 | setPixmap( 0, PIXMAP_INBOXFOLDER); |
634 | } | 636 | } |
635 | setText( 0, folder->getDisplayName() ); | 637 | setText( 0, folder->getDisplayName() ); |
636 | } | 638 | } |
637 | 639 | ||
638 | IMAPfolderItem::~IMAPfolderItem() | 640 | IMAPfolderItem::~IMAPfolderItem() |
639 | {} | 641 | {} |
640 | 642 | ||
641 | const QString& IMAPfolderItem::Delemiter()const | 643 | const QString& IMAPfolderItem::Delemiter()const |
642 | { | 644 | { |
643 | return folder->Separator(); | 645 | return folder->Separator(); |
644 | } | 646 | } |