summaryrefslogtreecommitdiff
path: root/noncore/net/mail
authoralwin <alwin>2004-03-02 12:21:11 (UTC)
committer alwin <alwin>2004-03-02 12:21:11 (UTC)
commitb6b1c97559c0ed9f2e33632272426bf98f289232 (patch) (unidiff)
treed3a9987704770cdf5eb14e1136f6e3ecb2f36a04 /noncore/net/mail
parent0d59c780513da78033f4d9040475dee9db0256d4 (diff)
downloadopie-b6b1c97559c0ed9f2e33632272426bf98f289232.zip
opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.gz
opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.bz2
applied the patch generated by the optimize_connect script from
TT.
Diffstat (limited to 'noncore/net/mail') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/accountview.cpp8
-rw-r--r--noncore/net/mail/composemail.cpp2
-rw-r--r--noncore/net/mail/editaccounts.cpp18
-rw-r--r--noncore/net/mail/libmailwrapper/mhwrapper.cpp8
-rw-r--r--noncore/net/mail/libmailwrapper/smtpwrapper.cpp2
-rw-r--r--noncore/net/mail/mainwindow.cpp16
-rw-r--r--noncore/net/mail/viewmail.cpp6
7 files changed, 30 insertions, 30 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp
index c2185f2..64557ee 100644
--- a/noncore/net/mail/accountview.cpp
+++ b/noncore/net/mail/accountview.cpp
@@ -1,47 +1,47 @@
1 1
2#include "accountview.h" 2#include "accountview.h"
3#include "accountitem.h" 3#include "accountitem.h"
4#include "selectstore.h" 4#include "selectstore.h"
5 5
6/* OPIE */ 6/* OPIE */
7#include <libmailwrapper/settings.h> 7#include <libmailwrapper/settings.h>
8#include <libmailwrapper/mailwrapper.h> 8#include <libmailwrapper/mailwrapper.h>
9#include <libmailwrapper/mailtypes.h> 9#include <libmailwrapper/mailtypes.h>
10#include <libmailwrapper/abstractmail.h> 10#include <libmailwrapper/abstractmail.h>
11#include <qpe/qpeapplication.h> 11#include <qpe/qpeapplication.h>
12 12
13/* QT */ 13/* QT */
14#include <qmessagebox.h> 14#include <qmessagebox.h>
15#include <qpopupmenu.h> 15#include <qpopupmenu.h>
16 16
17AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) 17AccountView::AccountView( QWidget *parent, const char *name, WFlags flags )
18 : QListView( parent, name, flags ) 18 : QListView( parent, name, flags )
19{ 19{
20 connect( this, SIGNAL( selectionChanged( QListViewItem * ) ), 20 connect( this, SIGNAL( selectionChanged(QListViewItem*) ),
21 SLOT( refresh( QListViewItem * ) ) ); 21 SLOT( refresh(QListViewItem*) ) );
22 connect( this, SIGNAL( mouseButtonPressed(int, QListViewItem *,const QPoint&,int ) ),this, 22 connect( this, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this,
23 SLOT( slotHold( int, QListViewItem *,const QPoint&,int ) ) ); 23 SLOT( slotHold(int,QListViewItem*,const QPoint&,int) ) );
24 setSorting(0); 24 setSorting(0);
25} 25}
26 26
27AccountView::~AccountView() 27AccountView::~AccountView()
28{ 28{
29 imapAccounts.clear(); 29 imapAccounts.clear();
30 mhAccounts.clear(); 30 mhAccounts.clear();
31} 31}
32 32
33void AccountView::slotContextMenu(int id) 33void AccountView::slotContextMenu(int id)
34{ 34{
35 AccountViewItem *view = static_cast<AccountViewItem *>(currentItem()); 35 AccountViewItem *view = static_cast<AccountViewItem *>(currentItem());
36 if (!view) return; 36 if (!view) return;
37 view->contextMenuSelected(id); 37 view->contextMenuSelected(id);
38} 38}
39 39
40void AccountView::slotHold(int button, QListViewItem * item,const QPoint&,int) 40void AccountView::slotHold(int button, QListViewItem * item,const QPoint&,int)
41{ 41{
42 if (button==1) {return;} 42 if (button==1) {return;}
43 if (!item) return; 43 if (!item) return;
44 AccountViewItem *view = static_cast<AccountViewItem *>(item); 44 AccountViewItem *view = static_cast<AccountViewItem *>(item);
45 QPopupMenu*m = view->getContextMenu(); 45 QPopupMenu*m = view->getContextMenu();
46 if (!m) return; 46 if (!m) return;
47 connect(m,SIGNAL(activated(int)),this,SLOT(slotContextMenu(int))); 47 connect(m,SIGNAL(activated(int)),this,SLOT(slotContextMenu(int)));
diff --git a/noncore/net/mail/composemail.cpp b/noncore/net/mail/composemail.cpp
index 6708779..f51a8fe 100644
--- a/noncore/net/mail/composemail.cpp
+++ b/noncore/net/mail/composemail.cpp
@@ -41,49 +41,49 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m
41 41
42 attList->addColumn( tr( "Name" ) ); 42 attList->addColumn( tr( "Name" ) );
43 attList->addColumn( tr( "Size" ) ); 43 attList->addColumn( tr( "Size" ) );
44 44
45 QList<Account> accounts = settings->getAccounts(); 45 QList<Account> accounts = settings->getAccounts();
46 46
47 Account *it; 47 Account *it;
48 for ( it = accounts.first(); it; it = accounts.next() ) { 48 for ( it = accounts.first(); it; it = accounts.next() ) {
49 if ( it->getType().compare( "SMTP" ) == 0 ) { 49 if ( it->getType().compare( "SMTP" ) == 0 ) {
50 SMTPaccount *smtp = static_cast<SMTPaccount *>(it); 50 SMTPaccount *smtp = static_cast<SMTPaccount *>(it);
51 smtpAccountBox->insertItem( smtp->getAccountName() ); 51 smtpAccountBox->insertItem( smtp->getAccountName() );
52 smtpAccounts.append( smtp ); 52 smtpAccounts.append( smtp );
53 } 53 }
54 } 54 }
55 55
56 if ( smtpAccounts.count() > 0 ) { 56 if ( smtpAccounts.count() > 0 ) {
57 fillValues( smtpAccountBox->currentItem() ); 57 fillValues( smtpAccountBox->currentItem() );
58 } else { 58 } else {
59 QMessageBox::information( this, tr( "Problem" ), 59 QMessageBox::information( this, tr( "Problem" ),
60 tr( "<p>Please create an SMTP account first.</p>" ), 60 tr( "<p>Please create an SMTP account first.</p>" ),
61 tr( "Ok" ) ); 61 tr( "Ok" ) );
62 return; 62 return;
63 } 63 }
64 64
65 connect( smtpAccountBox, SIGNAL( activated( int ) ), SLOT( fillValues( int ) ) ); 65 connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) );
66 connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); 66 connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) );
67 connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) ); 67 connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) );
68 connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) ); 68 connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) );
69 connect( replyButton, SIGNAL( clicked() ), SLOT( pickAddressReply() ) ); 69 connect( replyButton, SIGNAL( clicked() ), SLOT( pickAddressReply() ) );
70 connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) ); 70 connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) );
71 connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) ); 71 connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) );
72} 72}
73 73
74void ComposeMail::pickAddress( QLineEdit *line ) 74void ComposeMail::pickAddress( QLineEdit *line )
75{ 75{
76 QString names = AddressPicker::getNames(); 76 QString names = AddressPicker::getNames();
77 if ( line->text().isEmpty() ) { 77 if ( line->text().isEmpty() ) {
78 line->setText( names ); 78 line->setText( names );
79 } else if ( !names.isEmpty() ) { 79 } else if ( !names.isEmpty() ) {
80 line->setText( line->text() + ", " + names ); 80 line->setText( line->text() + ", " + names );
81 } 81 }
82} 82}
83 83
84 84
85void ComposeMail::setTo( const QString & to ) 85void ComposeMail::setTo( const QString & to )
86{ 86{
87/* QString toline; 87/* QString toline;
88 QStringList toEntry = to; 88 QStringList toEntry = to;
89 for ( QStringList::Iterator it = toEntry.begin(); it != toEntry.end(); ++it ) { 89 for ( QStringList::Iterator it = toEntry.begin(); it != toEntry.end(); ++it ) {
diff --git a/noncore/net/mail/editaccounts.cpp b/noncore/net/mail/editaccounts.cpp
index 60bffa5..edeb1de 100644
--- a/noncore/net/mail/editaccounts.cpp
+++ b/noncore/net/mail/editaccounts.cpp
@@ -263,68 +263,68 @@ void EditAccounts::slotAdjustColumns()
263 mailList->setColumnWidth( 1, 50 ); 263 mailList->setColumnWidth( 1, 50 );
264 264
265 configTab->showPage( newsTab ); 265 configTab->showPage( newsTab );
266 newsList->setColumnWidth( 0, newsList->visibleWidth() ); 266 newsList->setColumnWidth( 0, newsList->visibleWidth() );
267 267
268 configTab->setCurrentPage( currPage ); 268 configTab->setCurrentPage( currPage );
269} 269}
270 270
271void EditAccounts::accept() 271void EditAccounts::accept()
272{ 272{
273 settings->saveAccounts(); 273 settings->saveAccounts();
274 274
275 QDialog::accept(); 275 QDialog::accept();
276} 276}
277 277
278/** 278/**
279 * SelectMailType 279 * SelectMailType
280 */ 280 */
281 281
282SelectMailType::SelectMailType( QString *selection, QWidget *parent, const char *name, bool modal, WFlags flags ) 282SelectMailType::SelectMailType( QString *selection, QWidget *parent, const char *name, bool modal, WFlags flags )
283 : SelectMailTypeUI( parent, name, modal, flags ) 283 : SelectMailTypeUI( parent, name, modal, flags )
284{ 284{
285 selected = selection; 285 selected = selection;
286 selected->replace( 0, selected->length(), typeBox->currentText() ); 286 selected->replace( 0, selected->length(), typeBox->currentText() );
287 connect( typeBox, SIGNAL( activated( const QString & ) ), SLOT( slotSelection( const QString & ) ) ); 287 connect( typeBox, SIGNAL( activated(const QString&) ), SLOT( slotSelection(const QString&) ) );
288} 288}
289 289
290void SelectMailType::slotSelection( const QString &sel ) 290void SelectMailType::slotSelection( const QString &sel )
291{ 291{
292 selected->replace( 0, selected->length(), sel ); 292 selected->replace( 0, selected->length(), sel );
293} 293}
294 294
295/** 295/**
296 * IMAPconfig 296 * IMAPconfig
297 */ 297 */
298 298
299IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) 299IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags )
300 : IMAPconfigUI( parent, name, modal, flags ) 300 : IMAPconfigUI( parent, name, modal, flags )
301{ 301{
302 data = account; 302 data = account;
303 303
304 fillValues(); 304 fillValues();
305 305
306 connect( ComboBox1, SIGNAL( activated( int ) ), SLOT( slotConnectionToggle( int ) ) ); 306 connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) );
307 ComboBox1->insertItem( "Only if available", 0 ); 307 ComboBox1->insertItem( "Only if available", 0 );
308 ComboBox1->insertItem( "Always, Negotiated", 1 ); 308 ComboBox1->insertItem( "Always, Negotiated", 1 );
309 ComboBox1->insertItem( "Connect on secure port", 2 ); 309 ComboBox1->insertItem( "Connect on secure port", 2 );
310 ComboBox1->insertItem( "Run command instead", 3 ); 310 ComboBox1->insertItem( "Run command instead", 3 );
311 CommandEdit->hide(); 311 CommandEdit->hide();
312 ComboBox1->setCurrentItem( data->ConnectionType() ); 312 ComboBox1->setCurrentItem( data->ConnectionType() );
313} 313}
314 314
315void IMAPconfig::slotConnectionToggle( int index ) 315void IMAPconfig::slotConnectionToggle( int index )
316{ 316{
317 if ( index == 2 ) 317 if ( index == 2 )
318 { 318 {
319 portLine->setText( IMAP_SSL_PORT ); 319 portLine->setText( IMAP_SSL_PORT );
320 } 320 }
321 else if ( index == 3 ) 321 else if ( index == 3 )
322 { 322 {
323 portLine->setText( IMAP_PORT ); 323 portLine->setText( IMAP_PORT );
324 CommandEdit->show(); 324 CommandEdit->show();
325 } 325 }
326 else 326 else
327 { 327 {
328 portLine->setText( IMAP_PORT ); 328 portLine->setText( IMAP_PORT );
329 } 329 }
330} 330}
@@ -342,49 +342,49 @@ void IMAPconfig::fillValues()
342 342
343void IMAPconfig::accept() 343void IMAPconfig::accept()
344{ 344{
345 data->setAccountName( accountLine->text() ); 345 data->setAccountName( accountLine->text() );
346 data->setServer( serverLine->text() ); 346 data->setServer( serverLine->text() );
347 data->setPort( portLine->text() ); 347 data->setPort( portLine->text() );
348 data->setConnectionType( ComboBox1->currentItem() ); 348 data->setConnectionType( ComboBox1->currentItem() );
349 data->setUser( userLine->text() ); 349 data->setUser( userLine->text() );
350 data->setPassword( passLine->text() ); 350 data->setPassword( passLine->text() );
351 data->setPrefix(prefixLine->text()); 351 data->setPrefix(prefixLine->text());
352 352
353 QDialog::accept(); 353 QDialog::accept();
354} 354}
355 355
356/** 356/**
357 * POP3config 357 * POP3config
358 */ 358 */
359 359
360POP3config::POP3config( POP3account *account, QWidget *parent, const char *name, bool modal, WFlags flags ) 360POP3config::POP3config( POP3account *account, QWidget *parent, const char *name, bool modal, WFlags flags )
361 : POP3configUI( parent, name, modal, flags ) 361 : POP3configUI( parent, name, modal, flags )
362{ 362{
363 data = account; 363 data = account;
364 fillValues(); 364 fillValues();
365 365
366 connect( ComboBox1, SIGNAL( activated( int ) ), SLOT( slotConnectionToggle( int ) ) ); 366 connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) );
367 ComboBox1->insertItem( "Only if available", 0 ); 367 ComboBox1->insertItem( "Only if available", 0 );
368 ComboBox1->insertItem( "Always, Negotiated", 1 ); 368 ComboBox1->insertItem( "Always, Negotiated", 1 );
369 ComboBox1->insertItem( "Connect on secure port", 2 ); 369 ComboBox1->insertItem( "Connect on secure port", 2 );
370 ComboBox1->insertItem( "Run command instead", 3 ); 370 ComboBox1->insertItem( "Run command instead", 3 );
371 CommandEdit->hide(); 371 CommandEdit->hide();
372 ComboBox1->setCurrentItem( data->ConnectionType() ); 372 ComboBox1->setCurrentItem( data->ConnectionType() );
373} 373}
374 374
375void POP3config::slotConnectionToggle( int index ) 375void POP3config::slotConnectionToggle( int index )
376{ 376{
377 // 2 is ssl connection 377 // 2 is ssl connection
378 if ( index == 2 ) 378 if ( index == 2 )
379 { 379 {
380 portLine->setText( POP3_SSL_PORT ); 380 portLine->setText( POP3_SSL_PORT );
381 } 381 }
382 else if ( index == 3 ) 382 else if ( index == 3 )
383 { 383 {
384 portLine->setText( POP3_PORT ); 384 portLine->setText( POP3_PORT );
385 CommandEdit->show(); 385 CommandEdit->show();
386 } 386 }
387 else 387 else
388 { 388 {
389 portLine->setText( POP3_PORT ); 389 portLine->setText( POP3_PORT );
390 } 390 }
@@ -400,54 +400,54 @@ void POP3config::fillValues()
400 passLine->setText( data->getPassword() ); 400 passLine->setText( data->getPassword() );
401} 401}
402 402
403void POP3config::accept() 403void POP3config::accept()
404{ 404{
405 data->setAccountName( accountLine->text() ); 405 data->setAccountName( accountLine->text() );
406 data->setServer( serverLine->text() ); 406 data->setServer( serverLine->text() );
407 data->setPort( portLine->text() ); 407 data->setPort( portLine->text() );
408 data->setConnectionType( ComboBox1->currentItem() ); 408 data->setConnectionType( ComboBox1->currentItem() );
409 data->setUser( userLine->text() ); 409 data->setUser( userLine->text() );
410 data->setPassword( passLine->text() ); 410 data->setPassword( passLine->text() );
411 411
412 QDialog::accept(); 412 QDialog::accept();
413} 413}
414 414
415/** 415/**
416 * SMTPconfig 416 * SMTPconfig
417 */ 417 */
418 418
419SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) 419SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags )
420 : SMTPconfigUI( parent, name, modal, flags ) 420 : SMTPconfigUI( parent, name, modal, flags )
421{ 421{
422 data = account; 422 data = account;
423 423
424 connect( loginBox, SIGNAL( toggled( bool ) ), userLine, SLOT( setEnabled( bool ) ) ); 424 connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) );
425 connect( loginBox, SIGNAL( toggled( bool ) ), passLine, SLOT( setEnabled( bool ) ) ); 425 connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) );
426 426
427 fillValues(); 427 fillValues();
428 428
429 connect( ComboBox1, SIGNAL( activated( int ) ), SLOT( slotConnectionToggle( int ) ) ); 429 connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) );
430 ComboBox1->insertItem( "Only if available", 0 ); 430 ComboBox1->insertItem( "Only if available", 0 );
431 ComboBox1->insertItem( "Always, Negotiated", 1 ); 431 ComboBox1->insertItem( "Always, Negotiated", 1 );
432 ComboBox1->insertItem( "Connect on secure port", 2 ); 432 ComboBox1->insertItem( "Connect on secure port", 2 );
433 ComboBox1->insertItem( "Run command instead", 3 ); 433 ComboBox1->insertItem( "Run command instead", 3 );
434 CommandEdit->hide(); 434 CommandEdit->hide();
435 ComboBox1->setCurrentItem( data->ConnectionType() ); 435 ComboBox1->setCurrentItem( data->ConnectionType() );
436} 436}
437 437
438void SMTPconfig::slotConnectionToggle( int index ) 438void SMTPconfig::slotConnectionToggle( int index )
439{ 439{
440 // 2 is ssl connection 440 // 2 is ssl connection
441 if ( index == 2 ) 441 if ( index == 2 )
442 { 442 {
443 portLine->setText( SMTP_SSL_PORT ); 443 portLine->setText( SMTP_SSL_PORT );
444 } 444 }
445 else if ( index == 3 ) 445 else if ( index == 3 )
446 { 446 {
447 portLine->setText( SMTP_PORT ); 447 portLine->setText( SMTP_PORT );
448 CommandEdit->show(); 448 CommandEdit->show();
449 } 449 }
450 else 450 else
451 { 451 {
452 portLine->setText( SMTP_PORT ); 452 portLine->setText( SMTP_PORT );
453 } 453 }
@@ -465,54 +465,54 @@ void SMTPconfig::fillValues()
465} 465}
466 466
467void SMTPconfig::accept() 467void SMTPconfig::accept()
468{ 468{
469 data->setAccountName( accountLine->text() ); 469 data->setAccountName( accountLine->text() );
470 data->setServer( serverLine->text() ); 470 data->setServer( serverLine->text() );
471 data->setPort( portLine->text() ); 471 data->setPort( portLine->text() );
472 data->setConnectionType( ComboBox1->currentItem() ); 472 data->setConnectionType( ComboBox1->currentItem() );
473 data->setLogin( loginBox->isChecked() ); 473 data->setLogin( loginBox->isChecked() );
474 data->setUser( userLine->text() ); 474 data->setUser( userLine->text() );
475 data->setPassword( passLine->text() ); 475 data->setPassword( passLine->text() );
476 476
477 QDialog::accept(); 477 QDialog::accept();
478} 478}
479 479
480/** 480/**
481 * NNTPconfig 481 * NNTPconfig
482 */ 482 */
483 483
484NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) 484NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags )
485 : NNTPconfigUI( parent, name, modal, flags ) 485 : NNTPconfigUI( parent, name, modal, flags )
486{ 486{
487 data = account; 487 data = account;
488 488
489 connect( loginBox, SIGNAL( toggled( bool ) ), userLine, SLOT( setEnabled( bool ) ) ); 489 connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) );
490 connect( loginBox, SIGNAL( toggled( bool ) ), passLine, SLOT( setEnabled( bool ) ) ); 490 connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) );
491 491
492 fillValues(); 492 fillValues();
493 493
494 connect( sslBox, SIGNAL( toggled( bool ) ), SLOT( slotSSL( bool ) ) ); 494 connect( sslBox, SIGNAL( toggled(bool) ), SLOT( slotSSL(bool) ) );
495} 495}
496 496
497void NNTPconfig::slotSSL( bool enabled ) 497void NNTPconfig::slotSSL( bool enabled )
498{ 498{
499 if ( enabled ) 499 if ( enabled )
500 { 500 {
501 portLine->setText( NNTP_SSL_PORT ); 501 portLine->setText( NNTP_SSL_PORT );
502 } 502 }
503 else 503 else
504 { 504 {
505 portLine->setText( NNTP_PORT ); 505 portLine->setText( NNTP_PORT );
506 } 506 }
507} 507}
508 508
509void NNTPconfig::fillValues() 509void NNTPconfig::fillValues()
510{ 510{
511 accountLine->setText( data->getAccountName() ); 511 accountLine->setText( data->getAccountName() );
512 serverLine->setText( data->getServer() ); 512 serverLine->setText( data->getServer() );
513 portLine->setText( data->getPort() ); 513 portLine->setText( data->getPort() );
514 sslBox->setChecked( data->getSSL() ); 514 sslBox->setChecked( data->getSSL() );
515 loginBox->setChecked( data->getLogin() ); 515 loginBox->setChecked( data->getLogin() );
516 userLine->setText( data->getUser() ); 516 userLine->setText( data->getUser() );
517 passLine->setText( data->getPassword() ); 517 passLine->setText( data->getPassword() );
518} 518}
diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.cpp b/noncore/net/mail/libmailwrapper/mhwrapper.cpp
index dfc00d8..df7f773 100644
--- a/noncore/net/mail/libmailwrapper/mhwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/mhwrapper.cpp
@@ -301,52 +301,52 @@ int MHwrapper::deleteAllMail(const Folder*tfolder)
301} 301}
302 302
303int MHwrapper::deleteMbox(const Folder*tfolder) 303int MHwrapper::deleteMbox(const Folder*tfolder)
304{ 304{
305 init_storage(); 305 init_storage();
306 if (!m_storage) { 306 if (!m_storage) {
307 return 0; 307 return 0;
308 } 308 }
309 if (!tfolder) return 0; 309 if (!tfolder) return 0;
310 if (tfolder->getName()=="/" || tfolder->getName().isEmpty()) return 0; 310 if (tfolder->getName()=="/" || tfolder->getName().isEmpty()) return 0;
311 311
312 int r = mailsession_delete_folder(m_storage->sto_session,(char*)tfolder->getName().latin1()); 312 int r = mailsession_delete_folder(m_storage->sto_session,(char*)tfolder->getName().latin1());
313 313
314 if (r != MAIL_NO_ERROR) { 314 if (r != MAIL_NO_ERROR) {
315 qDebug("error deleting mail box"); 315 qDebug("error deleting mail box");
316 return 0; 316 return 0;
317 } 317 }
318 QString cmd = "rm -rf "+tfolder->getName(); 318 QString cmd = "rm -rf "+tfolder->getName();
319 QStringList command; 319 QStringList command;
320 command << "/bin/sh"; 320 command << "/bin/sh";
321 command << "-c"; 321 command << "-c";
322 command << cmd.latin1(); 322 command << cmd.latin1();
323 OProcess *process = new OProcess(); 323 OProcess *process = new OProcess();
324 324
325 connect(process, SIGNAL(processExited(OProcess *)), 325 connect(process, SIGNAL(processExited(OProcess*)),
326 this, SLOT( processEnded(OProcess *))); 326 this, SLOT( processEnded(OProcess*)));
327 connect(process, SIGNAL( receivedStderr(OProcess *, char *, int)), 327 connect(process, SIGNAL( receivedStderr(OProcess*,char*,int)),
328 this, SLOT( oprocessStderr(OProcess *, char *, int))); 328 this, SLOT( oprocessStderr(OProcess*,char*,int)));
329 329
330 *process << command; 330 *process << command;
331 removeMboxfailed = false; 331 removeMboxfailed = false;
332 if(!process->start(OProcess::Block, OProcess::All) ) { 332 if(!process->start(OProcess::Block, OProcess::All) ) {
333 qDebug("could not start process"); 333 qDebug("could not start process");
334 return 0; 334 return 0;
335 } 335 }
336 qDebug("mail box deleted"); 336 qDebug("mail box deleted");
337 return 1; 337 return 1;
338} 338}
339 339
340void MHwrapper::processEnded(OProcess *p) 340void MHwrapper::processEnded(OProcess *p)
341{ 341{
342 if (p) delete p; 342 if (p) delete p;
343} 343}
344 344
345void MHwrapper::oprocessStderr(OProcess*, char *buffer, int ) 345void MHwrapper::oprocessStderr(OProcess*, char *buffer, int )
346{ 346{
347 QString lineStr = buffer; 347 QString lineStr = buffer;
348 QMessageBox::warning( 0, tr("Error"), lineStr ,tr("Ok") ); 348 QMessageBox::warning( 0, tr("Error"), lineStr ,tr("Ok") );
349 removeMboxfailed = true; 349 removeMboxfailed = true;
350} 350}
351 351
352void MHwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) 352void MHwrapper::statusFolder(folderStat&target_stat,const QString & mailbox)
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
index a3c68ae..d75d52a 100644
--- a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
@@ -11,49 +11,49 @@
11#include <qpe/config.h> 11#include <qpe/config.h>
12#include <qpe/qcopenvelope_qws.h> 12#include <qpe/qcopenvelope_qws.h>
13 13
14#include <libetpan/libetpan.h> 14#include <libetpan/libetpan.h>
15 15
16#include "smtpwrapper.h" 16#include "smtpwrapper.h"
17#include "mailwrapper.h" 17#include "mailwrapper.h"
18#include "abstractmail.h" 18#include "abstractmail.h"
19#include "logindialog.h" 19#include "logindialog.h"
20#include "mailtypes.h" 20#include "mailtypes.h"
21#include "sendmailprogress.h" 21#include "sendmailprogress.h"
22 22
23const char* SMTPwrapper::USER_AGENT="OpieMail v0.4"; 23const char* SMTPwrapper::USER_AGENT="OpieMail v0.4";
24 24
25progressMailSend*SMTPwrapper::sendProgress = 0; 25progressMailSend*SMTPwrapper::sendProgress = 0;
26 26
27SMTPwrapper::SMTPwrapper(SMTPaccount * aSmtp ) 27SMTPwrapper::SMTPwrapper(SMTPaccount * aSmtp )
28 : QObject() 28 : QObject()
29{ 29{
30 m_SmtpAccount = aSmtp; 30 m_SmtpAccount = aSmtp;
31 Config cfg( "mail" ); 31 Config cfg( "mail" );
32 cfg.setGroup( "Status" ); 32 cfg.setGroup( "Status" );
33 m_queuedMail = cfg.readNumEntry( "outgoing", 0 ); 33 m_queuedMail = cfg.readNumEntry( "outgoing", 0 );
34 emit queuedMails( m_queuedMail ); 34 emit queuedMails( m_queuedMail );
35 connect( this, SIGNAL( queuedMails( int ) ), this, SLOT( emitQCop( int ) ) ); 35 connect( this, SIGNAL( queuedMails(int) ), this, SLOT( emitQCop(int) ) );
36 m_smtp = 0; 36 m_smtp = 0;
37} 37}
38 38
39SMTPwrapper::~SMTPwrapper() 39SMTPwrapper::~SMTPwrapper()
40{ 40{
41 disc_server(); 41 disc_server();
42} 42}
43 43
44void SMTPwrapper::emitQCop( int queued ) { 44void SMTPwrapper::emitQCop( int queued ) {
45 QCopEnvelope env( "QPE/Pim", "outgoingMails(int)" ); 45 QCopEnvelope env( "QPE/Pim", "outgoingMails(int)" );
46 env << queued; 46 env << queued;
47} 47}
48 48
49QString SMTPwrapper::mailsmtpError( int errnum ) { 49QString SMTPwrapper::mailsmtpError( int errnum ) {
50 switch ( errnum ) { 50 switch ( errnum ) {
51 case MAILSMTP_NO_ERROR: 51 case MAILSMTP_NO_ERROR:
52 return tr( "No error" ); 52 return tr( "No error" );
53 case MAILSMTP_ERROR_UNEXPECTED_CODE: 53 case MAILSMTP_ERROR_UNEXPECTED_CODE:
54 return tr( "Unexpected error code" ); 54 return tr( "Unexpected error code" );
55 case MAILSMTP_ERROR_SERVICE_NOT_AVAILABLE: 55 case MAILSMTP_ERROR_SERVICE_NOT_AVAILABLE:
56 return tr( "Service not available" ); 56 return tr( "Service not available" );
57 case MAILSMTP_ERROR_STREAM: 57 case MAILSMTP_ERROR_STREAM:
58 return tr( "Stream error" ); 58 return tr( "Stream error" );
59 case MAILSMTP_ERROR_HOSTNAME: 59 case MAILSMTP_ERROR_HOSTNAME:
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp
index 2a1f90d..3f34fe7 100644
--- a/noncore/net/mail/mainwindow.cpp
+++ b/noncore/net/mail/mainwindow.cpp
@@ -34,50 +34,50 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
34 toolBar->setStretchableWidget( spacer ); 34 toolBar->setStretchableWidget( spacer );
35 35
36 composeMail = new QAction( tr( "Compose new mail" ), ICON_COMPOSEMAIL, 36 composeMail = new QAction( tr( "Compose new mail" ), ICON_COMPOSEMAIL,
37 0, 0, this ); 37 0, 0, this );
38 composeMail->addTo( toolBar ); 38 composeMail->addTo( toolBar );
39 composeMail->addTo( mailMenu ); 39 composeMail->addTo( mailMenu );
40 40
41 sendQueued = new QAction( tr( "Send queued mails" ), ICON_SENDQUEUED, 41 sendQueued = new QAction( tr( "Send queued mails" ), ICON_SENDQUEUED,
42 0, 0, this ); 42 0, 0, this );
43 sendQueued->addTo( toolBar ); 43 sendQueued->addTo( toolBar );
44 sendQueued->addTo( mailMenu ); 44 sendQueued->addTo( mailMenu );
45 45
46 /* 46 /*
47 syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC, 47 syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC,
48 0, 0, this ); 48 0, 0, this );
49 syncFolders->addTo( toolBar ); 49 syncFolders->addTo( toolBar );
50 syncFolders->addTo( mailMenu ); 50 syncFolders->addTo( mailMenu );
51 */ 51 */
52 52
53 showFolders = new QAction( tr( "Show/Hide folders" ), ICON_SHOWFOLDERS, 53 showFolders = new QAction( tr( "Show/Hide folders" ), ICON_SHOWFOLDERS,
54 0, 0, this, 0, true ); 54 0, 0, this, 0, true );
55 showFolders->addTo( toolBar ); 55 showFolders->addTo( toolBar );
56 showFolders->addTo( mailMenu ); 56 showFolders->addTo( mailMenu );
57 showFolders->setOn( true ); 57 showFolders->setOn( true );
58 connect(showFolders, SIGNAL( toggled( bool ) ), 58 connect(showFolders, SIGNAL( toggled(bool) ),
59 SLOT( slotShowFolders( bool ) ) ); 59 SLOT( slotShowFolders(bool) ) );
60 60
61 /* 61 /*
62 searchMails = new QAction( tr( "Search mails" ), QIconSet( Resource::loadPixmap("find") ), 62 searchMails = new QAction( tr( "Search mails" ), QIconSet( Resource::loadPixmap("find") ),
63 0, 0, this ); 63 0, 0, this );
64 searchMails->addTo( toolBar ); 64 searchMails->addTo( toolBar );
65 searchMails->addTo( mailMenu ); 65 searchMails->addTo( mailMenu );
66 */ 66 */
67 67
68 deleteMails = new QAction(tr("Delete Mail"), QIconSet( Resource::loadPixmap("trash")), 0, 0, this); 68 deleteMails = new QAction(tr("Delete Mail"), QIconSet( Resource::loadPixmap("trash")), 0, 0, this);
69 deleteMails->addTo( toolBar ); 69 deleteMails->addTo( toolBar );
70 deleteMails->addTo( mailMenu ); 70 deleteMails->addTo( mailMenu );
71 connect( deleteMails, SIGNAL( activated() ), 71 connect( deleteMails, SIGNAL( activated() ),
72 SLOT( slotDeleteMail() ) ); 72 SLOT( slotDeleteMail() ) );
73 73
74 editSettings = new QAction( tr( "Edit settings" ), QIconSet( Resource::loadPixmap("SettingsIcon") ) , 74 editSettings = new QAction( tr( "Edit settings" ), QIconSet( Resource::loadPixmap("SettingsIcon") ) ,
75 0, 0, this ); 75 0, 0, this );
76 editSettings->addTo( settingsMenu ); 76 editSettings->addTo( settingsMenu );
77 connect( editSettings, SIGNAL( activated() ), 77 connect( editSettings, SIGNAL( activated() ),
78 SLOT( slotEditSettings() ) ); 78 SLOT( slotEditSettings() ) );
79 editAccounts = new QAction( tr( "Configure accounts" ), QIconSet( Resource::loadPixmap("mail/editaccounts") ) , 79 editAccounts = new QAction( tr( "Configure accounts" ), QIconSet( Resource::loadPixmap("mail/editaccounts") ) ,
80 0, 0, this ); 80 0, 0, this );
81 editAccounts->addTo( settingsMenu ); 81 editAccounts->addTo( settingsMenu );
82 82
83 //setCentralWidget( view ); 83 //setCentralWidget( view );
@@ -96,62 +96,62 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
96 96
97 layout->addWidget( folderView ); 97 layout->addWidget( folderView );
98 98
99 mailView = new QListView( view ); 99 mailView = new QListView( view );
100 mailView->addColumn( tr( "" ) ); 100 mailView->addColumn( tr( "" ) );
101 mailView->addColumn( tr( "Subject" ),QListView::Manual ); 101 mailView->addColumn( tr( "Subject" ),QListView::Manual );
102 mailView->addColumn( tr( "Sender" ),QListView::Manual ); 102 mailView->addColumn( tr( "Sender" ),QListView::Manual );
103 mailView->addColumn( tr( "Size" ),QListView::Manual); 103 mailView->addColumn( tr( "Size" ),QListView::Manual);
104 mailView->addColumn( tr( "Date" )); 104 mailView->addColumn( tr( "Date" ));
105 mailView->setAllColumnsShowFocus(true); 105 mailView->setAllColumnsShowFocus(true);
106 mailView->setSorting(-1); 106 mailView->setSorting(-1);
107 107
108 statusWidget = new StatusWidget( wrapperBox ); 108 statusWidget = new StatusWidget( wrapperBox );
109 statusWidget->hide(); 109 statusWidget->hide();
110 110
111 layout->addWidget( mailView ); 111 layout->addWidget( mailView );
112 layout->setStretchFactor( folderView, 1 ); 112 layout->setStretchFactor( folderView, 1 );
113 layout->setStretchFactor( mailView, 2 ); 113 layout->setStretchFactor( mailView, 2 );
114 114
115 slotAdjustLayout(); 115 slotAdjustLayout();
116 116
117 QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); 117 QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold);
118 QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); 118 QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold);
119 119
120 connect( mailView, SIGNAL( mouseButtonClicked(int, QListViewItem *,const QPoint&,int ) ),this, 120 connect( mailView, SIGNAL( mouseButtonClicked(int,QListViewItem*,const QPoint&,int) ),this,
121 SLOT( mailLeftClicked( int, QListViewItem *,const QPoint&,int ) ) ); 121 SLOT( mailLeftClicked(int,QListViewItem*,const QPoint&,int) ) );
122 connect( mailView, SIGNAL( mouseButtonPressed(int, QListViewItem *,const QPoint&,int ) ),this, 122 connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this,
123 SLOT( mailHold( int, QListViewItem *,const QPoint&,int ) ) ); 123 SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) );
124 connect(folderView, SIGNAL(refreshMailview(QList<RecMail>*)),this,SLOT(refreshMailView(QList<RecMail>*))); 124 connect(folderView, SIGNAL(refreshMailview(QList<RecMail>*)),this,SLOT(refreshMailView(QList<RecMail>*)));
125 connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); 125 connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) );
126 connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); 126 connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) );
127// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); 127// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) );
128 connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); 128 connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) );
129 // Added by Stefan Eilers to allow starting by addressbook.. 129 // Added by Stefan Eilers to allow starting by addressbook..
130 // copied from old mail2 130 // copied from old mail2
131#if !defined(QT_NO_COP) 131#if !defined(QT_NO_COP)
132 connect( qApp, SIGNAL( appMessage( const QCString&, const QByteArray& ) ), 132 connect( qApp, SIGNAL( appMessage(const QCString&,const QByteArray&) ),
133 this, SLOT( appMessage( const QCString&, const QByteArray& ) ) ); 133 this, SLOT( appMessage(const QCString&,const QByteArray&) ) );
134#endif 134#endif
135 135
136 QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); 136 QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) );
137} 137}
138 138
139MainWindow::~MainWindow() 139MainWindow::~MainWindow()
140{ 140{
141} 141}
142 142
143void MainWindow::appMessage(const QCString &, const QByteArray &) 143void MainWindow::appMessage(const QCString &, const QByteArray &)
144{ 144{
145 qDebug("appMessage not reached"); 145 qDebug("appMessage not reached");
146} 146}
147 147
148void MainWindow::slotAdjustLayout() { 148void MainWindow::slotAdjustLayout() {
149 149
150 QWidget *d = QApplication::desktop(); 150 QWidget *d = QApplication::desktop();
151 151
152 if ( d->width() < d->height() ) { 152 if ( d->width() < d->height() ) {
153 layout->setDirection( QBoxLayout::TopToBottom ); 153 layout->setDirection( QBoxLayout::TopToBottom );
154 } else { 154 } else {
155 layout->setDirection( QBoxLayout::LeftToRight ); 155 layout->setDirection( QBoxLayout::LeftToRight );
156 } 156 }
157} 157}
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp
index f015228..8636957 100644
--- a/noncore/net/mail/viewmail.cpp
+++ b/noncore/net/mail/viewmail.cpp
@@ -264,53 +264,53 @@ void ViewMail::setMail( RecMail mail )
264 m_recMail = mail; 264 m_recMail = mail;
265 265
266 m_mail[0] = mail.getFrom(); 266 m_mail[0] = mail.getFrom();
267 m_mail[1] = mail.getSubject(); 267 m_mail[1] = mail.getSubject();
268 m_mail[3] = mail.getDate(); 268 m_mail[3] = mail.getDate();
269 m_mail[4] = mail.Msgid(); 269 m_mail[4] = mail.Msgid();
270 270
271 m_mail2[0] = mail.To(); 271 m_mail2[0] = mail.To();
272 m_mail2[1] = mail.CC(); 272 m_mail2[1] = mail.CC();
273 m_mail2[2] = mail.Bcc(); 273 m_mail2[2] = mail.Bcc();
274 274
275 setText(); 275 setText();
276} 276}
277 277
278 278
279 279
280ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) 280ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl)
281 : ViewMailBase(parent, name, fl), _inLoop(false) 281 : ViewMailBase(parent, name, fl), _inLoop(false)
282{ 282{
283 m_gotBody = false; 283 m_gotBody = false;
284 deleted = false; 284 deleted = false;
285 285
286 connect( reply, SIGNAL(activated()), SLOT(slotReply())); 286 connect( reply, SIGNAL(activated()), SLOT(slotReply()));
287 connect( forward, SIGNAL(activated()), SLOT(slotForward())); 287 connect( forward, SIGNAL(activated()), SLOT(slotForward()));
288 connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail( ) ) ); 288 connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail() ) );
289 connect( showHtml, SIGNAL( toggled( bool ) ), SLOT( slotShowHtml( bool ) ) ); 289 connect( showHtml, SIGNAL( toggled(bool) ), SLOT( slotShowHtml(bool) ) );
290 290
291 attachments->setEnabled(m_gotBody); 291 attachments->setEnabled(m_gotBody);
292 connect( attachments, SIGNAL( clicked ( QListViewItem *, const QPoint & , int ) ), SLOT( slotItemClicked( QListViewItem *, const QPoint & , int ) ) ); 292 connect( attachments, SIGNAL( clicked(QListViewItem*,const QPoint&, int) ), SLOT( slotItemClicked(QListViewItem*,const QPoint&, int) ) );
293 293
294 readConfig(); 294 readConfig();
295 attachments->setSorting(-1); 295 attachments->setSorting(-1);
296} 296}
297 297
298void ViewMail::readConfig() 298void ViewMail::readConfig()
299{ 299{
300 Config cfg( "mail" ); 300 Config cfg( "mail" );
301 cfg.setGroup( "Settings" ); 301 cfg.setGroup( "Settings" );
302 m_showHtml = cfg.readBoolEntry( "showHtml", false ); 302 m_showHtml = cfg.readBoolEntry( "showHtml", false );
303 showHtml->setOn( m_showHtml ); 303 showHtml->setOn( m_showHtml );
304} 304}
305 305
306void ViewMail::setText() 306void ViewMail::setText()
307{ 307{
308 308
309 QString toString; 309 QString toString;
310 QString ccString; 310 QString ccString;
311 QString bccString; 311 QString bccString;
312 312
313 for ( QStringList::Iterator it = ( m_mail2[0] ).begin(); it != ( m_mail2[0] ).end(); ++it ) 313 for ( QStringList::Iterator it = ( m_mail2[0] ).begin(); it != ( m_mail2[0] ).end(); ++it )
314 { 314 {
315 toString += (*it); 315 toString += (*it);
316 } 316 }