summaryrefslogtreecommitdiff
authorharlekin <harlekin>2003-12-08 22:52:28 (UTC)
committer harlekin <harlekin>2003-12-08 22:52:28 (UTC)
commit92d67d6f0e34cdee111c94d2b0304768dfdea2f9 (patch) (unidiff)
treeee5f7f94cf6a898402285cc29fa31ce6e75d6d38
parent115bb2c722dc03c0491e2f1c49495a1ceb760000 (diff)
downloadopie-92d67d6f0e34cdee111c94d2b0304768dfdea2f9.zip
opie-92d67d6f0e34cdee111c94d2b0304768dfdea2f9.tar.gz
opie-92d67d6f0e34cdee111c94d2b0304768dfdea2f9.tar.bz2
less includes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/composemail.cpp7
-rw-r--r--noncore/net/mail/editaccounts.cpp1
-rw-r--r--noncore/net/mail/libmailwrapper/mailwrapper.cpp2
-rw-r--r--noncore/net/mail/mailwrapper.cpp2
-rw-r--r--noncore/net/mail/main.cpp1
-rw-r--r--noncore/net/mail/mainwindow.cpp1
6 files changed, 0 insertions, 14 deletions
diff --git a/noncore/net/mail/composemail.cpp b/noncore/net/mail/composemail.cpp
index a17ccb3..88dd780 100644
--- a/noncore/net/mail/composemail.cpp
+++ b/noncore/net/mail/composemail.cpp
@@ -1,61 +1,54 @@
1#include <qt.h> 1#include <qt.h>
2#include <qcombobox.h>
3#include <qmessagebox.h>
4#include <qlistview.h>
5#include <qtabwidget.h>
6#include <qmultilineedit.h>
7#include <qregexp.h>
8 2
9#include <opie/ofiledialog.h> 3#include <opie/ofiledialog.h>
10#include <qpe/resource.h> 4#include <qpe/resource.h>
11 5
12#include "composemail.h" 6#include "composemail.h"
13#include "mailwrapper.h"
14 7
15ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) 8ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags )
16 : ComposeMailUI( parent, name, modal, flags ) 9 : ComposeMailUI( parent, name, modal, flags )
17{ 10{
18 settings = s; 11 settings = s;
19 12
20 attList->addColumn( tr( "Name" ) ); 13 attList->addColumn( tr( "Name" ) );
21 attList->addColumn( tr( "Size" ) ); 14 attList->addColumn( tr( "Size" ) );
22 15
23 QList<Account> accounts = settings->getAccounts(); 16 QList<Account> accounts = settings->getAccounts();
24 Account *it; 17 Account *it;
25 for ( it = accounts.first(); it; it = accounts.next() ) { 18 for ( it = accounts.first(); it; it = accounts.next() ) {
26 if ( it->getType().compare( "SMTP" ) == 0 ) { 19 if ( it->getType().compare( "SMTP" ) == 0 ) {
27 SMTPaccount *smtp = static_cast<SMTPaccount *>(it); 20 SMTPaccount *smtp = static_cast<SMTPaccount *>(it);
28 fromBox->insertItem( smtp->getMail() ); 21 fromBox->insertItem( smtp->getMail() );
29 smtpAccounts.append( smtp ); 22 smtpAccounts.append( smtp );
30 } 23 }
31 } 24 }
32 25
33 if ( smtpAccounts.count() > 0 ) { 26 if ( smtpAccounts.count() > 0 ) {
34 fillValues( fromBox->currentItem() ); 27 fillValues( fromBox->currentItem() );
35 } else { 28 } else {
36 QMessageBox::information( this, tr( "Problem" ), 29 QMessageBox::information( this, tr( "Problem" ),
37 tr( "<p>Please create an SMTP account first.</p>" ), 30 tr( "<p>Please create an SMTP account first.</p>" ),
38 tr( "Ok" ) ); 31 tr( "Ok" ) );
39 } 32 }
40 33
41 connect( fromBox, SIGNAL( activated( int ) ), SLOT( fillValues( int ) ) ); 34 connect( fromBox, SIGNAL( activated( int ) ), SLOT( fillValues( int ) ) );
42 connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); 35 connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) );
43 connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) ); 36 connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) );
44 connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) ); 37 connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) );
45 connect( replyButton, SIGNAL( clicked() ), SLOT( pickAddressReply() ) ); 38 connect( replyButton, SIGNAL( clicked() ), SLOT( pickAddressReply() ) );
46 connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) ); 39 connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) );
47 connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) ); 40 connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) );
48} 41}
49 42
50void ComposeMail::pickAddress( QLineEdit *line ) 43void ComposeMail::pickAddress( QLineEdit *line )
51{ 44{
52 QString names = AddressPicker::getNames(); 45 QString names = AddressPicker::getNames();
53 if ( line->text().isEmpty() ) { 46 if ( line->text().isEmpty() ) {
54 line->setText( names ); 47 line->setText( names );
55 } else if ( !names.isEmpty() ) { 48 } else if ( !names.isEmpty() ) {
56 line->setText( line->text() + ", " + names ); 49 line->setText( line->text() + ", " + names );
57 } 50 }
58} 51}
59 52
60void ComposeMail::pickAddressTo() 53void ComposeMail::pickAddressTo()
61{ 54{
diff --git a/noncore/net/mail/editaccounts.cpp b/noncore/net/mail/editaccounts.cpp
index 7e2dd24..1c80adb 100644
--- a/noncore/net/mail/editaccounts.cpp
+++ b/noncore/net/mail/editaccounts.cpp
@@ -1,50 +1,49 @@
1#include <qt.h> 1#include <qt.h>
2#include <qtabwidget.h>
3 2
4#include "defines.h" 3#include "defines.h"
5#include "editaccounts.h" 4#include "editaccounts.h"
6 5
7AccountListItem::AccountListItem( QListView *parent, Account *a) 6AccountListItem::AccountListItem( QListView *parent, Account *a)
8 : QListViewItem( parent ) 7 : QListViewItem( parent )
9{ 8{
10 account = a; 9 account = a;
11 setText( 0, account->getAccountName() ); 10 setText( 0, account->getAccountName() );
12 setText( 1, account->getType() ); 11 setText( 1, account->getType() );
13} 12}
14 13
15EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) 14EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags )
16 : EditAccountsUI( parent, name, modal, flags ) 15 : EditAccountsUI( parent, name, modal, flags )
17{ 16{
18 qDebug( "New Account Configuration Widget" ); 17 qDebug( "New Account Configuration Widget" );
19 settings = s; 18 settings = s;
20 19
21 mailList->addColumn( tr( "Account" ) ); 20 mailList->addColumn( tr( "Account" ) );
22 mailList->addColumn( tr( "Type" ) ); 21 mailList->addColumn( tr( "Type" ) );
23 22
24 newsList->addColumn( tr( "Account" ) ); 23 newsList->addColumn( tr( "Account" ) );
25 24
26 connect( newMail, SIGNAL( clicked() ), SLOT( slotNewMail() ) ); 25 connect( newMail, SIGNAL( clicked() ), SLOT( slotNewMail() ) );
27 connect( editMail, SIGNAL( clicked() ), SLOT( slotEditMail() ) ); 26 connect( editMail, SIGNAL( clicked() ), SLOT( slotEditMail() ) );
28 connect( deleteMail, SIGNAL( clicked() ), SLOT( slotDeleteMail() ) ); 27 connect( deleteMail, SIGNAL( clicked() ), SLOT( slotDeleteMail() ) );
29 connect( newNews, SIGNAL( clicked() ), SLOT( slotNewNews() ) ); 28 connect( newNews, SIGNAL( clicked() ), SLOT( slotNewNews() ) );
30 connect( editNews, SIGNAL( clicked() ), SLOT( slotEditNews() ) ); 29 connect( editNews, SIGNAL( clicked() ), SLOT( slotEditNews() ) );
31 connect( deleteNews, SIGNAL( clicked() ), SLOT( slotDeleteNews() ) ); 30 connect( deleteNews, SIGNAL( clicked() ), SLOT( slotDeleteNews() ) );
32 31
33 slotFillLists(); 32 slotFillLists();
34} 33}
35 34
36void EditAccounts::slotFillLists() 35void EditAccounts::slotFillLists()
37{ 36{
38 mailList->clear(); 37 mailList->clear();
39 newsList->clear(); 38 newsList->clear();
40 39
41 QList<Account> accounts = settings->getAccounts(); 40 QList<Account> accounts = settings->getAccounts();
42 Account *it; 41 Account *it;
43 for ( it = accounts.first(); it; it = accounts.next() ) { 42 for ( it = accounts.first(); it; it = accounts.next() ) {
44 if ( it->getType().compare( "NNTP" ) == 0 ) { 43 if ( it->getType().compare( "NNTP" ) == 0 ) {
45 (void) new AccountListItem( newsList, it ); 44 (void) new AccountListItem( newsList, it );
46 } else { 45 } else {
47 (void) new AccountListItem( mailList, it ); 46 (void) new AccountListItem( mailList, it );
48 } 47 }
49 } 48 }
50} 49}
diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.cpp b/noncore/net/mail/libmailwrapper/mailwrapper.cpp
index 13a3fd9..ea9e7b2 100644
--- a/noncore/net/mail/libmailwrapper/mailwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/mailwrapper.cpp
@@ -1,57 +1,55 @@
1#include <qfileinfo.h>
2#include <stdlib.h> 1#include <stdlib.h>
3#include <sys/stat.h> 2#include <sys/stat.h>
4#include <sys/types.h> 3#include <sys/types.h>
5#include <unistd.h> 4#include <unistd.h>
6#include <fcntl.h> 5#include <fcntl.h>
7#include <string.h> 6#include <string.h>
8#include <qdir.h> 7#include <qdir.h>
9#include <qtextstream.h>
10 8
11#include "mailwrapper.h" 9#include "mailwrapper.h"
12#include "logindialog.h" 10#include "logindialog.h"
13//#include "mail.h" 11//#include "mail.h"
14#include "defines.h" 12#include "defines.h"
15 13
16Attachment::Attachment( DocLnk lnk ) 14Attachment::Attachment( DocLnk lnk )
17{ 15{
18 doc = lnk; 16 doc = lnk;
19 size = QFileInfo( doc.file() ).size(); 17 size = QFileInfo( doc.file() ).size();
20} 18}
21 19
22Folder::Folder(const QString&tmp_name ) 20Folder::Folder(const QString&tmp_name )
23{ 21{
24 name = tmp_name; 22 name = tmp_name;
25 nameDisplay = name; 23 nameDisplay = name;
26 24
27 for ( int pos = nameDisplay.find( '&' ); pos != -1; 25 for ( int pos = nameDisplay.find( '&' ); pos != -1;
28 pos = nameDisplay.find( '&' ) ) { 26 pos = nameDisplay.find( '&' ) ) {
29 int end = nameDisplay.find( '-' ); 27 int end = nameDisplay.find( '-' );
30 if ( end == -1 || end <= pos ) break; 28 if ( end == -1 || end <= pos ) break;
31 QString str64 = nameDisplay.mid( pos + 1, end - pos - 1 ); 29 QString str64 = nameDisplay.mid( pos + 1, end - pos - 1 );
32 // TODO: do real base64 decoding here ! 30 // TODO: do real base64 decoding here !
33 if ( str64.compare( "APw" ) == 0 ) { 31 if ( str64.compare( "APw" ) == 0 ) {
34 nameDisplay = nameDisplay.replace( pos, end - pos + 1, "ue" ); 32 nameDisplay = nameDisplay.replace( pos, end - pos + 1, "ue" );
35 } else if ( str64.compare( "APY" ) == 0 ) { 33 } else if ( str64.compare( "APY" ) == 0 ) {
36 nameDisplay = nameDisplay.replace( pos, end - pos + 1, "oe" ); 34 nameDisplay = nameDisplay.replace( pos, end - pos + 1, "oe" );
37 } 35 }
38 } 36 }
39 37
40 qDebug( "folder " + name + " - displayed as " + nameDisplay ); 38 qDebug( "folder " + name + " - displayed as " + nameDisplay );
41} 39}
42 40
43MailWrapper::MailWrapper( Settings *s ) 41MailWrapper::MailWrapper( Settings *s )
44 : QObject() 42 : QObject()
45{ 43{
46 settings = s; 44 settings = s;
47} 45}
48 46
49QString MailWrapper::mailsmtpError( int errnum ) 47QString MailWrapper::mailsmtpError( int errnum )
50{ 48{
51 switch ( errnum ) { 49 switch ( errnum ) {
52 case MAILSMTP_NO_ERROR: 50 case MAILSMTP_NO_ERROR:
53 return tr( "No error" ); 51 return tr( "No error" );
54 case MAILSMTP_ERROR_UNEXPECTED_CODE: 52 case MAILSMTP_ERROR_UNEXPECTED_CODE:
55 return tr( "Unexpected error code" ); 53 return tr( "Unexpected error code" );
56 case MAILSMTP_ERROR_SERVICE_NOT_AVAILABLE: 54 case MAILSMTP_ERROR_SERVICE_NOT_AVAILABLE:
57 return tr( "Service not available" ); 55 return tr( "Service not available" );
diff --git a/noncore/net/mail/mailwrapper.cpp b/noncore/net/mail/mailwrapper.cpp
index 13a3fd9..ea9e7b2 100644
--- a/noncore/net/mail/mailwrapper.cpp
+++ b/noncore/net/mail/mailwrapper.cpp
@@ -1,57 +1,55 @@
1#include <qfileinfo.h>
2#include <stdlib.h> 1#include <stdlib.h>
3#include <sys/stat.h> 2#include <sys/stat.h>
4#include <sys/types.h> 3#include <sys/types.h>
5#include <unistd.h> 4#include <unistd.h>
6#include <fcntl.h> 5#include <fcntl.h>
7#include <string.h> 6#include <string.h>
8#include <qdir.h> 7#include <qdir.h>
9#include <qtextstream.h>
10 8
11#include "mailwrapper.h" 9#include "mailwrapper.h"
12#include "logindialog.h" 10#include "logindialog.h"
13//#include "mail.h" 11//#include "mail.h"
14#include "defines.h" 12#include "defines.h"
15 13
16Attachment::Attachment( DocLnk lnk ) 14Attachment::Attachment( DocLnk lnk )
17{ 15{
18 doc = lnk; 16 doc = lnk;
19 size = QFileInfo( doc.file() ).size(); 17 size = QFileInfo( doc.file() ).size();
20} 18}
21 19
22Folder::Folder(const QString&tmp_name ) 20Folder::Folder(const QString&tmp_name )
23{ 21{
24 name = tmp_name; 22 name = tmp_name;
25 nameDisplay = name; 23 nameDisplay = name;
26 24
27 for ( int pos = nameDisplay.find( '&' ); pos != -1; 25 for ( int pos = nameDisplay.find( '&' ); pos != -1;
28 pos = nameDisplay.find( '&' ) ) { 26 pos = nameDisplay.find( '&' ) ) {
29 int end = nameDisplay.find( '-' ); 27 int end = nameDisplay.find( '-' );
30 if ( end == -1 || end <= pos ) break; 28 if ( end == -1 || end <= pos ) break;
31 QString str64 = nameDisplay.mid( pos + 1, end - pos - 1 ); 29 QString str64 = nameDisplay.mid( pos + 1, end - pos - 1 );
32 // TODO: do real base64 decoding here ! 30 // TODO: do real base64 decoding here !
33 if ( str64.compare( "APw" ) == 0 ) { 31 if ( str64.compare( "APw" ) == 0 ) {
34 nameDisplay = nameDisplay.replace( pos, end - pos + 1, "ue" ); 32 nameDisplay = nameDisplay.replace( pos, end - pos + 1, "ue" );
35 } else if ( str64.compare( "APY" ) == 0 ) { 33 } else if ( str64.compare( "APY" ) == 0 ) {
36 nameDisplay = nameDisplay.replace( pos, end - pos + 1, "oe" ); 34 nameDisplay = nameDisplay.replace( pos, end - pos + 1, "oe" );
37 } 35 }
38 } 36 }
39 37
40 qDebug( "folder " + name + " - displayed as " + nameDisplay ); 38 qDebug( "folder " + name + " - displayed as " + nameDisplay );
41} 39}
42 40
43MailWrapper::MailWrapper( Settings *s ) 41MailWrapper::MailWrapper( Settings *s )
44 : QObject() 42 : QObject()
45{ 43{
46 settings = s; 44 settings = s;
47} 45}
48 46
49QString MailWrapper::mailsmtpError( int errnum ) 47QString MailWrapper::mailsmtpError( int errnum )
50{ 48{
51 switch ( errnum ) { 49 switch ( errnum ) {
52 case MAILSMTP_NO_ERROR: 50 case MAILSMTP_NO_ERROR:
53 return tr( "No error" ); 51 return tr( "No error" );
54 case MAILSMTP_ERROR_UNEXPECTED_CODE: 52 case MAILSMTP_ERROR_UNEXPECTED_CODE:
55 return tr( "Unexpected error code" ); 53 return tr( "Unexpected error code" );
56 case MAILSMTP_ERROR_SERVICE_NOT_AVAILABLE: 54 case MAILSMTP_ERROR_SERVICE_NOT_AVAILABLE:
57 return tr( "Service not available" ); 55 return tr( "Service not available" );
diff --git a/noncore/net/mail/main.cpp b/noncore/net/mail/main.cpp
index f97bea1..3bfcb4a 100644
--- a/noncore/net/mail/main.cpp
+++ b/noncore/net/mail/main.cpp
@@ -1,6 +1,5 @@
1#include <qpe/qpeapplication.h>
2#include <opie/oapplicationfactory.h> 1#include <opie/oapplicationfactory.h>
3 2
4#include "opiemail.h" 3#include "opiemail.h"
5 4
6OPIE_EXPORT_APP( OApplicationFactory<OpieMail> ) 5OPIE_EXPORT_APP( OApplicationFactory<OpieMail> )
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp
index 28111d0..6f054cc 100644
--- a/noncore/net/mail/mainwindow.cpp
+++ b/noncore/net/mail/mainwindow.cpp
@@ -1,54 +1,53 @@
1#include <qlabel.h> 1#include <qlabel.h>
2#include <qvbox.h> 2#include <qvbox.h>
3#include <qheader.h> 3#include <qheader.h>
4#include <qtimer.h> 4#include <qtimer.h>
5 5
6#include <qpe/resource.h>
7 6
8#include "defines.h" 7#include "defines.h"
9#include "mainwindow.h" 8#include "mainwindow.h"
10 9
11MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) 10MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
12 : QMainWindow( parent, name, flags ) 11 : QMainWindow( parent, name, flags )
13{ 12{
14 setCaption( tr( "Opie-Mail" ) ); 13 setCaption( tr( "Opie-Mail" ) );
15 setToolBarsMovable( false ); 14 setToolBarsMovable( false );
16 15
17 toolBar = new QToolBar( this ); 16 toolBar = new QToolBar( this );
18 menuBar = new QMenuBar( toolBar ); 17 menuBar = new QMenuBar( toolBar );
19 mailMenu = new QPopupMenu( menuBar ); 18 mailMenu = new QPopupMenu( menuBar );
20 menuBar->insertItem( tr( "Mail" ), mailMenu ); 19 menuBar->insertItem( tr( "Mail" ), mailMenu );
21 settingsMenu = new QPopupMenu( menuBar ); 20 settingsMenu = new QPopupMenu( menuBar );
22 menuBar->insertItem( tr( "Settings" ), settingsMenu ); 21 menuBar->insertItem( tr( "Settings" ), settingsMenu );
23 22
24 addToolBar( toolBar ); 23 addToolBar( toolBar );
25 toolBar->setHorizontalStretchable( true ); 24 toolBar->setHorizontalStretchable( true );
26 25
27 QLabel *spacer = new QLabel( toolBar ); 26 QLabel *spacer = new QLabel( toolBar );
28 spacer->setBackgroundMode( QWidget::PaletteButton ); 27 spacer->setBackgroundMode( QWidget::PaletteButton );
29 toolBar->setStretchableWidget( spacer ); 28 toolBar->setStretchableWidget( spacer );
30 29
31 composeMail = new QAction( tr( "Compose new mail" ), ICON_COMPOSEMAIL, 30 composeMail = new QAction( tr( "Compose new mail" ), ICON_COMPOSEMAIL,
32 0, 0, this ); 31 0, 0, this );
33 composeMail->addTo( toolBar ); 32 composeMail->addTo( toolBar );
34 composeMail->addTo( mailMenu ); 33 composeMail->addTo( mailMenu );
35 34
36 sendQueued = new QAction( tr( "Send queued mails" ), ICON_SENDQUEUED, 35 sendQueued = new QAction( tr( "Send queued mails" ), ICON_SENDQUEUED,
37 0, 0, this ); 36 0, 0, this );
38 sendQueued->addTo( toolBar ); 37 sendQueued->addTo( toolBar );
39 sendQueued->addTo( mailMenu ); 38 sendQueued->addTo( mailMenu );
40 39
41 syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC, 40 syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC,
42 0, 0, this ); 41 0, 0, this );
43 syncFolders->addTo( toolBar ); 42 syncFolders->addTo( toolBar );
44 syncFolders->addTo( mailMenu ); 43 syncFolders->addTo( mailMenu );
45 44
46 showFolders = new QAction( tr( "Show/Hide folders" ), ICON_SHOWFOLDERS, 45 showFolders = new QAction( tr( "Show/Hide folders" ), ICON_SHOWFOLDERS,
47 0, 0, this, 0, true ); 46 0, 0, this, 0, true );
48 showFolders->addTo( toolBar ); 47 showFolders->addTo( toolBar );
49 showFolders->addTo( mailMenu ); 48 showFolders->addTo( mailMenu );
50 connect(showFolders, SIGNAL( toggled( bool ) ), 49 connect(showFolders, SIGNAL( toggled( bool ) ),
51 SLOT( slotShowFolders( bool ) ) ); 50 SLOT( slotShowFolders( bool ) ) );
52 51
53 searchMails = new QAction( tr( "Search mails" ), ICON_SEARCHMAILS, 52 searchMails = new QAction( tr( "Search mails" ), ICON_SEARCHMAILS,
54 0, 0, this ); 53 0, 0, this );