summaryrefslogtreecommitdiff
path: root/noncore
authoralwin <alwin>2003-12-14 01:54:32 (UTC)
committer alwin <alwin>2003-12-14 01:54:32 (UTC)
commit154e03927d2b97f3f76f807fe104ac9d74035215 (patch) (side-by-side diff)
tree11ab26b6e072f79dc9ebcb78e887b7e269f908f5 /noncore
parent898d1d9abda9889c3bb3adc44dd253e0a4ede746 (diff)
downloadopie-154e03927d2b97f3f76f807fe104ac9d74035215.zip
opie-154e03927d2b97f3f76f807fe104ac9d74035215.tar.gz
opie-154e03927d2b97f3f76f807fe104ac9d74035215.tar.bz2
order of imapfolders will be displayed as the server lists
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/accountview.cpp8
-rw-r--r--noncore/net/mail/accountview.h5
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>&)
QListViewItem *tmp = child;
child = child->nextSibling();
delete tmp;
}
Folder *it;
+ QListViewItem*item = 0;
for ( it = folders->first(); it; it = folders->next() ) {
- (void) new IMAPfolderItem( it, this );
+ item = new IMAPfolderItem( it, this , item );
}
}
RecBody IMAPviewItem::fetchBody(const RecMail&)
{
return RecBody();
@@ -82,14 +83,14 @@ RecBody IMAPviewItem::fetchBody(const RecMail&)
IMAPfolderItem::~IMAPfolderItem()
{
delete folder;
}
-IMAPfolderItem::IMAPfolderItem( Folder *folderInit, IMAPviewItem *parent )
- : AccountViewItem( parent )
+IMAPfolderItem::IMAPfolderItem( Folder *folderInit, IMAPviewItem *parent , QListViewItem*after )
+ : AccountViewItem( parent,after )
{
folder = folderInit;
imap = parent;
setPixmap( 0, PIXMAP_IMAPFOLDER );
setText( 0, folder->getDisplayName() );
}
@@ -110,12 +111,13 @@ RecBody IMAPfolderItem::fetchBody(const RecMail&aMail)
AccountView::AccountView( QWidget *parent, const char *name, WFlags flags )
: QListView( parent, name, flags )
{
connect( this, SIGNAL( clicked( QListViewItem * ) ),
SLOT( refresh( QListViewItem * ) ) );
+ setSorting(-1);
}
void AccountView::populate( QList<Account> list )
{
clear();
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;
class AccountViewItem : public QListViewItem
{
public:
AccountViewItem( QListView *parent ) : QListViewItem( parent ) {}
- AccountViewItem( QListViewItem *parent ) : QListViewItem( parent ) {}
+ AccountViewItem( QListViewItem *parent) : QListViewItem( parent) {}
+ AccountViewItem( QListViewItem *parent , QListViewItem*after ) : QListViewItem( parent,after ) {}
virtual void refresh(QList<RecMail>&)=0;
virtual RecBody fetchBody(const RecMail&)=0;
};
class POP3viewItem : public AccountViewItem
{
@@ -52,13 +53,13 @@ private:
};
class IMAPfolderItem : public AccountViewItem
{
public:
- IMAPfolderItem( Folder *folder, IMAPviewItem *parent );
+ IMAPfolderItem( Folder *folder, IMAPviewItem *parent , QListViewItem*after );
~IMAPfolderItem();
virtual void refresh(QList<RecMail>&);
virtual RecBody fetchBody(const RecMail&);
private:
Folder *folder;
IMAPviewItem *imap;