summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/accountview.cpp10
-rw-r--r--noncore/net/mail/accountview.h6
-rw-r--r--noncore/net/mail/composemail.cpp11
-rw-r--r--noncore/net/mail/composemail.h5
-rw-r--r--noncore/net/mail/editaccounts.h3
-rw-r--r--noncore/net/mail/mail.pro4
-rw-r--r--noncore/net/mail/mailistviewitem.h3
-rw-r--r--noncore/net/mail/mainwindow.cpp3
-rw-r--r--noncore/net/mail/opiemail.cpp2
-rw-r--r--noncore/net/mail/opiemail.h3
-rw-r--r--noncore/net/mail/viewmail.cpp6
-rw-r--r--noncore/net/mail/viewmail.h3
12 files changed, 33 insertions, 26 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp
index 9f07f56..2ce89db 100644
--- a/noncore/net/mail/accountview.cpp
+++ b/noncore/net/mail/accountview.cpp
@@ -1,15 +1,15 @@
#include <stdlib.h>
#include "accountview.h"
-#include "mailtypes.h"
+#include <libmailwrapper/mailtypes.h>
#include "defines.h"
#include "newmaildir.h"
#include <qmessagebox.h>
#include <qpopupmenu.h>
/**
* POP3 Account stuff
*/
POP3viewItem::POP3viewItem( POP3account *a, QListView *parent )
: AccountViewItem( parent )
{
account = a;
@@ -154,39 +154,39 @@ IMAPfolderItem*IMAPviewItem::findSubItem(const QString&path,IMAPfolderItem*start
}
void IMAPviewItem::refresh(QList<RecMail>&)
{
refreshFolders(false);
}
void IMAPviewItem::refreshFolders(bool force)
{
if (childCount()>0 && force==false) return;
QList<Folder> *folders = wrapper->listFolders();
- QListViewItem *child = firstChild();
+ QListViewItem *child = firstChild();
while ( child ) {
QListViewItem *tmp = child;
child = child->nextSibling();
delete tmp;
}
Folder *it;
QListViewItem*item = 0;
QListViewItem*titem = 0;
QString fname,del,search;
int pos;
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
folders->setAutoDelete(false);
-
+
for ( it = folders->first(); it; it = folders->next() ) {
if (it->getDisplayName().lower()=="inbox") {
item = new IMAPfolderItem( it, this , item );
folders->remove(it);
qDebug("inbox found");
break;
}
}
for ( it = folders->first(); it; it = folders->next() ) {
fname = it->getDisplayName();
pos = fname.findRev(it->Separator());
if (pos != -1) {
@@ -408,25 +408,25 @@ void AccountViewItem::deleteAllMail(AbstractMail*wrapper,Folder*folder)
AccountView * view = (AccountView*)listView();
if (view) view->refreshCurrent();
}
}
}
AccountView::AccountView( QWidget *parent, const char *name, WFlags flags )
: QListView( parent, name, flags )
{
connect( this, SIGNAL( selectionChanged( QListViewItem * ) ),
SLOT( refresh( QListViewItem * ) ) );
connect( this, SIGNAL( mouseButtonPressed(int, QListViewItem *,const QPoint&,int ) ),this,
- SLOT( slotHold( int, QListViewItem *,const QPoint&,int ) ) );
+ SLOT( slotHold( int, QListViewItem *,const QPoint&,int ) ) );
setSorting(0);
}
void AccountView::slotContextMenu(int id)
{
AccountViewItem *view = static_cast<AccountViewItem *>(currentItem());
if (!view) return;
view->contextMenuSelected(id);
}
void AccountView::slotHold(int button, QListViewItem * item,const QPoint&,int)
@@ -598,25 +598,25 @@ MBOXfolderItem::~MBOXfolderItem()
}
MBOXfolderItem::MBOXfolderItem( Folder *folderInit, MBOXviewItem *parent , QListViewItem*after )
: AccountViewItem( parent,after )
{
folder = folderInit;
mbox = parent;
if (folder->getDisplayName().lower() == "outgoing") {
setPixmap( 0, PIXMAP_OUTBOXFOLDER );
} else if (folder->getDisplayName().lower() == "inbox") {
setPixmap( 0, PIXMAP_INBOXFOLDER);
} else {
- setPixmap( 0, PIXMAP_MBOXFOLDER );
+ setPixmap( 0, PIXMAP_MBOXFOLDER );
}
setText( 0, folder->getDisplayName() );
}
void MBOXfolderItem::refresh(QList<RecMail>&target)
{
if (folder->may_select())
mbox->getWrapper()->listMessages( folder->getName(),target );
}
RecBody MBOXfolderItem::fetchBody(const RecMail&aMail)
{
diff --git a/noncore/net/mail/accountview.h b/noncore/net/mail/accountview.h
index 361dd86..1d2bf19 100644
--- a/noncore/net/mail/accountview.h
+++ b/noncore/net/mail/accountview.h
@@ -1,21 +1,21 @@
#ifndef ACCOUNTVIEW_H
#define ACCOUNTVIEW_H
#include <qlistview.h>
#include <qlist.h>
-#include "settings.h"
-#include "mailwrapper.h"
-#include "abstractmail.h"
+#include <libmailwrapper/settings.h>
+#include <libmailwrapper/mailwrapper.h>
+#include <libmailwrapper/abstractmail.h>
class POP3wrapper;
class RecMail;
class RecBody;
class QPopupMenu;
class AccountViewItem : public QListViewItem
{
public:
AccountViewItem( QListView *parent ) : QListViewItem( parent ) {}
AccountViewItem( QListViewItem *parent) : QListViewItem( parent) {}
diff --git a/noncore/net/mail/composemail.cpp b/noncore/net/mail/composemail.cpp
index 13c7900..5e823e8 100644
--- a/noncore/net/mail/composemail.cpp
+++ b/noncore/net/mail/composemail.cpp
@@ -1,57 +1,58 @@
#include <qt.h>
#include <opie/ofiledialog.h>
#include <qpe/resource.h>
#include <qpe/config.h>
#include <qpe/global.h>
#include <qpe/contact.h>
#include "composemail.h"
-#include "smtpwrapper.h"
+
+#include <libmailwrapper/smtpwrapper.h>
ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags )
: ComposeMailUI( parent, name, modal, flags )
{
settings = s;
QString vfilename = Global::applicationFileName("addressbook",
"businesscard.vcf");
Contact c;
if (QFile::exists(vfilename)) {
c = Contact::readVCard( vfilename )[0];
}
QStringList mails = c.emailList();
QString defmail = c.defaultEmail();
-
+
if (defmail.length()!=0) {
fromBox->insertItem(defmail);
}
QStringList::ConstIterator sit = mails.begin();
for (;sit!=mails.end();++sit) {
if ( (*sit)==defmail)
continue;
fromBox->insertItem((*sit));
}
senderNameEdit->setText(c.firstName()+" "+c.lastName());
Config cfg( "mail" );
cfg.setGroup( "Compose" );
checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) );
attList->addColumn( tr( "Name" ) );
attList->addColumn( tr( "Size" ) );
QList<Account> accounts = settings->getAccounts();
-
+
Account *it;
for ( it = accounts.first(); it; it = accounts.next() ) {
if ( it->getType().compare( "SMTP" ) == 0 ) {
SMTPaccount *smtp = static_cast<SMTPaccount *>(it);
smtpAccountBox->insertItem( smtp->getAccountName() );
smtpAccounts.append( smtp );
}
}
if ( smtpAccounts.count() > 0 ) {
fillValues( smtpAccountBox->currentItem() );
} else {
@@ -182,25 +183,25 @@ void ComposeMail::removeAttachment()
void ComposeMail::accept()
{
if ( checkBoxLater->isChecked() ) {
qDebug( "Send later" );
}
#if 0
qDebug( "Sending Mail with " +
smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() );
#endif
Mail *mail = new Mail();
-
+
SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() );
mail->setMail(fromBox->currentText());
if ( !toLine->text().isEmpty() ) {
mail->setTo( toLine->text() );
} else {
qDebug( "No Reciever spezified -> returning" );
return;
}
mail->setName(senderNameEdit->text());
mail->setCC( ccLine->text() );
mail->setBCC( bccLine->text() );
@@ -212,25 +213,25 @@ void ComposeMail::accept()
txt.append( sigMultiLine->text() );
}
qDebug(txt);
mail->setMessage( txt );
AttachViewItem *it = (AttachViewItem *) attList->firstChild();
while ( it != NULL ) {
mail->addAttachment( it->getAttachment() );
it = (AttachViewItem *) it->nextSibling();
}
SMTPwrapper wrapper( settings );
wrapper.sendMail( *mail,smtp,checkBoxLater->isChecked() );
-
+
QDialog::accept();
}
AttachViewItem::AttachViewItem( QListView *parent, Attachment *att )
: QListViewItem( parent )
{
attachment = att;
qDebug( att->getMimeType() );
setPixmap( 0, attachment->getDocLnk().pixmap().isNull() ?
Resource::loadPixmap( "UnknownDocument-14" ) :
attachment->getDocLnk().pixmap() );
setText( 0, att->getName().isEmpty() ? att->getFileName() : att->getName() );
diff --git a/noncore/net/mail/composemail.h b/noncore/net/mail/composemail.h
index 230e397..604c862 100644
--- a/noncore/net/mail/composemail.h
+++ b/noncore/net/mail/composemail.h
@@ -1,22 +1,23 @@
#ifndef COMPOSEMAIL_H
#define COMPOSEMAIL_H
#include <qlineedit.h>
#include <qlistview.h>
#include "composemailui.h"
#include "addresspickerui.h"
-#include "settings.h"
-#include "mailwrapper.h"
+#include <libmailwrapper/settings.h>
+#include <libmailwrapper/mailwrapper.h>
+
class AddressPicker : public AddressPickerUI
{
Q_OBJECT
public:
AddressPicker( QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags flags = 0 );
static QString getNames();
protected:
QString selectedNames;
diff --git a/noncore/net/mail/editaccounts.h b/noncore/net/mail/editaccounts.h
index 10ed8b8..6022eef 100644
--- a/noncore/net/mail/editaccounts.h
+++ b/noncore/net/mail/editaccounts.h
@@ -1,25 +1,26 @@
#ifndef EDITACCOUNTS_H
#define EDITACCOUNTS_H
#include <qstring.h>
#include <qlistview.h>
#include "editaccountsui.h"
#include "selectmailtypeui.h"
#include "imapconfigui.h"
#include "pop3configui.h"
#include "smtpconfigui.h"
#include "nntpconfigui.h"
-#include "settings.h"
+#include <libmailwrapper/settings.h>
+
class AccountListItem : public QListViewItem
{
public:
AccountListItem( QListView *parent, Account *a);
Account *getAccount() { return account; }
private:
Account *account;
};
diff --git a/noncore/net/mail/mail.pro b/noncore/net/mail/mail.pro
index 69e1450..a96c88e 100644
--- a/noncore/net/mail/mail.pro
+++ b/noncore/net/mail/mail.pro
@@ -33,20 +33,20 @@ INTERFACES = editaccountsui.ui \
nntpconfigui.ui \
smtpconfigui.ui \
addresspickerui.ui \
composemailui.ui \
settingsdialogui.ui \
statuswidgetui.ui \
newmaildirui.ui
INCLUDEPATH += $(OPIEDIR)/include
CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX )
contains( CONFTEST, y ){
- LIBS += -lqpe -letpan -lssl -lcrypto -lopie -liconv
+ LIBS += -lqpe -lopie -lmailwrapper -liconv
}else{
- LIBS += -lqpe -lopie -llibmailwrapper
+ LIBS += -lqpe -lopie -lmailwrapper
}
TARGET = opiemail
include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/net/mail/mailistviewitem.h b/noncore/net/mail/mailistviewitem.h
index 60bfdda..271f616 100644
--- a/noncore/net/mail/mailistviewitem.h
+++ b/noncore/net/mail/mailistviewitem.h
@@ -1,17 +1,18 @@
#ifndef __MAILLISTVIEWITEM_H
#define __MAILLISTVIEWITEM_H
#include <qlistview.h>
-#include "mailtypes.h"
+#include <libmailwrapper/mailtypes.h>
+
class MailListViewItem:public QListViewItem
{
public:
MailListViewItem(QListView * parent, MailListViewItem * after );
virtual ~MailListViewItem(){}
void storeData(const RecMail&data);
const RecMail&data()const;
void showEntry();
protected:
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp
index 6511b1f..43d02e7 100644
--- a/noncore/net/mail/mainwindow.cpp
+++ b/noncore/net/mail/mainwindow.cpp
@@ -1,27 +1,28 @@
#include <qlabel.h>
#include <qvbox.h>
#include <qheader.h>
#include <qtimer.h>
#include <qlayout.h>
#include <qmessagebox.h>
#include <qtextstream.h>
#include <qpe/qpeapplication.h>
#include <qpe/resource.h>
+
#include "defines.h"
#include "mainwindow.h"
#include "viewmail.h"
-#include "mailtypes.h"
+#include <libmailwrapper/mailtypes.h>
#include "mailistviewitem.h"
MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
: QMainWindow( parent, name, flags )
{
setCaption( tr( "Mail" ) );
setToolBarsMovable( false );
toolBar = new QToolBar( this );
menuBar = new QMenuBar( toolBar );
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp
index 54453b7..fcd48e2 100644
--- a/noncore/net/mail/opiemail.cpp
+++ b/noncore/net/mail/opiemail.cpp
@@ -1,18 +1,18 @@
#include <qmessagebox.h>
#include "settingsdialog.h"
#include "opiemail.h"
#include "editaccounts.h"
#include "composemail.h"
-#include "smtpwrapper.h"
+#include <libmailwrapper/smtpwrapper.h>
#include <qpe/qcopenvelope_qws.h>
#include <qaction.h>
#include <qapplication.h>
OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags )
: MainWindow( parent, name, flags )
{
settings = new Settings();
folderView->populate( settings->getAccounts() );
connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) );
diff --git a/noncore/net/mail/opiemail.h b/noncore/net/mail/opiemail.h
index 4e3c974..ebed5d8 100644
--- a/noncore/net/mail/opiemail.h
+++ b/noncore/net/mail/opiemail.h
@@ -1,17 +1,18 @@
#ifndef OPIEMAIL_H
#define OPIEMAIL_H
#include "mainwindow.h"
-#include "settings.h"
+#include <libmailwrapper/settings.h>
+
class OpieMail : public MainWindow
{
Q_OBJECT
public:
OpieMail( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 );
static QString appName() { return QString::fromLatin1("opiemail"); }
public slots:
virtual void slotwriteMail(const QString&name,const QString&email);
virtual void slotComposeMail();
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp
index ed77eb5..9ca6383 100644
--- a/noncore/net/mail/viewmail.cpp
+++ b/noncore/net/mail/viewmail.cpp
@@ -2,30 +2,30 @@
#include <qmessagebox.h>
#include <qtextstream.h>
#include <qaction.h>
#include <qpopupmenu.h>
#include <qfile.h>
#include <qapplication.h>
#include <qvaluelist.h>
#include <qpe/config.h>
#include <opie/ofiledialog.h>
-#include "settings.h"
+#include <libmailwrapper/settings.h>
#include "composemail.h"
#include "viewmail.h"
-#include "abstractmail.h"
+#include <libmailwrapper/abstractmail.h>
#include "accountview.h"
-#include "mailtypes.h"
+#include <libmailwrapper/mailtypes.h>
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);
}
diff --git a/noncore/net/mail/viewmail.h b/noncore/net/mail/viewmail.h
index 29681cc..2d0e024 100644
--- a/noncore/net/mail/viewmail.h
+++ b/noncore/net/mail/viewmail.h
@@ -1,22 +1,23 @@
#ifndef VIEWMAIL_H
#define VIEWMAIL_H
#include <qlistview.h>
#include <qmap.h>
#include <qstringlist.h>
#include <qvaluelist.h>
#include "viewmailbase.h"
-#include "mailtypes.h"
+#include <libmailwrapper/mailtypes.h>
+
class AttachItem : public QListViewItem
{
public:
AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file,
const QString&fsize,int num,const QValueList<int>&path);
AttachItem(QListViewItem * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file,
const QString&fsize,int num,const QValueList<int>&path);
int Partnumber() { return _partNum; }
bool isParentof(const QValueList<int>&path);
private: