author | alwin <alwin> | 2003-12-14 01:54:32 (UTC) |
---|---|---|
committer | alwin <alwin> | 2003-12-14 01:54:32 (UTC) |
commit | 154e03927d2b97f3f76f807fe104ac9d74035215 (patch) (unidiff) | |
tree | 11ab26b6e072f79dc9ebcb78e887b7e269f908f5 /noncore/net/mail | |
parent | 898d1d9abda9889c3bb3adc44dd253e0a4ede746 (diff) | |
download | opie-154e03927d2b97f3f76f807fe104ac9d74035215.zip opie-154e03927d2b97f3f76f807fe104ac9d74035215.tar.gz opie-154e03927d2b97f3f76f807fe104ac9d74035215.tar.bz2 |
order of imapfolders will be displayed as the server lists
-rw-r--r-- | noncore/net/mail/accountview.cpp | 8 | ||||
-rw-r--r-- | noncore/net/mail/accountview.h | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp index ac4f0e0..847b099 100644 --- a/noncore/net/mail/accountview.cpp +++ b/noncore/net/mail/accountview.cpp | |||
@@ -67,14 +67,15 @@ void IMAPviewItem::refresh(QList<RecMail>&) | |||
67 | QListViewItem *tmp = child; | 67 | QListViewItem *tmp = child; |
68 | child = child->nextSibling(); | 68 | child = child->nextSibling(); |
69 | delete tmp; | 69 | delete tmp; |
70 | } | 70 | } |
71 | 71 | ||
72 | Folder *it; | 72 | Folder *it; |
73 | QListViewItem*item = 0; | ||
73 | for ( it = folders->first(); it; it = folders->next() ) { | 74 | for ( it = folders->first(); it; it = folders->next() ) { |
74 | (void) new IMAPfolderItem( it, this ); | 75 | item = new IMAPfolderItem( it, this , item ); |
75 | } | 76 | } |
76 | } | 77 | } |
77 | 78 | ||
78 | RecBody IMAPviewItem::fetchBody(const RecMail&) | 79 | RecBody IMAPviewItem::fetchBody(const RecMail&) |
79 | { | 80 | { |
80 | return RecBody(); | 81 | return RecBody(); |
@@ -82,14 +83,14 @@ RecBody IMAPviewItem::fetchBody(const RecMail&) | |||
82 | 83 | ||
83 | IMAPfolderItem::~IMAPfolderItem() | 84 | IMAPfolderItem::~IMAPfolderItem() |
84 | { | 85 | { |
85 | delete folder; | 86 | delete folder; |
86 | } | 87 | } |
87 | 88 | ||
88 | IMAPfolderItem::IMAPfolderItem( Folder *folderInit, IMAPviewItem *parent ) | 89 | IMAPfolderItem::IMAPfolderItem( Folder *folderInit, IMAPviewItem *parent , QListViewItem*after ) |
89 | : AccountViewItem( parent ) | 90 | : AccountViewItem( parent,after ) |
90 | { | 91 | { |
91 | folder = folderInit; | 92 | folder = folderInit; |
92 | imap = parent; | 93 | imap = parent; |
93 | setPixmap( 0, PIXMAP_IMAPFOLDER ); | 94 | setPixmap( 0, PIXMAP_IMAPFOLDER ); |
94 | setText( 0, folder->getDisplayName() ); | 95 | setText( 0, folder->getDisplayName() ); |
95 | } | 96 | } |
@@ -110,12 +111,13 @@ RecBody IMAPfolderItem::fetchBody(const RecMail&aMail) | |||
110 | 111 | ||
111 | AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) | 112 | AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) |
112 | : QListView( parent, name, flags ) | 113 | : QListView( parent, name, flags ) |
113 | { | 114 | { |
114 | connect( this, SIGNAL( clicked( QListViewItem * ) ), | 115 | connect( this, SIGNAL( clicked( QListViewItem * ) ), |
115 | SLOT( refresh( QListViewItem * ) ) ); | 116 | SLOT( refresh( QListViewItem * ) ) ); |
117 | setSorting(-1); | ||
116 | } | 118 | } |
117 | 119 | ||
118 | void AccountView::populate( QList<Account> list ) | 120 | void AccountView::populate( QList<Account> list ) |
119 | { | 121 | { |
120 | clear(); | 122 | clear(); |
121 | 123 | ||
diff --git a/noncore/net/mail/accountview.h b/noncore/net/mail/accountview.h index cdc87ce..04f9b7a 100644 --- a/noncore/net/mail/accountview.h +++ b/noncore/net/mail/accountview.h | |||
@@ -14,13 +14,14 @@ class RecBody; | |||
14 | 14 | ||
15 | class AccountViewItem : public QListViewItem | 15 | class AccountViewItem : public QListViewItem |
16 | { | 16 | { |
17 | 17 | ||
18 | public: | 18 | public: |
19 | AccountViewItem( QListView *parent ) : QListViewItem( parent ) {} | 19 | AccountViewItem( QListView *parent ) : QListViewItem( parent ) {} |
20 | AccountViewItem( QListViewItem *parent ) : QListViewItem( parent ) {} | 20 | AccountViewItem( QListViewItem *parent) : QListViewItem( parent) {} |
21 | AccountViewItem( QListViewItem *parent , QListViewItem*after ) : QListViewItem( parent,after ) {} | ||
21 | virtual void refresh(QList<RecMail>&)=0; | 22 | virtual void refresh(QList<RecMail>&)=0; |
22 | virtual RecBody fetchBody(const RecMail&)=0; | 23 | virtual RecBody fetchBody(const RecMail&)=0; |
23 | }; | 24 | }; |
24 | 25 | ||
25 | class POP3viewItem : public AccountViewItem | 26 | class POP3viewItem : public AccountViewItem |
26 | { | 27 | { |
@@ -52,13 +53,13 @@ private: | |||
52 | }; | 53 | }; |
53 | 54 | ||
54 | class IMAPfolderItem : public AccountViewItem | 55 | class IMAPfolderItem : public AccountViewItem |
55 | { | 56 | { |
56 | 57 | ||
57 | public: | 58 | public: |
58 | IMAPfolderItem( Folder *folder, IMAPviewItem *parent ); | 59 | IMAPfolderItem( Folder *folder, IMAPviewItem *parent , QListViewItem*after ); |
59 | ~IMAPfolderItem(); | 60 | ~IMAPfolderItem(); |
60 | virtual void refresh(QList<RecMail>&); | 61 | virtual void refresh(QList<RecMail>&); |
61 | virtual RecBody fetchBody(const RecMail&); | 62 | virtual RecBody fetchBody(const RecMail&); |
62 | private: | 63 | private: |
63 | Folder *folder; | 64 | Folder *folder; |
64 | IMAPviewItem *imap; | 65 | IMAPviewItem *imap; |