summaryrefslogtreecommitdiff
authoralwin <alwin>2003-12-14 03:41:49 (UTC)
committer alwin <alwin>2003-12-14 03:41:49 (UTC)
commit84ac61a9b46d463c9e3112f55cc1e69957d1348a (patch) (unidiff)
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
@@ -52,88 +52,93 @@ IMAPviewItem::~IMAPviewItem()
52{ 52{
53 delete wrapper; 53 delete wrapper;
54} 54}
55 55
56AbstractMail *IMAPviewItem::getWrapper() 56AbstractMail *IMAPviewItem::getWrapper()
57{ 57{
58 return wrapper; 58 return wrapper;
59} 59}
60 60
61void IMAPviewItem::refresh(QList<RecMail>&) 61void IMAPviewItem::refresh(QList<RecMail>&)
62{ 62{
63 QList<Folder> *folders = wrapper->listFolders(); 63 QList<Folder> *folders = wrapper->listFolders();
64 64
65 QListViewItem *child = firstChild(); 65 QListViewItem *child = firstChild();
66 while ( child ) { 66 while ( child ) {
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 QListViewItem*item = 0;
74 for ( it = folders->first(); it; it = folders->next() ) { 74 for ( it = folders->first(); it; it = folders->next() ) {
75 item = new IMAPfolderItem( it, this , item ); 75 item = new IMAPfolderItem( it, this , item );
76 item->setSelectable(it->may_select());
76 } 77 }
78 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
79 folders->setAutoDelete(false);
80 delete folders;
77} 81}
78 82
79RecBody IMAPviewItem::fetchBody(const RecMail&) 83RecBody IMAPviewItem::fetchBody(const RecMail&)
80{ 84{
81 return RecBody(); 85 return RecBody();
82} 86}
83 87
84IMAPfolderItem::~IMAPfolderItem() 88IMAPfolderItem::~IMAPfolderItem()
85{ 89{
86 delete folder; 90 delete folder;
87} 91}
88 92
89IMAPfolderItem::IMAPfolderItem( Folder *folderInit, IMAPviewItem *parent , QListViewItem*after ) 93IMAPfolderItem::IMAPfolderItem( Folder *folderInit, IMAPviewItem *parent , QListViewItem*after )
90 : AccountViewItem( parent,after ) 94 : AccountViewItem( parent,after )
91{ 95{
92 folder = folderInit; 96 folder = folderInit;
93 imap = parent; 97 imap = parent;
94 setPixmap( 0, PIXMAP_IMAPFOLDER ); 98 setPixmap( 0, PIXMAP_IMAPFOLDER );
95 setText( 0, folder->getDisplayName() ); 99 setText( 0, folder->getDisplayName() );
96} 100}
97 101
98void IMAPfolderItem::refresh(QList<RecMail>&target) 102void IMAPfolderItem::refresh(QList<RecMail>&target)
99{ 103{
100 imap->getWrapper()->listMessages( folder->getName(),target ); 104 if (folder->may_select())
105 imap->getWrapper()->listMessages( folder->getName(),target );
101} 106}
102 107
103RecBody IMAPfolderItem::fetchBody(const RecMail&aMail) 108RecBody IMAPfolderItem::fetchBody(const RecMail&aMail)
104{ 109{
105 return imap->getWrapper()->fetchBody(aMail); 110 return imap->getWrapper()->fetchBody(aMail);
106} 111}
107 112
108/** 113/**
109 * Generic stuff 114 * Generic stuff
110 */ 115 */
111 116
112AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) 117AccountView::AccountView( QWidget *parent, const char *name, WFlags flags )
113 : QListView( parent, name, flags ) 118 : QListView( parent, name, flags )
114{ 119{
115 connect( this, SIGNAL( clicked( QListViewItem * ) ), 120 connect( this, SIGNAL( selectionChanged( QListViewItem * ) ),
116 SLOT( refresh( QListViewItem * ) ) ); 121 SLOT( refresh( QListViewItem * ) ) );
117 setSorting(-1); 122 setSorting(-1);
118} 123}
119 124
120void AccountView::populate( QList<Account> list ) 125void AccountView::populate( QList<Account> list )
121{ 126{
122 clear(); 127 clear();
123 128
124 Account *it; 129 Account *it;
125 for ( it = list.first(); it; it = list.next() ) { 130 for ( it = list.first(); it; it = list.next() ) {
126 if ( it->getType().compare( "IMAP" ) == 0 ) { 131 if ( it->getType().compare( "IMAP" ) == 0 ) {
127 IMAPaccount *imap = static_cast<IMAPaccount *>(it); 132 IMAPaccount *imap = static_cast<IMAPaccount *>(it);
128 qDebug( "added IMAP " + imap->getAccountName() ); 133 qDebug( "added IMAP " + imap->getAccountName() );
129 (void) new IMAPviewItem( imap, this ); 134 (void) new IMAPviewItem( imap, this );
130 } else if ( it->getType().compare( "POP3" ) == 0 ) { 135 } else if ( it->getType().compare( "POP3" ) == 0 ) {
131 POP3account *pop3 = static_cast<POP3account *>(it); 136 POP3account *pop3 = static_cast<POP3account *>(it);
132 qDebug( "added POP3 " + pop3->getAccountName() ); 137 qDebug( "added POP3 " + pop3->getAccountName() );
133 (void) new POP3viewItem( pop3, this ); 138 (void) new POP3viewItem( pop3, this );
134 } 139 }
135 } 140 }
136} 141}
137 142
138void AccountView::refresh(QListViewItem *item) { 143void AccountView::refresh(QListViewItem *item) {
139 144
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
@@ -128,100 +128,104 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target )
128 ++i; 128 ++i;
129 msg_att = (mailimap_msg_att*)current->data; 129 msg_att = (mailimap_msg_att*)current->data;
130 RecMail*m = parse_list_result(msg_att); 130 RecMail*m = parse_list_result(msg_att);
131 if (m) { 131 if (m) {
132 m->setNumber(i); 132 m->setNumber(i);
133 m->setMbox(mailbox); 133 m->setMbox(mailbox);
134 m->setWrapper(this); 134 m->setWrapper(this);
135 target.append(m); 135 target.append(m);
136 } 136 }
137 } 137 }
138 } else { 138 } else {
139 qDebug("Error fetching headers: %s",m_imap->imap_response); 139 qDebug("Error fetching headers: %s",m_imap->imap_response);
140 } 140 }
141 mailimap_fetch_list_free(result); 141 mailimap_fetch_list_free(result);
142} 142}
143 143
144QList<Folder>* IMAPwrapper::listFolders() 144QList<Folder>* IMAPwrapper::listFolders()
145{ 145{
146 const char *path, *mask; 146 const char *path, *mask;
147 int err = MAILIMAP_NO_ERROR; 147 int err = MAILIMAP_NO_ERROR;
148 clist *result; 148 clist *result;
149 clistcell *current; 149 clistcell *current;
150 150
151 QList<Folder> * folders = new QList<Folder>(); 151 QList<Folder> * folders = new QList<Folder>();
152 folders->setAutoDelete( true ); 152 folders->setAutoDelete( false );
153 login(); 153 login();
154 if (!m_imap) { 154 if (!m_imap) {
155 return folders; 155 return folders;
156 } 156 }
157 157
158/* 158/*
159 * First we have to check for INBOX 'cause it sometimes it's not inside the path. 159 * First we have to check for INBOX 'cause it sometimes it's not inside the path.
160 * We must not forget to filter them out in next loop! 160 * We must not forget to filter them out in next loop!
161 * it seems like ugly code. and yes - it is ugly code. but the best way. 161 * it seems like ugly code. and yes - it is ugly code. but the best way.
162 */ 162 */
163 QString temp; 163 QString temp;
164 mask = "INBOX" ; 164 mask = "INBOX" ;
165 result = clist_new(); 165 result = clist_new();
166 mailimap_mailbox_list *list; 166 mailimap_mailbox_list *list;
167 err = mailimap_list( m_imap, (char*)"", (char*)mask, &result ); 167 err = mailimap_list( m_imap, (char*)"", (char*)mask, &result );
168 if ( err == MAILIMAP_NO_ERROR ) { 168 if ( err == MAILIMAP_NO_ERROR ) {
169 current = result->first; 169 current = result->first;
170 for ( int i = result->count; i > 0; i-- ) { 170 for ( int i = result->count; i > 0; i-- ) {
171 list = (mailimap_mailbox_list *) current->data; 171 list = (mailimap_mailbox_list *) current->data;
172 // it is better use the deep copy mechanism of qt itself 172 // it is better use the deep copy mechanism of qt itself
173 // instead of using strdup! 173 // instead of using strdup!
174 temp = list->mb_name; 174 temp = list->mb_name;
175 folders->append( new IMAPFolder(temp)); 175 folders->append( new IMAPFolder(temp));
176 current = current->next; 176 current = current->next;
177 } 177 }
178 } else { 178 } else {
179 qDebug("error fetching folders: %s",m_imap->imap_response); 179 qDebug("error fetching folders: %s",m_imap->imap_response);
180 } 180 }
181 mailimap_list_result_free( result ); 181 mailimap_list_result_free( result );
182 182
183/* 183/*
184 * second stage - get the other then inbox folders 184 * second stage - get the other then inbox folders
185 */ 185 */
186 mask = "*" ; 186 mask = "*" ;
187 path = account->getPrefix().latin1(); 187 path = account->getPrefix().latin1();
188 if (!path) path = ""; 188 if (!path) path = "";
189 result = clist_new(); 189 result = clist_new();
190 qDebug(path); 190 qDebug(path);
191 bool selectable = true;
192 mailimap_mbx_list_flags*bflags;
191 err = mailimap_list( m_imap, (char*)path, (char*)mask, &result ); 193 err = mailimap_list( m_imap, (char*)path, (char*)mask, &result );
192 if ( err == MAILIMAP_NO_ERROR ) { 194 if ( err == MAILIMAP_NO_ERROR ) {
193 current = result->first; 195 current = result->first;
194 for ( int i = result->count; i > 0; i-- ) { 196 for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) {
195 list = (mailimap_mailbox_list *) current->data; 197 list = (mailimap_mailbox_list *) current->data;
196 // it is better use the deep copy mechanism of qt itself 198 // it is better use the deep copy mechanism of qt itself
197 // instead of using strdup! 199 // instead of using strdup!
198 temp = list->mb_name; 200 temp = list->mb_name;
199 current = current->next;
200 if (temp.lower()=="inbox") 201 if (temp.lower()=="inbox")
201 continue; 202 continue;
202 folders->append(new IMAPFolder(temp)); 203 if ( (bflags = list->mb_flag) ) {
203 204 selectable = !(bflags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG&&
205 bflags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT);
206 }
207 folders->append(new IMAPFolder(temp,selectable));
204 } 208 }
205 } else { 209 } else {
206 qDebug("error fetching folders %s",m_imap->imap_response); 210 qDebug("error fetching folders %s",m_imap->imap_response);
207 } 211 }
208 mailimap_list_result_free( result ); 212 mailimap_list_result_free( result );
209 return folders; 213 return folders;
210} 214}
211 215
212RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) 216RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
213{ 217{
214 RecMail * m = 0; 218 RecMail * m = 0;
215 mailimap_msg_att_item *item=0; 219 mailimap_msg_att_item *item=0;
216 clistcell *current,*c,*cf; 220 clistcell *current,*c,*cf;
217 mailimap_msg_att_dynamic*flist; 221 mailimap_msg_att_dynamic*flist;
218 mailimap_flag_fetch*cflag; 222 mailimap_flag_fetch*cflag;
219 int size; 223 int size;
220 QBitArray mFlags(7); 224 QBitArray mFlags(7);
221 QStringList addresslist; 225 QStringList addresslist;
222 226
223 if (!m_att) { 227 if (!m_att) {
224 return m; 228 return m;
225 } 229 }
226 m = new RecMail(); 230 m = new RecMail();
227 for (c = clist_begin(m_att->att_list); c!=NULL;c=clist_next(c) ) { 231 for (c = clist_begin(m_att->att_list); c!=NULL;c=clist_next(c) ) {
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
@@ -128,100 +128,104 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target )
128 ++i; 128 ++i;
129 msg_att = (mailimap_msg_att*)current->data; 129 msg_att = (mailimap_msg_att*)current->data;
130 RecMail*m = parse_list_result(msg_att); 130 RecMail*m = parse_list_result(msg_att);
131 if (m) { 131 if (m) {
132 m->setNumber(i); 132 m->setNumber(i);
133 m->setMbox(mailbox); 133 m->setMbox(mailbox);
134 m->setWrapper(this); 134 m->setWrapper(this);
135 target.append(m); 135 target.append(m);
136 } 136 }
137 } 137 }
138 } else { 138 } else {
139 qDebug("Error fetching headers: %s",m_imap->imap_response); 139 qDebug("Error fetching headers: %s",m_imap->imap_response);
140 } 140 }
141 mailimap_fetch_list_free(result); 141 mailimap_fetch_list_free(result);
142} 142}
143 143
144QList<Folder>* IMAPwrapper::listFolders() 144QList<Folder>* IMAPwrapper::listFolders()
145{ 145{
146 const char *path, *mask; 146 const char *path, *mask;
147 int err = MAILIMAP_NO_ERROR; 147 int err = MAILIMAP_NO_ERROR;
148 clist *result; 148 clist *result;
149 clistcell *current; 149 clistcell *current;
150 150
151 QList<Folder> * folders = new QList<Folder>(); 151 QList<Folder> * folders = new QList<Folder>();
152 folders->setAutoDelete( true ); 152 folders->setAutoDelete( false );
153 login(); 153 login();
154 if (!m_imap) { 154 if (!m_imap) {
155 return folders; 155 return folders;
156 } 156 }
157 157
158/* 158/*
159 * First we have to check for INBOX 'cause it sometimes it's not inside the path. 159 * First we have to check for INBOX 'cause it sometimes it's not inside the path.
160 * We must not forget to filter them out in next loop! 160 * We must not forget to filter them out in next loop!
161 * it seems like ugly code. and yes - it is ugly code. but the best way. 161 * it seems like ugly code. and yes - it is ugly code. but the best way.
162 */ 162 */
163 QString temp; 163 QString temp;
164 mask = "INBOX" ; 164 mask = "INBOX" ;
165 result = clist_new(); 165 result = clist_new();
166 mailimap_mailbox_list *list; 166 mailimap_mailbox_list *list;
167 err = mailimap_list( m_imap, (char*)"", (char*)mask, &result ); 167 err = mailimap_list( m_imap, (char*)"", (char*)mask, &result );
168 if ( err == MAILIMAP_NO_ERROR ) { 168 if ( err == MAILIMAP_NO_ERROR ) {
169 current = result->first; 169 current = result->first;
170 for ( int i = result->count; i > 0; i-- ) { 170 for ( int i = result->count; i > 0; i-- ) {
171 list = (mailimap_mailbox_list *) current->data; 171 list = (mailimap_mailbox_list *) current->data;
172 // it is better use the deep copy mechanism of qt itself 172 // it is better use the deep copy mechanism of qt itself
173 // instead of using strdup! 173 // instead of using strdup!
174 temp = list->mb_name; 174 temp = list->mb_name;
175 folders->append( new IMAPFolder(temp)); 175 folders->append( new IMAPFolder(temp));
176 current = current->next; 176 current = current->next;
177 } 177 }
178 } else { 178 } else {
179 qDebug("error fetching folders: %s",m_imap->imap_response); 179 qDebug("error fetching folders: %s",m_imap->imap_response);
180 } 180 }
181 mailimap_list_result_free( result ); 181 mailimap_list_result_free( result );
182 182
183/* 183/*
184 * second stage - get the other then inbox folders 184 * second stage - get the other then inbox folders
185 */ 185 */
186 mask = "*" ; 186 mask = "*" ;
187 path = account->getPrefix().latin1(); 187 path = account->getPrefix().latin1();
188 if (!path) path = ""; 188 if (!path) path = "";
189 result = clist_new(); 189 result = clist_new();
190 qDebug(path); 190 qDebug(path);
191 bool selectable = true;
192 mailimap_mbx_list_flags*bflags;
191 err = mailimap_list( m_imap, (char*)path, (char*)mask, &result ); 193 err = mailimap_list( m_imap, (char*)path, (char*)mask, &result );
192 if ( err == MAILIMAP_NO_ERROR ) { 194 if ( err == MAILIMAP_NO_ERROR ) {
193 current = result->first; 195 current = result->first;
194 for ( int i = result->count; i > 0; i-- ) { 196 for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) {
195 list = (mailimap_mailbox_list *) current->data; 197 list = (mailimap_mailbox_list *) current->data;
196 // it is better use the deep copy mechanism of qt itself 198 // it is better use the deep copy mechanism of qt itself
197 // instead of using strdup! 199 // instead of using strdup!
198 temp = list->mb_name; 200 temp = list->mb_name;
199 current = current->next;
200 if (temp.lower()=="inbox") 201 if (temp.lower()=="inbox")
201 continue; 202 continue;
202 folders->append(new IMAPFolder(temp)); 203 if ( (bflags = list->mb_flag) ) {
203 204 selectable = !(bflags->mbf_type==MAILIMAP_MBX_LIST_FLAGS_SFLAG&&
205 bflags->mbf_sflag==MAILIMAP_MBX_LIST_SFLAG_NOSELECT);
206 }
207 folders->append(new IMAPFolder(temp,selectable));
204 } 208 }
205 } else { 209 } else {
206 qDebug("error fetching folders %s",m_imap->imap_response); 210 qDebug("error fetching folders %s",m_imap->imap_response);
207 } 211 }
208 mailimap_list_result_free( result ); 212 mailimap_list_result_free( result );
209 return folders; 213 return folders;
210} 214}
211 215
212RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) 216RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
213{ 217{
214 RecMail * m = 0; 218 RecMail * m = 0;
215 mailimap_msg_att_item *item=0; 219 mailimap_msg_att_item *item=0;
216 clistcell *current,*c,*cf; 220 clistcell *current,*c,*cf;
217 mailimap_msg_att_dynamic*flist; 221 mailimap_msg_att_dynamic*flist;
218 mailimap_flag_fetch*cflag; 222 mailimap_flag_fetch*cflag;
219 int size; 223 int size;
220 QBitArray mFlags(7); 224 QBitArray mFlags(7);
221 QStringList addresslist; 225 QStringList addresslist;
222 226
223 if (!m_att) { 227 if (!m_att) {
224 return m; 228 return m;
225 } 229 }
226 m = new RecMail(); 230 m = new RecMail();
227 for (c = clist_begin(m_att->att_list); c!=NULL;c=clist_next(c) ) { 231 for (c = clist_begin(m_att->att_list); c!=NULL;c=clist_next(c) ) {
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
@@ -252,38 +252,38 @@ void POP3wrapper::login()
252 // TODO: decide if apop or plain login should be used 252 // TODO: decide if apop or plain login should be used
253 err = mailpop3_login( m_pop3, (char *) user, (char *) pass ); 253 err = mailpop3_login( m_pop3, (char *) user, (char *) pass );
254 if ( err != MAILPOP3_NO_ERROR ) { 254 if ( err != MAILPOP3_NO_ERROR ) {
255 qDebug( "pop3: error logging in: %s", m_pop3->pop3_response ); 255 qDebug( "pop3: error logging in: %s", m_pop3->pop3_response );
256 logout(); 256 logout();
257 return; 257 return;
258 } 258 }
259 259
260 qDebug( "POP3: logged in!" ); 260 qDebug( "POP3: logged in!" );
261} 261}
262 262
263void POP3wrapper::logout() 263void POP3wrapper::logout()
264{ 264{
265 int err = MAILPOP3_NO_ERROR; 265 int err = MAILPOP3_NO_ERROR;
266 if ( m_pop3 == NULL ) return; 266 if ( m_pop3 == NULL ) return;
267 err = mailpop3_quit( m_pop3 ); 267 err = mailpop3_quit( m_pop3 );
268 mailpop3_free( m_pop3 ); 268 mailpop3_free( m_pop3 );
269 m_pop3 = NULL; 269 m_pop3 = NULL;
270} 270}
271 271
272 272
273QList<Folder>* POP3wrapper::listFolders() 273QList<Folder>* POP3wrapper::listFolders()
274{ 274{
275 QList<Folder> * folders = new QList<Folder>(); 275 QList<Folder> * folders = new QList<Folder>();
276 folders->setAutoDelete( true ); 276 folders->setAutoDelete( false );
277 Folder*inb=new Folder("INBOX"); 277 Folder*inb=new Folder("INBOX");
278 folders->append(inb); 278 folders->append(inb);
279 return folders; 279 return folders;
280} 280}
281 281
282QString POP3wrapper::fetchPart(const RecMail&,const RecPart&) 282QString POP3wrapper::fetchPart(const RecMail&,const RecPart&)
283{ 283{
284 return ""; 284 return "";
285} 285}
286 286
287void POP3wrapper::deleteMail(const RecMail&) 287void POP3wrapper::deleteMail(const RecMail&)
288{ 288{
289} 289}
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
@@ -62,49 +62,49 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
62 searchMails->addTo( toolBar ); 62 searchMails->addTo( toolBar );
63 searchMails->addTo( mailMenu ); 63 searchMails->addTo( mailMenu );
64 64
65 deleteMails = new QAction(tr("Delete Mail"), QIconSet(Resource::loadPixmap("mail/delete")), 0, 0, this); 65 deleteMails = new QAction(tr("Delete Mail"), QIconSet(Resource::loadPixmap("mail/delete")), 0, 0, this);
66 deleteMails->addTo( toolBar ); 66 deleteMails->addTo( toolBar );
67 deleteMails->addTo( mailMenu ); 67 deleteMails->addTo( mailMenu );
68 connect( deleteMails, SIGNAL( activated() ), 68 connect( deleteMails, SIGNAL( activated() ),
69 SLOT( slotDeleteMail() ) ); 69 SLOT( slotDeleteMail() ) );
70 70
71 editSettings = new QAction( tr( "Edit settings" ), ICON_EDITSETTINGS, 71 editSettings = new QAction( tr( "Edit settings" ), ICON_EDITSETTINGS,
72 0, 0, this ); 72 0, 0, this );
73 editSettings->addTo( settingsMenu ); 73 editSettings->addTo( settingsMenu );
74 74
75 editAccounts = new QAction( tr( "Configure accounts" ), ICON_EDITACCOUNTS, 75 editAccounts = new QAction( tr( "Configure accounts" ), ICON_EDITACCOUNTS,
76 0, 0, this ); 76 0, 0, this );
77 editAccounts->addTo( settingsMenu ); 77 editAccounts->addTo( settingsMenu );
78 78
79 QWidget *view = new QWidget( this ); 79 QWidget *view = new QWidget( this );
80 setCentralWidget( view ); 80 setCentralWidget( view );
81 81
82 layout = new QBoxLayout ( view, QBoxLayout::LeftToRight ); 82 layout = new QBoxLayout ( view, QBoxLayout::LeftToRight );
83 83
84 folderView = new AccountView( view ); 84 folderView = new AccountView( view );
85 folderView->header()->hide(); 85 folderView->header()->hide();
86 folderView->setRootIsDecorated( false ); 86 folderView->setRootIsDecorated( true );
87 folderView->addColumn( tr( "Mailbox" ) ); 87 folderView->addColumn( tr( "Mailbox" ) );
88 //folderView->hide(); 88 //folderView->hide();
89 89
90 layout->addWidget( folderView ); 90 layout->addWidget( folderView );
91 91
92 mailView = new QListView( view ); 92 mailView = new QListView( view );
93 mailView->addColumn( tr( "" ) ); 93 mailView->addColumn( tr( "" ) );
94 mailView->addColumn( tr( "Subject" ),QListView::Manual ); 94 mailView->addColumn( tr( "Subject" ),QListView::Manual );
95 mailView->addColumn( tr( "Sender" ),QListView::Manual ); 95 mailView->addColumn( tr( "Sender" ),QListView::Manual );
96 mailView->addColumn( tr( "Date" )); 96 mailView->addColumn( tr( "Date" ));
97 mailView->setAllColumnsShowFocus(true); 97 mailView->setAllColumnsShowFocus(true);
98 mailView->setSorting(-1); 98 mailView->setSorting(-1);
99 99
100 layout->addWidget( mailView ); 100 layout->addWidget( mailView );
101 layout->setStretchFactor( folderView, 1 ); 101 layout->setStretchFactor( folderView, 1 );
102 layout->setStretchFactor( mailView, 2 ); 102 layout->setStretchFactor( mailView, 2 );
103 103
104 slotAdjustLayout(); 104 slotAdjustLayout();
105 105
106 connect( mailView, SIGNAL( clicked( QListViewItem * ) ),this, 106 connect( mailView, SIGNAL( clicked( QListViewItem * ) ),this,
107 SLOT( displayMail( QListViewItem * ) ) ); 107 SLOT( displayMail( QListViewItem * ) ) );
108 108
109 connect(folderView, SIGNAL(refreshMailview(QList<RecMail>*)),this,SLOT(refreshMailView(QList<RecMail>*))); 109 connect(folderView, SIGNAL(refreshMailview(QList<RecMail>*)),this,SLOT(refreshMailView(QList<RecMail>*)));
110 110
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
@@ -252,38 +252,38 @@ void POP3wrapper::login()
252 // TODO: decide if apop or plain login should be used 252 // TODO: decide if apop or plain login should be used
253 err = mailpop3_login( m_pop3, (char *) user, (char *) pass ); 253 err = mailpop3_login( m_pop3, (char *) user, (char *) pass );
254 if ( err != MAILPOP3_NO_ERROR ) { 254 if ( err != MAILPOP3_NO_ERROR ) {
255 qDebug( "pop3: error logging in: %s", m_pop3->pop3_response ); 255 qDebug( "pop3: error logging in: %s", m_pop3->pop3_response );
256 logout(); 256 logout();
257 return; 257 return;
258 } 258 }
259 259
260 qDebug( "POP3: logged in!" ); 260 qDebug( "POP3: logged in!" );
261} 261}
262 262
263void POP3wrapper::logout() 263void POP3wrapper::logout()
264{ 264{
265 int err = MAILPOP3_NO_ERROR; 265 int err = MAILPOP3_NO_ERROR;
266 if ( m_pop3 == NULL ) return; 266 if ( m_pop3 == NULL ) return;
267 err = mailpop3_quit( m_pop3 ); 267 err = mailpop3_quit( m_pop3 );
268 mailpop3_free( m_pop3 ); 268 mailpop3_free( m_pop3 );
269 m_pop3 = NULL; 269 m_pop3 = NULL;
270} 270}
271 271
272 272
273QList<Folder>* POP3wrapper::listFolders() 273QList<Folder>* POP3wrapper::listFolders()
274{ 274{
275 QList<Folder> * folders = new QList<Folder>(); 275 QList<Folder> * folders = new QList<Folder>();
276 folders->setAutoDelete( true ); 276 folders->setAutoDelete( false );
277 Folder*inb=new Folder("INBOX"); 277 Folder*inb=new Folder("INBOX");
278 folders->append(inb); 278 folders->append(inb);
279 return folders; 279 return folders;
280} 280}
281 281
282QString POP3wrapper::fetchPart(const RecMail&,const RecPart&) 282QString POP3wrapper::fetchPart(const RecMail&,const RecPart&)
283{ 283{
284 return ""; 284 return "";
285} 285}
286 286
287void POP3wrapper::deleteMail(const RecMail&) 287void POP3wrapper::deleteMail(const RecMail&)
288{ 288{
289} 289}
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,26 +1,26 @@
1#include <qtextbrowser.h> 1#include <qtextbrowser.h>
2#include <qmessagebox.h>? 2#include <qmessagebox.h>
3#include <qtextstream.h> 3#include <qtextstream.h>
4#include <qaction.h> 4#include <qaction.h>
5#include <qpopupmenu.h> 5#include <qpopupmenu.h>
6#include <qapplication.h> 6#include <qapplication.h>
7 7
8#include <opie/ofiledialog.h> 8#include <opie/ofiledialog.h>
9 9
10#include "settings.h" 10#include "settings.h"
11#include "composemail.h" 11#include "composemail.h"
12#include "viewmail.h" 12#include "viewmail.h"
13#include "abstractmail.h" 13#include "abstractmail.h"
14#include "accountview.h" 14#include "accountview.h"
15 15
16AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&file,const QString&desc,int num) 16AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&file,const QString&desc,int num)
17 : QListViewItem(parent,after),_partNum(num) 17 : QListViewItem(parent,after),_partNum(num)
18{ 18{
19 setText(0, mime); 19 setText(0, mime);
20 setText(1, file); 20 setText(1, file);
21 setText(2, desc); 21 setText(2, desc);
22} 22}
23 23
24void ViewMail::setBody( RecBody body ) { 24void ViewMail::setBody( RecBody body ) {
25 25
26m_body = body; 26m_body = body;