-rw-r--r-- | kmicromail/composemail.cpp | 13 | ||||
-rw-r--r-- | kmicromail/kmicromail.pro | 77 | ||||
-rw-r--r-- | kmicromail/libetpan/libetpan.pro | 274 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/generatemail.h | 5 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/libmailwrapper.pro | 64 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/mailwrapper.h | 2 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/mhwrapper.cpp | 22 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/mhwrapper.h | 6 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/settings.h | 1 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/smtpwrapper.cpp | 15 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/smtpwrapper.h | 2 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/storemail.h | 2 | ||||
-rw-r--r-- | kmicromail/mainwindow.cpp | 4 | ||||
-rw-r--r-- | kmicromail/mainwindow.h | 1 | ||||
-rw-r--r-- | kmicromail/opiemail.cpp | 6 | ||||
-rw-r--r-- | kmicromail/qpe/global.cpp | 12 | ||||
-rw-r--r-- | kmicromail/qpe/global.h | 12 | ||||
-rw-r--r-- | kmicromail/qpe/qpeapplication.h | 5 | ||||
-rw-r--r-- | kmicromail/viewmail.cpp | 1 |
19 files changed, 488 insertions, 36 deletions
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp index 8eb6d27..0cd0b23 100644 --- a/kmicromail/composemail.cpp +++ b/kmicromail/composemail.cpp @@ -9,52 +9,52 @@ /* OPIE */ //#include <opie2/ofiledialog.h> //#include <opie2/odebug.h> #include <kfiledialog.h> //#include <qpe/resource.h> #include <qpe/global.h> //#include <qpe/contact.h> #include <qcombobox.h> #include <qcheckbox.h> #include <qiconset.h> #include <qtimer.h> #include <qmessagebox.h> #include <qpushbutton.h> #include <qmultilineedit.h> #include <qlabel.h> #include <qtabwidget.h> #include <qlistview.h> #include <kabc/addresseedialog.h> #include <kabc/stdaddressbook.h> #include <kabc/addressee.h> #ifdef DESKTOP_VERSION +#include <qapplication.h> #include <kabc/addresseedialog.h> -#else //DESKTOP_VERSION -#include <libkdepim/externalapphandler.h> #endif //DESKTOP_VERSION +#include <libkdepim/externalapphandler.h> #include "koprefs.h" //using namespace Opie::Core; //using namespace Opie::Ui; ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal ) : ComposeMailUI( parent, name, modal ) { mPickLineEdit = 0; connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); settings = s; m_replyid = ""; if ( KOPrefs::instance()->mUseKapi) { KConfig config( locateLocal("config", "kabcrc") ); config.setGroup( "General" ); QString whoami_uid = config.readEntry( "WhoAmI" ); if ( whoami_uid.isEmpty() ) { QMessageBox::information( 0, i18n( "Hint" ), i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), i18n( "Ok" ) ); @@ -93,54 +93,55 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m QList<Account> accounts = settings->getAccounts(); if ( QApplication::desktop()->width() < 320 ) smtpAccountBox->setMaximumWidth( 80 ); Account *it; for ( it = accounts.first(); it; it = accounts.next() ) { if ( it->getType()==MAILLIB::A_SMTP ) { SMTPaccount *smtp = static_cast<SMTPaccount *>(it); smtpAccountBox->insertItem( smtp->getAccountName() ); smtpAccounts.append( smtp ); } } connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) ); connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) ); connect( replyButton, SIGNAL( clicked() ), SLOT( pickAddressReply() ) ); connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) ); connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) ); connect( SaveButton, SIGNAL( clicked() ), SLOT( saveAsDraft()) ); mMail = 0; warnAttach = true; QIconSet icon; //icon = SmallIcon("fileexport"); icon = SmallIcon("filesave"); - if ( QApplication::desktop()->width() < 320 ) + SaveButton->setIconSet (icon ) ; + if ( QApplication::desktop()->width() < 320 ) { SaveButton->setText ("") ; + SaveButton->setMaximumSize ( SaveButton->sizeHint().height(),SaveButton->sizeHint().height()) ; + } else - SaveButton->setText (i18n("Save")) ; - SaveButton->setIconSet (icon ) ; - SaveButton->setMaximumSize ( SaveButton->sizeHint().height(),SaveButton->sizeHint().height()) ; + SaveButton->setText (i18n("Save")); #ifndef DESKTOP_VERSION QPEApplication::setStylusOperation( message, QPEApplication::RightOnHold ); QPEApplication::setStylusOperation( senderNameEdit, QPEApplication::RightOnHold ); QPEApplication::setStylusOperation( subjectLine, QPEApplication::RightOnHold ); #endif message->setFont ( KOPrefs::instance()->mComposeFont ); message->setWordWrap (QMultiLineEdit::WidgetWidth); if ( smtpAccounts.count() > 0 ) { fillValues( smtpAccountBox->currentItem() ); } else { QMessageBox::information( 0, i18n( "Problem" ), i18n( "Please create an\nSMTP account first.\nThe SMTP is needed\nfor sending mail.\n" ), i18n( "Ok" ) ); return; } connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); } void ComposeMail::fillSettings() { if ( QApplication::desktop()->width() < 320 ) fromBox->setMaximumWidth( 100 ); diff --git a/kmicromail/kmicromail.pro b/kmicromail/kmicromail.pro new file mode 100644 index 0000000..cd5a3c1 --- a/dev/null +++ b/kmicromail/kmicromail.pro @@ -0,0 +1,77 @@ +CONFIG += qt warn_on +TEMPLATE = app +HEADERS = defines.h \ + editaccounts.h \ + composemail.h \ + accountview.h \ + accountitem.h \ + mainwindow.h \ + viewmail.h \ + viewmailbase.h \ + opiemail.h \ + mailistviewitem.h \ + settingsdialog.h \ + statuswidget.h \ + newmaildir.h \ + selectstore.h \ + selectsmtp.h \ + nntpgroups.h \ + koprefs.h \ + koprefsdialog.h \ + nntpgroupsdlg.h + +SOURCES = main.cpp \ + opiemail.cpp \ + mainwindow.cpp \ + accountview.cpp \ + accountitem.cpp \ + composemail.cpp \ + editaccounts.cpp \ + viewmail.cpp \ + viewmailbase.cpp \ + mailistviewitem.cpp \ + settingsdialog.cpp \ + statuswidget.cpp \ + newmaildir.cpp \ + selectstore.cpp \ + selectsmtp.cpp \ + nntpgroups.cpp \ + koprefs.cpp\ + koprefsdialog.cpp\ + nntpgroupsdlg.cpp + +INTERFACES = editaccountsui.ui \ + selectmailtypeui.ui \ + imapconfigui.ui \ + pop3configui.ui \ + nntpconfigui.ui \ + smtpconfigui.ui \ + composemailui.ui \ + settingsdialogui.ui \ + statuswidgetui.ui \ + newmaildirui.ui \ + selectstoreui.ui \ + nntpgroupsui.ui + + +INCLUDEPATH += . .. ../libkdepim ../microkde ../microkde/kdecore libetpan/include ../microkde/kdeui +LIBS += -L../bin -lmicromailwrapper -lmicrolibetpan -lmicrokde -lssl -lcrypto -lmicrokdepim -lmicrokabc + +DESTDIR= ../bin +TARGET = ompi + +DEFINES += DESKTOP_VERSION +unix : { +OBJECTS_DIR = obj/unix +MOC_DIR = moc/unix +} +win32: { +DEFINES += _WIN32_ +LIBS += mfc71u.lib +QMAKE_LINK += /NODEFAULTLIB:LIBC +#QMAKE_LINK += /NODEFAULTLIB:MSVCRT +#QMAKE_LINK += /NODEFAULTLIB:uafxcw.lib +OBJECTS_DIR = obj/win +MOC_DIR = moc/win +} + diff --git a/kmicromail/libetpan/libetpan.pro b/kmicromail/libetpan/libetpan.pro new file mode 100644 index 0000000..dfafa07 --- a/dev/null +++ b/kmicromail/libetpan/libetpan.pro @@ -0,0 +1,274 @@ +###################################################################### +# Automatically generated by qmake (1.07a) Thu Jul 1 00:54:03 2004 +###################################################################### + +TEMPLATE = lib +TARGET = microlibetpan + +OBJECTS_DIR = obj +MOC_DIR = moc +DESTDIR=../../bin + +DEPENDPATH += generic \ + imap \ + imf \ + maildir \ + mbox \ + mh \ + mime \ + nntp \ + pop3 \ + smtp \ + tests \ + tools \ + include/libetpan +INCLUDEPATH += . \ + generic \ + include \ + tools \ + imf \ + imap \ + mime \ + maildir \ + mbox \ + mh \ + nntp \ + pop3 \ + smtp \ + tests + +# Input +HEADERS += generic/data_message_driver.h \ + generic/generic_cache.h \ + generic/generic_cache_types.h \ + generic/imapdriver.h \ + generic/imapdriver_cached.h \ + generic/imapdriver_cached_message.h \ + generic/imapdriver_message.h \ + generic/imapdriver_tools.h \ + generic/imapdriver_types.h \ + generic/imapstorage.h \ + generic/imfcache.h \ + generic/libetpan.h \ + generic/libetpan_version.h \ + generic/maildirdriver.h \ + generic/maildirdriver_cached.h \ + generic/maildirdriver_cached_message.h \ + generic/maildirdriver_message.h \ + generic/maildirdriver_tools.h \ + generic/maildirdriver_types.h \ + generic/maildirstorage.h \ + generic/maildriver.h \ + generic/maildriver_errors.h \ + generic/maildriver_tools.h \ + generic/maildriver_types.h \ + generic/maildriver_types_helper.h \ + generic/mailfolder.h \ + generic/mailmessage.h \ + generic/mailmessage_tools.h \ + generic/mailmessage_types.h \ + generic/mailstorage.h \ + generic/mailstorage_tools.h \ + generic/mailstorage_types.h \ + generic/mailthread.h \ + generic/mailthread_types.h \ + generic/mboxdriver.h \ + generic/mboxdriver_cached.h \ + generic/mboxdriver_cached_message.h \ + generic/mboxdriver_message.h \ + generic/mboxdriver_tools.h \ + generic/mboxdriver_types.h \ + generic/mboxstorage.h \ + generic/mhdriver.h \ + generic/mhdriver_cached.h \ + generic/mhdriver_cached_message.h \ + generic/mhdriver_message.h \ + generic/mhdriver_tools.h \ + generic/mhdriver_types.h \ + generic/mhstorage.h \ + generic/mime_message_driver.h \ + generic/nntpdriver.h \ + generic/nntpdriver_cached.h \ + generic/nntpdriver_cached_message.h \ + generic/nntpdriver_message.h \ + generic/nntpdriver_tools.h \ + generic/nntpdriver_types.h \ + generic/nntpstorage.h \ + generic/pop3driver.h \ + generic/pop3driver_cached.h \ + generic/pop3driver_cached_message.h \ + generic/pop3driver_message.h \ + generic/pop3driver_tools.h \ + generic/pop3driver_types.h \ + generic/pop3storage.h \ + imap/mailimap.h \ + imap/mailimap_helper.h \ + imap/mailimap_keywords.h \ + imap/mailimap_parser.h \ + imap/mailimap_print.h \ + imap/mailimap_sender.h \ + imap/mailimap_socket.h \ + imap/mailimap_ssl.h \ + imap/mailimap_types.h \ + imap/mailimap_types_helper.h \ + imf/mailimf.h \ + imf/mailimf_types.h \ + imf/mailimf_types_helper.h \ + imf/mailimf_write.h \ + maildir/maildir.h \ + maildir/maildir_types.h \ + mbox/mailmbox.h \ + mbox/mailmbox_parse.h \ + mbox/mailmbox_types.h \ + mh/mailmh.h \ + mime/mailmime.h \ + mime/mailmime_content.h \ + mime/mailmime_decode.h \ + mime/mailmime_disposition.h \ + mime/mailmime_types.h \ + mime/mailmime_types_helper.h \ + mime/mailmime_write.h \ + nntp/newsnntp.h \ + nntp/newsnntp_socket.h \ + nntp/newsnntp_ssl.h \ + nntp/newsnntp_types.h \ + pop3/mailpop3.h \ + pop3/mailpop3_helper.h \ + pop3/mailpop3_socket.h \ + pop3/mailpop3_ssl.h \ + pop3/mailpop3_types.h \ + smtp/mailsmtp.h \ + smtp/mailsmtp_helper.h \ + smtp/mailsmtp_socket.h \ + smtp/mailsmtp_ssl.h \ + smtp/mailsmtp_types.h \ + tools/base64.h \ + tools/carray.h \ + tools/charconv.h \ + tools/chash.h \ + tools/cinthash.h \ + tools/clist.h \ + tools/connect.h \ + tools/hmac-md5.h \ + tools/mail.h \ + tools/mail_cache_db.h \ + tools/mail_cache_db_types.h \ + tools/maillock.h \ + tools/mailstream.h \ + tools/mailstream_helper.h \ + tools/mailstream_low.h \ + tools/mailstream_socket.h \ + tools/mailstream_ssl.h \ + tools/mailstream_types.h \ + tools/mapping.h \ + tools/md5.h \ + tools/md5global.h \ + tools/mmapstring.h \ + +SOURCES += generic/data_message_driver.c \ + generic/generic_cache.c \ + generic/imapdriver.c \ + generic/imapdriver_cached.c \ + generic/imapdriver_cached_message.c \ + generic/imapdriver_message.c \ + generic/imapdriver_tools.c \ + generic/imapstorage.c \ + generic/imfcache.c \ + generic/libetpan_version.c \ + generic/maildirdriver.c \ + generic/maildirdriver_cached.c \ + generic/maildirdriver_cached_message.c \ + generic/maildirdriver_message.c \ + generic/maildirdriver_tools.c \ + generic/maildirstorage.c \ + generic/maildriver.c \ + generic/maildriver_tools.c \ + generic/maildriver_types.c \ + generic/maildriver_types_helper.c \ + generic/mailfolder.c \ + generic/mailmessage.c \ + generic/mailmessage_tools.c \ + generic/mailmessage_types.c \ + generic/mailstorage.c \ + generic/mailstorage_tools.c \ + generic/mailthread.c \ + generic/mailthread_types.c \ + generic/mboxdriver.c \ + generic/mboxdriver_cached.c \ + generic/mboxdriver_cached_message.c \ + generic/mboxdriver_message.c \ + generic/mboxdriver_tools.c \ + generic/mboxstorage.c \ + generic/mhdriver.c \ + generic/mhdriver_cached.c \ + generic/mhdriver_cached_message.c \ + generic/mhdriver_message.c \ + generic/mhdriver_tools.c \ + generic/mhstorage.c \ + generic/mime_message_driver.c \ + generic/nntpdriver.c \ + generic/nntpdriver_cached.c \ + generic/nntpdriver_cached_message.c \ + generic/nntpdriver_message.c \ + generic/nntpdriver_tools.c \ + generic/nntpstorage.c \ + generic/pop3driver.c \ + generic/pop3driver_cached.c \ + generic/pop3driver_cached_message.c \ + generic/pop3driver_message.c \ + generic/pop3driver_tools.c \ + generic/pop3storage.c \ + imap/mailimap.c \ + imap/mailimap_helper.c \ + imap/mailimap_keywords.c \ + imap/mailimap_parser.c \ + imap/mailimap_print.c \ + imap/mailimap_sender.c \ + imap/mailimap_socket.c \ + imap/mailimap_ssl.c \ + imap/mailimap_types.c \ + imap/mailimap_types_helper.c \ + imf/mailimf.c \ + imf/mailimf_types.c \ + imf/mailimf_types_helper.c \ + imf/mailimf_write.c \ + maildir/maildir.c \ + mbox/mailmbox.c \ + mbox/mailmbox_parse.c \ + mbox/mailmbox_types.c \ + mh/mailmh.c \ + mime/mailmime.c \ + mime/mailmime_content.c \ + mime/mailmime_decode.c \ + mime/mailmime_disposition.c \ + mime/mailmime_types.c \ + mime/mailmime_types_helper.c \ + mime/mailmime_write.c \ + nntp/newsnntp.c \ + nntp/newsnntp_socket.c \ + nntp/newsnntp_ssl.c \ + pop3/mailpop3.c \ + pop3/mailpop3_helper.c \ + pop3/mailpop3_socket.c \ + pop3/mailpop3_ssl.c \ + smtp/mailsmtp.c \ + smtp/mailsmtp_helper.c \ + smtp/mailsmtp_socket.c \ + smtp/mailsmtp_ssl.c \ + tools/base64.c \ + tools/carray.c \ + tools/charconv.c \ + tools/chash.c \ + tools/cinthash.c \ + tools/clist.c \ + tools/connect.c \ + tools/mail_cache_db.c \ + tools/maillock.c \ + tools/mailstream.c \ + tools/mailstream_helper.c \ + tools/mailstream_low.c \ + tools/mailstream_socket.c \ + tools/mailstream_ssl.c \ + tools/mapping.c \ + tools/md5.c \ + tools/mmapstring.c diff --git a/kmicromail/libmailwrapper/generatemail.h b/kmicromail/libmailwrapper/generatemail.h index a767b61..b9f8285 100644 --- a/kmicromail/libmailwrapper/generatemail.h +++ b/kmicromail/libmailwrapper/generatemail.h @@ -1,37 +1,38 @@ #ifndef __GENERATE_MAIL_H #define __GENERATE_MAIL_H -#include <qpe/applnk.h> +//#include <qpe/applnk.h> #include <qobject.h> #include <libetpan/clist.h> +#include "mailwrapper.h" #include <opie2/osmartpointer.h> class Mail; class RecMail; -class Attachment; + struct mailimf_fields; struct mailimf_field; struct mailimf_mailbox; struct mailmime; struct mailimf_address_list; class progressMailSend; struct mailsmtp; class Generatemail : public QObject { Q_OBJECT public: Generatemail(); virtual ~Generatemail(); protected: static void addRcpts( clist *list, mailimf_address_list *addr_list ); static char *getFrom( mailmime *mail ); static char *getFrom( mailimf_field *ffrom); static mailimf_field *getField( mailimf_fields *fields, int type ); mailimf_address_list *parseAddresses(const QString&addr ); void addFileParts( mailmime *message,const QList<Attachment>&files ); mailmime *buildFilePart(const QString&filename,const QString&mimetype,const QString&content); mailmime *buildTxtPart(const QString&str ); diff --git a/kmicromail/libmailwrapper/libmailwrapper.pro b/kmicromail/libmailwrapper/libmailwrapper.pro new file mode 100644 index 0000000..2b005d8 --- a/dev/null +++ b/kmicromail/libmailwrapper/libmailwrapper.pro @@ -0,0 +1,64 @@ +TEMPLATE = lib +CONFIG += qt warn_on + +HEADERS = mailwrapper.h \ + imapwrapper.h \ + mailtypes.h \ + pop3wrapper.h \ + abstractmail.h \ + smtpwrapper.h \ + genericwrapper.h \ + mboxwrapper.h \ + settings.h \ + logindialog.h \ + sendmailprogress.h \ + statusmail.h \ + mhwrapper.h \ + nntpwrapper.h \ + generatemail.h \ + storemail.h \ + ../qpe/global.h + +SOURCES = imapwrapper.cpp \ + mailwrapper.cpp \ + mailtypes.cpp \ + pop3wrapper.cpp \ + abstractmail.cpp \ + smtpwrapper.cpp \ + genericwrapper.cpp \ + mboxwrapper.cpp \ + settings.cpp \ + logindialog.cpp \ + sendmailprogress.cpp \ + statusmail.cpp \ + mhwrapper.cpp \ + nntpwrapper.cpp \ + generatemail.cpp \ + storemail.cpp \ + ../qpe/global.cpp + +INTERFACES = logindialogui.ui \ + sendmailprogressui.ui + +INCLUDEPATH += .. ../../microkde ../../microkde/kdecore ../libetpan/include +LIBS += -lssl -lcrypto + +#-lqpe -letpan + +DESTDIR = ../../bin +TARGET = micromailwrapper + +DEFINES += DESKTOP_VERSION +unix : { +OBJECTS_DIR = obj/unix +MOC_DIR = moc/unix +} +win32: { +DEFINES += _WIN32_ +LIBS += mfc71u.lib +QMAKE_LINK += /NODEFAULTLIB:LIBC +#QMAKE_LINK += /NODEFAULTLIB:MSVCRT +#QMAKE_LINK += /NODEFAULTLIB:uafxcw.lib +OBJECTS_DIR = obj/win +MOC_DIR = moc/win +} diff --git a/kmicromail/libmailwrapper/mailwrapper.h b/kmicromail/libmailwrapper/mailwrapper.h index 2ba908b..88f10da 100644 --- a/kmicromail/libmailwrapper/mailwrapper.h +++ b/kmicromail/libmailwrapper/mailwrapper.h @@ -1,28 +1,28 @@ #ifndef MAILWRAPPER_H #define MAILWRAPPER_H -#include <qpe/applnk.h> +//#include <qpe/applnk.h> #include <qbitarray.h> #include <qdatetime.h> #include <qfileinfo.h> #include <kiconloader.h> #include "settings.h" #include <opie2/osmartpointer.h> /* class Attachment { public: Attachment( DocLnk lnk ); virtual ~Attachment(){} const QString getFileName()const{ return doc.file(); } const QString getName()const{ return doc.name(); } const QString getMimeType()const{ return doc.type(); } const QPixmap getPixmap()const{ return doc.pixmap(); } const int getSize()const { return size; } DocLnk getDocLnk() { return doc; } protected: DocLnk doc; diff --git a/kmicromail/libmailwrapper/mhwrapper.cpp b/kmicromail/libmailwrapper/mhwrapper.cpp index f4133c0..de6d220 100644 --- a/kmicromail/libmailwrapper/mhwrapper.cpp +++ b/kmicromail/libmailwrapper/mhwrapper.cpp @@ -1,36 +1,36 @@ // CHANGED 2004-09-31 Lutz Rogowski #include "mhwrapper.h" #include "mailtypes.h" #include "mailwrapper.h" #include <libetpan/libetpan.h> #include <qdir.h> #include <qmessagebox.h> #include <stdlib.h> #include <qpe/global.h> -#include <oprocess.h> #include <klocale.h> -//#include <opie2/odebug.h> +#include <kglobal.h> +//#include <opie2/odebug.h> using namespace Opie::Core; MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name) : Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name) { if (MHPath.length()>0) { if (MHPath[MHPath.length()-1]=='/') { MHPath=MHPath.left(MHPath.length()-1); } //odebug << MHPath << oendl; QDir dir(MHPath); if (!dir.exists()) { dir.mkdir(MHPath); } init_storage(); } } void MHwrapper::init_storage() { int r; QString pre = MHPath; if (!m_storage) { m_storage = mailstorage_new(NULL); @@ -294,81 +294,75 @@ int MHwrapper::deleteAllMail(const FolderP&tfolder) Global::statusMessage(i18n("Error deleting mail %1").arg(i+1)); res = 0; break; } } if (l) mailmessage_list_free(l); return res; } int MHwrapper::deleteMbox(const FolderP&tfolder) { init_storage(); if (!m_storage) { return 0; } if (!tfolder) return 0; if (tfolder->getName()=="/" || tfolder->getName().isEmpty()) return 0; int r = mailsession_delete_folder(m_storage->sto_session,(char*)tfolder->getName().latin1()); if (r != MAIL_NO_ERROR) { qDebug("error deleting mail box "); return 0; } + QString delDir = locateLocal( "apps", "kopiemail")+ "localmail"; + qDebug("*****************\ndel %s %s ", delDir.latin1(),tfolder->getName().latin1() ); +#if 0 QString cmd = "rm -rf "+tfolder->getName(); QStringList command; command << "/bin/sh"; command << "-c"; command << cmd.latin1(); OProcess *process = new OProcess(); + /* connect(process, SIGNAL(processExited(Opie::Core::OProcess*)), this, SLOT( processEnded(Opie::Core::OProcess*))); connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)), this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int))); - + */ *process << command; removeMboxfailed = false; if(!process->start(OProcess::Block, OProcess::All) ) { qDebug("could not start process "); return 0; } +#endif qDebug("mail box deleted "); return 1; } -void MHwrapper::processEnded(OProcess *p) -{ - if (p) delete p; -} - -void MHwrapper::oprocessStderr(OProcess*, char *buffer, int ) -{ - QString lineStr = buffer; - QMessageBox::warning( 0, i18n("Error"), lineStr ,i18n("Ok") ); - removeMboxfailed = true; -} void MHwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) { init_storage(); if (!m_storage) { return; } target_stat.message_count = 0; target_stat.message_unseen = 0; target_stat.message_recent = 0; QString f = buildPath(mailbox); int r = mailsession_status_folder(m_storage->sto_session,(char*)f.latin1(),&target_stat.message_count, &target_stat.message_recent,&target_stat.message_unseen); if (r != MAIL_NO_ERROR) { Global::statusMessage(i18n("Error retrieving status")); } } MAILLIB::ATYPE MHwrapper::getType()const { return MAILLIB::A_MH; } const QString&MHwrapper::getName()const diff --git a/kmicromail/libmailwrapper/mhwrapper.h b/kmicromail/libmailwrapper/mhwrapper.h index d1b7d1f..87f8ca1 100644 --- a/kmicromail/libmailwrapper/mhwrapper.h +++ b/kmicromail/libmailwrapper/mhwrapper.h @@ -1,62 +1,58 @@ // CHANGED 2004-09-31 Lutz Rogowski #ifndef __MH_WRAPPER_H #define __MH_WRAPPER_H #include "maildefines.h" #include "genericwrapper.h" #include <qstring.h> class encodedString; struct mailmbox_folder; -namespace Opie {namespace Core {class OProcess;}} - class MHwrapper : public Genericwrapper { Q_OBJECT public: MHwrapper(const QString & dir,const QString&name); virtual ~MHwrapper(); virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); virtual void deleteMail(const RecMailP&mail); virtual void answeredMail(const RecMailP&mail); virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder, const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); virtual int createMbox(const QString&folder,const Opie::Core::OSmartPointer<Folder>&f=0, const QString&d="",bool s=false); virtual int deleteMbox(const Opie::Core::OSmartPointer<Folder>&); virtual void storeMessage(const char*msg,size_t length, const QString&folder); virtual RecBodyP fetchBody( const RecMailP &mail ); static void mbox_progress( size_t current, size_t maximum ); virtual encodedString* fetchRawBody(const RecMailP&mail); virtual void deleteMails(const QString & FolderName,const QValueList<Opie::Core::OSmartPointer<RecMail> > &target); virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); virtual MAILLIB::ATYPE getType()const; virtual const QString&getName()const; virtual Account* getAccount() { return 0; }; public slots: - /* for deleting maildirs we are using a system call */ - virtual void oprocessStderr(Opie::Core::OProcess*, char *buffer, int ); - virtual void processEnded(Opie::Core::OProcess *); + protected: QString buildPath(const QString&p); QString MHPath; QString MHName; void init_storage(); void clean_storage(); bool removeMboxfailed; }; #endif diff --git a/kmicromail/libmailwrapper/settings.h b/kmicromail/libmailwrapper/settings.h index 61051dd..79567ef 100644 --- a/kmicromail/libmailwrapper/settings.h +++ b/kmicromail/libmailwrapper/settings.h @@ -1,34 +1,35 @@ #ifndef SETTINGS_H #define SETTINGS_H #include "maildefines.h" /* OPIE */ /* QT */ #include <qobject.h> #include <qlist.h> +#include <qstringlist.h> #include <qdatetime.h> class Account { public: Account(); virtual ~Account() {} void remove(); void setAccountName( QString name ) { accountName = name; } const QString&getAccountName()const{ return accountName; } MAILLIB::ATYPE getType()const{ return type; } void setServer(const QString&str){ server = str; } const QString&getServer()const{ return server; } void setLocalFolder( QString name ) { localFolder = name; } const QString& getLocalFolder()const{ return localFolder; } void setPort(const QString&str) { port = str; } const QString&getPort()const{ return port; } void setUser(const QString&str){ user = str; } diff --git a/kmicromail/libmailwrapper/smtpwrapper.cpp b/kmicromail/libmailwrapper/smtpwrapper.cpp index dee1477..eb07ef1 100644 --- a/kmicromail/libmailwrapper/smtpwrapper.cpp +++ b/kmicromail/libmailwrapper/smtpwrapper.cpp @@ -1,66 +1,71 @@ #include "smtpwrapper.h" #include "mailwrapper.h" #include "abstractmail.h" #include "logindialog.h" #include "mailtypes.h" #include "sendmailprogress.h" //#include <opie2/odebug.h> //#include <qt.h> #include <qapplication.h> #include <qmessagebox.h> #include <stdlib.h> -#include <qpe/config.h> +#ifndef DESKTOP_VERSION +//#include <qpe/config.h> #include <qpe/qcopenvelope_qws.h> - +#endif #include <libetpan/libetpan.h> #include <klocale.h> +#include <kglobal.h> +#include <kconfig.h> using namespace Opie::Core; progressMailSend*SMTPwrapper::sendProgress = 0; SMTPwrapper::SMTPwrapper(SMTPaccount * aSmtp ) : Generatemail() { m_SmtpAccount = aSmtp; - Config cfg( "mail" ); + KConfig cfg( locateLocal("config", "kopiemail" ) ); cfg.setGroup( "Status" ); m_queuedMail = cfg.readNumEntry( "outgoing", 0 ); emit queuedMails( m_queuedMail ); connect( this, SIGNAL( queuedMails(int) ), this, SLOT( emitQCop(int) ) ); m_smtp = 0; } SMTPwrapper::~SMTPwrapper() { disc_server(); } void SMTPwrapper::emitQCop( int queued ) { +#ifndef DESKTOP_VERSION QCopEnvelope env( "QPE/Pim", "outgoingMails(int)" ); env << queued; +#endif } QString SMTPwrapper::mailsmtpError( int errnum ) { switch ( errnum ) { case MAILSMTP_NO_ERROR: return i18n( "No error" ); case MAILSMTP_ERROR_UNEXPECTED_CODE: return i18n( "Unexpected error code" ); case MAILSMTP_ERROR_SERVICE_NOT_AVAILABLE: return i18n( "Service not available" ); case MAILSMTP_ERROR_STREAM: return i18n( "Stream error" ); case MAILSMTP_ERROR_HOSTNAME: return i18n( "gethostname() failed" ); case MAILSMTP_ERROR_NOT_IMPLEMENTED: return i18n( "Not implemented" ); case MAILSMTP_ERROR_ACTION_NOT_TAKEN: return i18n( "Error, action not taken" ); case MAILSMTP_ERROR_EXCEED_STORAGE_ALLOCATION: return i18n( "Data exceeds storage allocation" ); case MAILSMTP_ERROR_IN_PROCESSING: return i18n( "Error in processing" ); case MAILSMTP_ERROR_STARTTLS_NOT_SUPPORTED: return i18n( "Starttls not supported" ); @@ -106,49 +111,49 @@ void SMTPwrapper::storeMail(const char*mail, size_t length, const QString&box) { bool SMTPwrapper::smtpSend( mailmime *mail,bool later) { clist *rcpts = 0; char *from, *data; size_t size; from = data = 0; mailmessage * msg = 0; msg = mime_message_init(mail); mime_message_set_tmpdir(msg,getenv( "HOME" )); int r = mailmessage_fetch(msg,&data,&size); mime_message_detach_mime(msg); mailmessage_free(msg); if (r != MAIL_NO_ERROR || !data) { if (data) free(data); qDebug("Error fetching mime... "); return false; } msg = 0; if (later) { storeMail(data,size,"Outgoing"); if (data) free( data ); - Config cfg( "mail" ); + KConfig cfg( locateLocal("config", "kopiemail" ) ); cfg.setGroup( "Status" ); cfg.writeEntry( "outgoing", ++m_queuedMail ); emit queuedMails( m_queuedMail ); return true; } from = getFrom( mail ); rcpts = createRcptList( mail->mm_data.mm_message.mm_fields ); bool result = smtpSend(from,rcpts,data,size); if (data) { free(data); } if (from) { free(from); } if (rcpts) smtp_address_list_free( rcpts ); return result; } void SMTPwrapper::storeFailedMail(const char*data,unsigned int size, const char*failuremessage) { if (data) { storeMail(data,size,"Sendfailed"); } @@ -426,36 +431,36 @@ bool SMTPwrapper::flushOutbox() { return true; } } sendProgress = new progressMailSend(); sendProgress->show(); sendProgress->setMaxMails(mailsToSend.count()); while (mailsToSend.count()>0) { if (sendQueuedMail(wrap, (*mailsToSend.begin()))==0) { QMessageBox::critical(0,i18n("Error sending mail"), i18n("Error sending queued mail - breaking")); returnValue = false; break; } mailsToRemove.append((*mailsToSend.begin())); mailsToSend.remove(mailsToSend.begin()); sendProgress->setCurrentMails(mailsToRemove.count()); } if (reset_user_value) { m_SmtpAccount->setUser(oldUser); m_SmtpAccount->setPassword(oldPw); } - Config cfg( "mail" ); + KConfig cfg( locateLocal("config", "kopiemail" ) ); cfg.setGroup( "Status" ); m_queuedMail = 0; cfg.writeEntry( "outgoing", m_queuedMail ); emit queuedMails( m_queuedMail ); sendProgress->hide(); delete sendProgress; sendProgress = 0; wrap->deleteMails(mbox,mailsToRemove); delete wrap; return returnValue; } diff --git a/kmicromail/libmailwrapper/smtpwrapper.h b/kmicromail/libmailwrapper/smtpwrapper.h index ec42b56..bdca000 100644 --- a/kmicromail/libmailwrapper/smtpwrapper.h +++ b/kmicromail/libmailwrapper/smtpwrapper.h @@ -1,29 +1,29 @@ // -*- Mode: C++; -*- #ifndef SMTPwrapper_H #define SMTPwrapper_H -#include <qpe/applnk.h> +//#include <qpe/applnk.h> #include <qbitarray.h> #include <qdatetime.h> #include <libetpan/clist.h> #include "settings.h" #include "generatemail.h" #include <opie2/osmartpointer.h> class SMTPaccount; class AbstractMail; class SMTPwrapper : public Generatemail { Q_OBJECT public: SMTPwrapper(SMTPaccount * aSmtp); virtual ~SMTPwrapper(); bool sendMail(const Opie::Core::OSmartPointer<Mail>& mail,bool later=false ); bool flushOutbox(); static progressMailSend*sendProgress; diff --git a/kmicromail/libmailwrapper/storemail.h b/kmicromail/libmailwrapper/storemail.h index 4433de0..e449f57 100644 --- a/kmicromail/libmailwrapper/storemail.h +++ b/kmicromail/libmailwrapper/storemail.h @@ -1,28 +1,28 @@ #ifndef __STORE_MAIL_H #define __STORE_MAIL_H -#include <qpe/applnk.h> +//#include <qpe/applnk.h> #include "generatemail.h" class Account; class Mail; class AbstractMail; class Storemail : public Generatemail { Q_OBJECT public: Storemail(Account*aAccount,const QString&aFolder); Storemail(const QString&dir,const QString&aFolder); Storemail(const QString&aFolder); virtual ~Storemail(); int storeMail(const Opie::Core::OSmartPointer<Mail>&mail); protected: Account* m_Account; QString m_tfolder; AbstractMail*wrapper; }; diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp index c77345b..b19dbbe 100644 --- a/kmicromail/mainwindow.cpp +++ b/kmicromail/mainwindow.cpp @@ -1,36 +1,38 @@ // CHANGED 2004-08-06 Lutz Rogowski #include <qlabel.h> #include <qvbox.h> #include <qheader.h> #include <qtimer.h> #include <qlayout.h> #include <kdialog.h> #include <kiconloader.h> #include <kapplication.h> -#ifndef DESKTOP_VERSION +#ifdef DESKTOP_VERSION +#include <qapplication.h> +#else #include <qpe/qpeapplication.h> #endif #include "defines.h" #include "mainwindow.h" #include <KDGanttMinimizeSplitter.h> #include <kabc/stdaddressbook.h> MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) : QMainWindow( parent, name ) //, flags ) { setCaption( i18n( "KOpieMail/Pi" ) ); setToolBarsMovable( false ); //KABC::StdAddressBook::self(); toolBar = new QToolBar( this ); menuBar = new QPEMenuBar( toolBar ); mailMenu = new QPopupMenu( menuBar ); menuBar->insertItem( i18n( "Mail" ), mailMenu ); settingsMenu = new QPopupMenu( menuBar ); menuBar->insertItem( i18n( "Settings" ), settingsMenu ); addToolBar( toolBar ); toolBar->setHorizontalStretchable( true ); diff --git a/kmicromail/mainwindow.h b/kmicromail/mainwindow.h index 35b9c8c..f5ab69b 100644 --- a/kmicromail/mainwindow.h +++ b/kmicromail/mainwindow.h @@ -1,36 +1,37 @@ // CHANGED 2004-08-06 Lutz Rogowski #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <qmainwindow.h> #include <qlistview.h> #include <qaction.h> #include <qtoolbar.h> #ifdef DESKTOP_VERSION #include <qmenubar.h> +#define QPEMenuBar QMenuBar #else #include <qpe/qpemenubar.h> #endif #include "accountview.h" #include "statuswidget.h" #include <libmailwrapper/mailtypes.h> #include <opie2/osmartpointer.h> class RecMail; class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); virtual ~MainWindow(); public slots: virtual void slotAdjustColumns(); virtual void appMessage(const QCString &msg, const QByteArray &data); virtual void slotComposeMail(); diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index a32983c..153c7c0 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp @@ -1,45 +1,51 @@ // CHANGED 2004-09-31 Lutz Rogowski // CHANGED 2004-08-06 Lutz Rogowski #include "settingsdialog.h" #include "opiemail.h" #include "editaccounts.h" #include "composemail.h" #include "mailistviewitem.h" #include "viewmail.h" #include "selectstore.h" #include "selectsmtp.h" #include "accountitem.h" #include "koprefsdialog.h" #include "klocale.h" #include <qmessagebox.h> #include <qtimer.h> +#include <qcursor.h> +#include <qregexp.h> #include <libkdepim/externalapphandler.h> #include <libkdepim/kpimglobalprefs.h> +#ifdef DESKTOP_VERSION +#include <qapplication.h> +#else #include <qpe/qpeapplication.h> +#endif #include <libmailwrapper/smtpwrapper.h> #include <libmailwrapper/mailtypes.h> #include <libmailwrapper/abstractmail.h> /* OPIE */ //#include <qpe/resource.h> //#include <qpe/qpeapplication.h> /* QT */ //using namespace Opie::Core; OpieMail::OpieMail( QWidget *parent, const char *name ) : MainWindow( parent, name) //, WStyle_ContextHelp ) { settings = new Settings(); folderView->populate( settings->getAccounts() ); } OpieMail::~OpieMail() { if (settings) delete settings; } diff --git a/kmicromail/qpe/global.cpp b/kmicromail/qpe/global.cpp new file mode 100644 index 0000000..f4c6f60 --- a/dev/null +++ b/kmicromail/qpe/global.cpp @@ -0,0 +1,12 @@ + +#include "global.h" + +namespace Global{ + + void statusMessage(QString message) + { + + qDebug("statusMessage %s ", message.latin1()); + } +} + diff --git a/kmicromail/qpe/global.h b/kmicromail/qpe/global.h new file mode 100644 index 0000000..ecc5b1b --- a/dev/null +++ b/kmicromail/qpe/global.h @@ -0,0 +1,12 @@ +#ifndef __GLOBAL_H__ +#define __GLOBAL_H__ + +#include <qstring.h> + +namespace Global{ + + void statusMessage(QString message); + +} + +#endif diff --git a/kmicromail/qpe/qpeapplication.h b/kmicromail/qpe/qpeapplication.h new file mode 100644 index 0000000..0eadfd1 --- a/dev/null +++ b/kmicromail/qpe/qpeapplication.h @@ -0,0 +1,5 @@ + +#include <qapplication.h> +#include <qcursor.h> +#include <qregexp.h> + diff --git a/kmicromail/viewmail.cpp b/kmicromail/viewmail.cpp index 7cf5c8e..0b4c322 100644 --- a/kmicromail/viewmail.cpp +++ b/kmicromail/viewmail.cpp @@ -6,48 +6,49 @@ #include <libmailwrapper/abstractmail.h> #include <libmailwrapper/mailtypes.h> #include <kapplication.h> /* OPIE */ //#include <opie2/odebug.h> //#include <opie2/ofiledialog.h> //#include <opie2/oimagescrollview.h> #include <kfiledialog.h> #include <kdialog.h> #include <qpe/qpeapplication.h> /* QT */ #include <qtextbrowser.h> #include <qmessagebox.h> #include <qtextstream.h> #include <qaction.h> #include <qpopupmenu.h> #include <qfile.h> #include <qlayout.h> #include "koprefs.h" #include <klocale.h> +#include <kglobal.h> //using namespace Opie::Ui; //using namespace Opie::Core; AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, const QString&fsize,int num,const QValueList<int>&path) : QListViewItem(parent,after),_partNum(num) { _path=path; setText(0, mime); setText(1, desc); setText(2, file); setText(3, fsize); } AttachItem::AttachItem(QListViewItem * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, const QString&fsize,int num,const QValueList<int>&path) : QListViewItem(parent,after),_partNum(num) { _path=path; setText(0, mime); setText(1, desc); setText(2, file); setText(3, fsize); |