author | jgf <jgf> | 2003-12-17 19:07:13 (UTC) |
---|---|---|
committer | jgf <jgf> | 2003-12-17 19:07:13 (UTC) |
commit | f3389a1eeedce7be8638ba2f71476240a8a4fe0e (patch) (unidiff) | |
tree | 1e40a61e7def07dc94603a453295f065a748e8ff | |
parent | a928f1fc8469124e10a7042846d258401e41f7d6 (diff) | |
download | opie-f3389a1eeedce7be8638ba2f71476240a8a4fe0e.zip opie-f3389a1eeedce7be8638ba2f71476240a8a4fe0e.tar.gz opie-f3389a1eeedce7be8638ba2f71476240a8a4fe0e.tar.bz2 |
open pop3 folder per default
-rw-r--r-- | noncore/net/mail/accountview.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp index b6bf298..bc13336 100644 --- a/noncore/net/mail/accountview.cpp +++ b/noncore/net/mail/accountview.cpp | |||
@@ -1,112 +1,113 @@ | |||
1 | #include "accountview.h" | 1 | #include "accountview.h" |
2 | #include "mailtypes.h" | 2 | #include "mailtypes.h" |
3 | #include "defines.h" | 3 | #include "defines.h" |
4 | 4 | ||
5 | 5 | ||
6 | /** | 6 | /** |
7 | * POP3 Account stuff | 7 | * POP3 Account stuff |
8 | */ | 8 | */ |
9 | 9 | ||
10 | POP3viewItem::POP3viewItem( POP3account *a, QListView *parent ) | 10 | POP3viewItem::POP3viewItem( POP3account *a, QListView *parent ) |
11 | : AccountViewItem( parent ) | 11 | : AccountViewItem( parent ) |
12 | { | 12 | { |
13 | account = a; | 13 | account = a; |
14 | wrapper = AbstractMail::getWrapper( account ); | 14 | wrapper = AbstractMail::getWrapper( account ); |
15 | setPixmap( 0, PIXMAP_POP3FOLDER ); | 15 | setPixmap( 0, PIXMAP_POP3FOLDER ); |
16 | setText( 0, account->getAccountName() ); | 16 | setText( 0, account->getAccountName() ); |
17 | setOpen( true ); | ||
17 | } | 18 | } |
18 | 19 | ||
19 | POP3viewItem::~POP3viewItem() | 20 | POP3viewItem::~POP3viewItem() |
20 | { | 21 | { |
21 | delete wrapper; | 22 | delete wrapper; |
22 | } | 23 | } |
23 | 24 | ||
24 | AbstractMail *POP3viewItem::getWrapper() | 25 | AbstractMail *POP3viewItem::getWrapper() |
25 | { | 26 | { |
26 | return wrapper; | 27 | return wrapper; |
27 | } | 28 | } |
28 | 29 | ||
29 | void POP3viewItem::refresh( QList<RecMail> & ) | 30 | void POP3viewItem::refresh( QList<RecMail> & ) |
30 | { | 31 | { |
31 | QList<Folder> *folders = wrapper->listFolders(); | 32 | QList<Folder> *folders = wrapper->listFolders(); |
32 | QListViewItem *child = firstChild(); | 33 | QListViewItem *child = firstChild(); |
33 | while ( child ) { | 34 | while ( child ) { |
34 | QListViewItem *tmp = child; | 35 | QListViewItem *tmp = child; |
35 | child = child->nextSibling(); | 36 | child = child->nextSibling(); |
36 | delete tmp; | 37 | delete tmp; |
37 | } | 38 | } |
38 | Folder *it; | 39 | Folder *it; |
39 | QListViewItem*item = 0; | 40 | QListViewItem*item = 0; |
40 | for ( it = folders->first(); it; it = folders->next() ) { | 41 | for ( it = folders->first(); it; it = folders->next() ) { |
41 | item = new POP3folderItem( it, this , item ); | 42 | item = new POP3folderItem( it, this , item ); |
42 | item->setSelectable(it->may_select()); | 43 | item->setSelectable(it->may_select()); |
43 | } | 44 | } |
44 | // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 45 | // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
45 | folders->setAutoDelete(false); | 46 | folders->setAutoDelete(false); |
46 | delete folders; | 47 | delete folders; |
47 | } | 48 | } |
48 | 49 | ||
49 | RecBody POP3viewItem::fetchBody( const RecMail &mail ) | 50 | RecBody POP3viewItem::fetchBody( const RecMail &mail ) |
50 | { | 51 | { |
51 | qDebug( "POP3 fetchBody" ); | 52 | qDebug( "POP3 fetchBody" ); |
52 | return wrapper->fetchBody( mail ); | 53 | return wrapper->fetchBody( mail ); |
53 | } | 54 | } |
54 | 55 | ||
55 | POP3folderItem::~POP3folderItem() | 56 | POP3folderItem::~POP3folderItem() |
56 | { | 57 | { |
57 | delete folder; | 58 | delete folder; |
58 | } | 59 | } |
59 | 60 | ||
60 | POP3folderItem::POP3folderItem( Folder *folderInit, POP3viewItem *parent , QListViewItem*after ) | 61 | POP3folderItem::POP3folderItem( Folder *folderInit, POP3viewItem *parent , QListViewItem*after ) |
61 | : AccountViewItem( parent,after ) | 62 | : AccountViewItem( parent,after ) |
62 | { | 63 | { |
63 | folder = folderInit; | 64 | folder = folderInit; |
64 | pop3 = parent; | 65 | pop3 = parent; |
65 | if (folder->getDisplayName().lower()!="inbox") { | 66 | if (folder->getDisplayName().lower()!="inbox") { |
66 | setPixmap( 0, PIXMAP_POP3FOLDER ); | 67 | setPixmap( 0, PIXMAP_POP3FOLDER ); |
67 | } else { | 68 | } else { |
68 | setPixmap( 0, PIXMAP_INBOXFOLDER); | 69 | setPixmap( 0, PIXMAP_INBOXFOLDER); |
69 | } | 70 | } |
70 | setText( 0, folder->getDisplayName() ); | 71 | setText( 0, folder->getDisplayName() ); |
71 | } | 72 | } |
72 | 73 | ||
73 | void POP3folderItem::refresh(QList<RecMail>&target) | 74 | void POP3folderItem::refresh(QList<RecMail>&target) |
74 | { | 75 | { |
75 | if (folder->may_select()) | 76 | if (folder->may_select()) |
76 | pop3->getWrapper()->listMessages( folder->getName(),target ); | 77 | pop3->getWrapper()->listMessages( folder->getName(),target ); |
77 | } | 78 | } |
78 | 79 | ||
79 | RecBody POP3folderItem::fetchBody(const RecMail&aMail) | 80 | RecBody POP3folderItem::fetchBody(const RecMail&aMail) |
80 | { | 81 | { |
81 | return pop3->getWrapper()->fetchBody(aMail); | 82 | return pop3->getWrapper()->fetchBody(aMail); |
82 | } | 83 | } |
83 | 84 | ||
84 | /** | 85 | /** |
85 | * IMAP Account stuff | 86 | * IMAP Account stuff |
86 | */ | 87 | */ |
87 | IMAPviewItem::IMAPviewItem( IMAPaccount *a, QListView *parent ) | 88 | IMAPviewItem::IMAPviewItem( IMAPaccount *a, QListView *parent ) |
88 | : AccountViewItem( parent ) | 89 | : AccountViewItem( parent ) |
89 | { | 90 | { |
90 | account = a; | 91 | account = a; |
91 | wrapper = AbstractMail::getWrapper( account ); | 92 | wrapper = AbstractMail::getWrapper( account ); |
92 | setPixmap( 0, PIXMAP_IMAPFOLDER ); | 93 | setPixmap( 0, PIXMAP_IMAPFOLDER ); |
93 | setText( 0, account->getAccountName() ); | 94 | setText( 0, account->getAccountName() ); |
94 | setOpen( true ); | 95 | setOpen( true ); |
95 | } | 96 | } |
96 | 97 | ||
97 | IMAPviewItem::~IMAPviewItem() | 98 | IMAPviewItem::~IMAPviewItem() |
98 | { | 99 | { |
99 | delete wrapper; | 100 | delete wrapper; |
100 | } | 101 | } |
101 | 102 | ||
102 | AbstractMail *IMAPviewItem::getWrapper() | 103 | AbstractMail *IMAPviewItem::getWrapper() |
103 | { | 104 | { |
104 | return wrapper; | 105 | return wrapper; |
105 | } | 106 | } |
106 | 107 | ||
107 | void IMAPviewItem::refresh(QList<RecMail>&) | 108 | void IMAPviewItem::refresh(QList<RecMail>&) |
108 | { | 109 | { |
109 | if (childCount()>0) return; | 110 | if (childCount()>0) return; |
110 | QList<Folder> *folders = wrapper->listFolders(); | 111 | QList<Folder> *folders = wrapper->listFolders(); |
111 | 112 | ||
112 | QListViewItem *child = firstChild(); | 113 | QListViewItem *child = firstChild(); |