summaryrefslogtreecommitdiff
authoralwin <alwin>2003-12-14 03:41:49 (UTC)
committer alwin <alwin>2003-12-14 03:41:49 (UTC)
commit84ac61a9b46d463c9e3112f55cc1e69957d1348a (patch) (side-by-side diff)
treeaa2a03fc364b529a9863d44b9d51f030b22f4820
parent12ba6ab9606538628afc7f7015e115a0251d0389 (diff)
downloadopie-84ac61a9b46d463c9e3112f55cc1e69957d1348a.zip
opie-84ac61a9b46d463c9e3112f55cc1e69957d1348a.tar.gz
opie-84ac61a9b46d463c9e3112f55cc1e69957d1348a.tar.bz2
-memleak fixed
-check for non-selectable mailboxes -potential crasher fixed -selection handling better (app will not send a net-command on each mouse click)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/accountview.cpp9
-rw-r--r--noncore/net/mail/imapwrapper.cpp14
-rw-r--r--noncore/net/mail/libmailwrapper/imapwrapper.cpp14
-rw-r--r--noncore/net/mail/libmailwrapper/pop3wrapper.cpp2
-rw-r--r--noncore/net/mail/mainwindow.cpp2
-rw-r--r--noncore/net/mail/pop3wrapper.cpp2
-rw-r--r--noncore/net/mail/viewmail.cpp2
7 files changed, 29 insertions, 16 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp
index 847b099..d725b87 100644
--- a/noncore/net/mail/accountview.cpp
+++ b/noncore/net/mail/accountview.cpp
@@ -75,3 +75,7 @@ void IMAPviewItem::refresh(QList<RecMail>&)
item = new IMAPfolderItem( it, this , item );
+ item->setSelectable(it->may_select());
}
+ // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ folders->setAutoDelete(false);
+ delete folders;
}
@@ -99,3 +103,4 @@ void IMAPfolderItem::refresh(QList<RecMail>&target)
{
- imap->getWrapper()->listMessages( folder->getName(),target );
+ if (folder->may_select())
+ imap->getWrapper()->listMessages( folder->getName(),target );
}
@@ -114,3 +119,3 @@ AccountView::AccountView( QWidget *parent, const char *name, WFlags flags )
{
- connect( this, SIGNAL( clicked( QListViewItem * ) ),
+ connect( this, SIGNAL( selectionChanged( QListViewItem * ) ),
SLOT( refresh( QListViewItem * ) ) );
diff --git a/noncore/net/mail/imapwrapper.cpp b/noncore/net/mail/imapwrapper.cpp
index 9ee0dff..912a412 100644
--- a/noncore/net/mail/imapwrapper.cpp
+++ b/noncore/net/mail/imapwrapper.cpp
@@ -151,3 +151,3 @@ QList<Folder>* IMAPwrapper::listFolders()
QList<Folder> * folders = new QList<Folder>();
- folders->setAutoDelete( true );
+ folders->setAutoDelete( false );
login();
@@ -190,2 +190,4 @@ QList<Folder>* IMAPwrapper::listFolders()
qDebug(path);
+ bool selectable = true;
+ mailimap_mbx_list_flags*bflags;
err = mailimap_list( m_imap, (char*)path, (char*)mask, &result );
@@ -193,3 +195,3 @@ QList<Folder>* IMAPwrapper::listFolders()
current = result->first;
- for ( int i = result->count; i > 0; i-- ) {
+ for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) {
list = (mailimap_mailbox_list *) current->data;
@@ -198,7 +200,9 @@ QList<Folder>* IMAPwrapper::listFolders()
temp = list->mb_name;
- current = current->next;
if (temp.lower()=="inbox")
continue;
- folders->append(new IMAPFolder(temp));
-
+ if ( (bflags = list->mb_flag) ) {
+ selectable = !(bflags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG&&
+ bflags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT);
+ }
+ folders->append(new IMAPFolder(temp,selectable));
}
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
index 9ee0dff..912a412 100644
--- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
@@ -151,3 +151,3 @@ QList<Folder>* IMAPwrapper::listFolders()
QList<Folder> * folders = new QList<Folder>();
- folders->setAutoDelete( true );
+ folders->setAutoDelete( false );
login();
@@ -190,2 +190,4 @@ QList<Folder>* IMAPwrapper::listFolders()
qDebug(path);
+ bool selectable = true;
+ mailimap_mbx_list_flags*bflags;
err = mailimap_list( m_imap, (char*)path, (char*)mask, &result );
@@ -193,3 +195,3 @@ QList<Folder>* IMAPwrapper::listFolders()
current = result->first;
- for ( int i = result->count; i > 0; i-- ) {
+ for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) {
list = (mailimap_mailbox_list *) current->data;
@@ -198,7 +200,9 @@ QList<Folder>* IMAPwrapper::listFolders()
temp = list->mb_name;
- current = current->next;
if (temp.lower()=="inbox")
continue;
- folders->append(new IMAPFolder(temp));
-
+ if ( (bflags = list->mb_flag) ) {
+ selectable = !(bflags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG&&
+ bflags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT);
+ }
+ folders->append(new IMAPFolder(temp,selectable));
}
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
index 62523bf..5065d29 100644
--- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
@@ -275,3 +275,3 @@ QList<Folder>* POP3wrapper::listFolders()
QList<Folder> * folders = new QList<Folder>();
- folders->setAutoDelete( true );
+ folders->setAutoDelete( false );
Folder*inb=new Folder("INBOX");
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp
index cab1a66..fae3e97 100644
--- a/noncore/net/mail/mainwindow.cpp
+++ b/noncore/net/mail/mainwindow.cpp
@@ -85,3 +85,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
folderView->header()->hide();
- folderView->setRootIsDecorated( false );
+ folderView->setRootIsDecorated( true );
folderView->addColumn( tr( "Mailbox" ) );
diff --git a/noncore/net/mail/pop3wrapper.cpp b/noncore/net/mail/pop3wrapper.cpp
index 62523bf..5065d29 100644
--- a/noncore/net/mail/pop3wrapper.cpp
+++ b/noncore/net/mail/pop3wrapper.cpp
@@ -275,3 +275,3 @@ QList<Folder>* POP3wrapper::listFolders()
QList<Folder> * folders = new QList<Folder>();
- folders->setAutoDelete( true );
+ folders->setAutoDelete( false );
Folder*inb=new Folder("INBOX");
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp
index 2415c82..e53f4a3 100644
--- a/noncore/net/mail/viewmail.cpp
+++ b/noncore/net/mail/viewmail.cpp
@@ -1,3 +1,3 @@
#include <qtextbrowser.h>
-#include <qmessagebox.h>?
+#include <qmessagebox.h>
#include <qtextstream.h>