author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (side-by-side diff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kmicromail | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
63 files changed, 612 insertions, 512 deletions
diff --git a/kmicromail/accountitem.cpp b/kmicromail/accountitem.cpp index 985a762..9b1ea2f 100644 --- a/kmicromail/accountitem.cpp +++ b/kmicromail/accountitem.cpp @@ -7,18 +7,20 @@ #include <libmailwrapper/mailtypes.h> #include <libmailwrapper/abstractmail.h> #include <libmailwrapper/mailwrapper.h> /* OPIE */ //#include <qpe/qpeapplication.h> /* QT */ -#include <qpopupmenu.h> +#include <q3popupmenu.h> #include <qmessagebox.h> +//Added by qt3to4: +#include <Q3ValueList> #include <kiconloader.h> #include <klocale.h> #define GET_NEW_MAILS 101 using namespace Opie::Core; #define SETPIX(x) if (!account->getOffline()) {setPixmap( 0,x);} else {setPixmap( 0, PIXMAP_OFFLINE );} /** @@ -49,51 +51,51 @@ POP3viewItem::~POP3viewItem() delete wrapper; } AbstractMail *POP3viewItem::getWrapper() { return wrapper; } -void POP3viewItem::refresh(QValueList<Opie::Core::OSmartPointer<RecMail> > & ) +void POP3viewItem::refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> > & ) { refresh(); } void POP3viewItem::refresh() { if (account->getOffline()) return; - QValueList<FolderP> *folders = wrapper->listFolders(); - QListViewItem *child = firstChild(); + Q3ValueList<FolderP> *folders = wrapper->listFolders(); + Q3ListViewItem *child = firstChild(); while ( child ) { - QListViewItem *tmp = child; + Q3ListViewItem *tmp = child; child = child->nextSibling(); delete tmp; } - QValueList<FolderP>::ConstIterator it; - QListViewItem*item = 0; + Q3ValueList<FolderP>::ConstIterator it; + Q3ListViewItem*item = 0; for ( it = folders->begin(); it!=folders->end(); ++it) { item = new POP3folderItem( (*it), this , item ); item->setSelectable( (*it)->may_select()); } delete folders; } RECBODYP POP3viewItem::fetchBody( const RecMailP &mail ) { return wrapper->fetchBody( mail ); } -QPopupMenu * POP3viewItem::getContextMenu() +Q3PopupMenu * POP3viewItem::getContextMenu() { - QPopupMenu *m = new QPopupMenu(0); + Q3PopupMenu *m = new Q3PopupMenu(0); if (m) { if (!account->getOffline()) { m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); m->insertItem(i18n("Disconnect"),0); m->insertItem(i18n("Set offline"),1); } @@ -103,20 +105,20 @@ QPopupMenu * POP3viewItem::getContextMenu() m->insertItem(i18n("Set online"),1); } } return m; } void POP3viewItem::disconnect() { - QListViewItem *child = firstChild(); + Q3ListViewItem *child = firstChild(); while ( child ) { - QListViewItem *tmp = child; + Q3ListViewItem *tmp = child; child = child->nextSibling(); delete tmp; } wrapper->logout(); } void POP3viewItem::setOnOffline() { @@ -152,45 +154,45 @@ void POP3viewItem::contextMenuSelected(int which) setOnOffline(); break; } } POP3folderItem::~POP3folderItem() {} -POP3folderItem::POP3folderItem( const FolderP&folderInit, POP3viewItem *parent , QListViewItem*after ) +POP3folderItem::POP3folderItem( const FolderP&folderInit, POP3viewItem *parent , Q3ListViewItem*after ) : AccountViewItem(folderInit,parent,after ) { pop3 = parent; if (folder->getDisplayName().lower()!="inbox") { setPixmap( 0, PIXMAP_POP3FOLDER ); } else { setPixmap( 0, PIXMAP_INBOXFOLDER); } setText( 0, folder->getDisplayName() ); } -void POP3folderItem::refresh(QValueList<RecMailP>&target) +void POP3folderItem::refresh(Q3ValueList<RecMailP>&target) { if (folder->may_select()) pop3->getWrapper()->listMessages( folder->getName(),target ); } RECBODYP POP3folderItem::fetchBody(const RecMailP&aMail) { return pop3->getWrapper()->fetchBody(aMail); } -QPopupMenu * POP3folderItem::getContextMenu() +Q3PopupMenu * POP3folderItem::getContextMenu() { - QPopupMenu *m = new QPopupMenu(0); + Q3PopupMenu *m = new Q3PopupMenu(0); if (m) { m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); m->insertItem(i18n("Refresh header list"),0); m->insertItem(i18n("Delete all mails"),1); m->insertItem(i18n("Move/Copie all mails"),2); } return m; @@ -256,52 +258,52 @@ NNTPviewItem::~NNTPviewItem() delete wrapper; } AbstractMail *NNTPviewItem::getWrapper() { return wrapper; } -void NNTPviewItem::refresh( QValueList<RecMailP> & ) +void NNTPviewItem::refresh( Q3ValueList<RecMailP> & ) { refresh(); } void NNTPviewItem::refresh() { if (account->getOffline()) return; - QValueList<FolderP> *folders = wrapper->listFolders(); + Q3ValueList<FolderP> *folders = wrapper->listFolders(); - QListViewItem *child = firstChild(); + Q3ListViewItem *child = firstChild(); while ( child ) { - QListViewItem *tmp = child; + Q3ListViewItem *tmp = child; child = child->nextSibling(); delete tmp; } - QValueList<FolderP>::ConstIterator it; - QListViewItem*item = 0; + Q3ValueList<FolderP>::ConstIterator it; + Q3ListViewItem*item = 0; for ( it = folders->begin(); it!=folders->end(); ++it) { item = new NNTPfolderItem( (*it), this , item ); item->setSelectable( (*it)->may_select()); } delete folders; } RECBODYP NNTPviewItem::fetchBody( const RecMailP &mail ) { return wrapper->fetchBody( mail ); } -QPopupMenu * NNTPviewItem::getContextMenu() +Q3PopupMenu * NNTPviewItem::getContextMenu() { - QPopupMenu *m = new QPopupMenu(0); + Q3PopupMenu *m = new Q3PopupMenu(0); if (m) { if (!account->getOffline()) { m->insertItem(i18n("Disconnect"),0); m->insertItem(i18n("Set offline"),1); //m->insertItem(i18n("(Un-)Subscribe groups"),2); } @@ -321,20 +323,20 @@ void NNTPviewItem::subscribeGroups() #endif if ( dlg.exec()== QDialog::Accepted ){ refresh(); } } void NNTPviewItem::disconnect() { - QListViewItem *child = firstChild(); + Q3ListViewItem *child = firstChild(); while ( child ) { - QListViewItem *tmp = child; + Q3ListViewItem *tmp = child; child = child->nextSibling(); delete tmp; } wrapper->logout(); } void NNTPviewItem::setOnOffline() { @@ -363,45 +365,45 @@ void NNTPviewItem::contextMenuSelected(int which) subscribeGroups(); break; } } NNTPfolderItem::~NNTPfolderItem() {} -NNTPfolderItem::NNTPfolderItem( const FolderP &folderInit, NNTPviewItem *parent , QListViewItem*after ) +NNTPfolderItem::NNTPfolderItem( const FolderP &folderInit, NNTPviewItem *parent , Q3ListViewItem*after ) : AccountViewItem( folderInit, parent,after ) { nntp = parent; if (folder->getDisplayName().lower()!="inbox") { setPixmap( 0, PIXMAP_POP3FOLDER ); } else { setPixmap( 0, PIXMAP_INBOXFOLDER); } setText( 0, folder->getDisplayName() ); } -void NNTPfolderItem::refresh(QValueList<RecMailP>&target) +void NNTPfolderItem::refresh(Q3ValueList<RecMailP>&target) { if (folder->may_select()) nntp->getWrapper()->listMessages( folder->getName(),target ); } RECBODYP NNTPfolderItem::fetchBody(const RecMailP&aMail) { return nntp->getWrapper()->fetchBody(aMail); } -QPopupMenu * NNTPfolderItem::getContextMenu() +Q3PopupMenu * NNTPfolderItem::getContextMenu() { - QPopupMenu *m = new QPopupMenu(0); + Q3PopupMenu *m = new Q3PopupMenu(0); if (m) { m->insertItem(i18n("Refresh header list"),0); m->insertItem(i18n("Copy all postings"),1); } return m; } @@ -448,38 +450,38 @@ IMAPviewItem::~IMAPviewItem() delete wrapper; } AbstractMail *IMAPviewItem::getWrapper() { return wrapper; } -void IMAPviewItem::refresh(QValueList<RecMailP>&) +void IMAPviewItem::refresh(Q3ValueList<RecMailP>&) { refreshFolders(false); } const QStringList&IMAPviewItem::subFolders() { return currentFolders; } void IMAPviewItem::refreshFolders(bool force) { if (childCount()>0 && force==false) return; if (account->getOffline()) return; removeChilds(); currentFolders.clear(); - QValueList<FolderP> * folders = wrapper->listFolders(); + Q3ValueList<FolderP> * folders = wrapper->listFolders(); - QValueList<FolderP>::Iterator it; - QListViewItem*item = 0; - QListViewItem*titem = 0; + Q3ValueList<FolderP>::Iterator it; + Q3ListViewItem*item = 0; + Q3ListViewItem*titem = 0; QString fname,del,search; int pos; for ( it = folders->begin(); it!=folders->end(); ++it) { if ((*it)->getDisplayName().lower()=="inbox") { item = new IMAPfolderItem( (*it), this , item ); @@ -508,19 +510,19 @@ void IMAPviewItem::refreshFolders(bool force) else { item = new IMAPfolderItem( (*it), this , item ); } } delete folders; } -QPopupMenu * IMAPviewItem::getContextMenu() +Q3PopupMenu * IMAPviewItem::getContextMenu() { - QPopupMenu *m = new QPopupMenu(0); + Q3PopupMenu *m = new Q3PopupMenu(0); if (m) { if (!account->getOffline()) { m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); m->insertItem(i18n("Refresh folder list"),0); m->insertItem(i18n("Create new folder"),1); m->insertSeparator(); @@ -610,32 +612,32 @@ RECBODYP IMAPviewItem::fetchBody(const RecMailP&) return new RecBody(); } bool IMAPviewItem::offline() { return account->getOffline(); } -IMAPfolderItem::IMAPfolderItem( const FolderP& folderInit, IMAPviewItem *parent , QListViewItem*after ) +IMAPfolderItem::IMAPfolderItem( const FolderP& folderInit, IMAPviewItem *parent , Q3ListViewItem*after ) : AccountViewItem( folderInit, parent , after ) { imap = parent; if (folder->getDisplayName().lower()!="inbox") { setPixmap( 0, PIXMAP_IMAPFOLDER ); } else { setPixmap( 0, PIXMAP_INBOXFOLDER); } setText( 0, folder->getDisplayName() ); } -IMAPfolderItem::IMAPfolderItem(const FolderP &folderInit, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ) +IMAPfolderItem::IMAPfolderItem(const FolderP &folderInit, IMAPfolderItem *parent , Q3ListViewItem*after, IMAPviewItem *master ) : AccountViewItem(folderInit, parent,after ) { imap = master; if (folder->getDisplayName().lower()!="inbox") { setPixmap( 0, PIXMAP_IMAPFOLDER ); } else @@ -648,36 +650,36 @@ IMAPfolderItem::IMAPfolderItem(const FolderP &folderInit, IMAPfolderItem *parent IMAPfolderItem::~IMAPfolderItem() {} const QString& IMAPfolderItem::Delemiter()const { return folder->Separator(); } -void IMAPfolderItem::refresh(QValueList<RecMailP>&target) +void IMAPfolderItem::refresh(Q3ValueList<RecMailP>&target) { if (folder->may_select()) { imap->getWrapper()->listMessages( folder->getName(),target ); } else { target.clear(); } } RECBODYP IMAPfolderItem::fetchBody(const RecMailP&aMail) { return imap->getWrapper()->fetchBody(aMail); } -QPopupMenu * IMAPfolderItem::getContextMenu() +Q3PopupMenu * IMAPfolderItem::getContextMenu() { - QPopupMenu *m = new QPopupMenu(0); + Q3PopupMenu *m = new Q3PopupMenu(0); if (m) { if (folder->may_select()) { m->insertItem(i18n("Get new messages"),GET_NEW_MAILS); m->insertItem(i18n("Refresh header list"),0); m->insertItem(i18n("Move/Copie all mails"),4); m->insertItem(i18n("Delete all mails"),1); @@ -716,17 +718,17 @@ void IMAPfolderItem::deleteFolder() i18n("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>").arg(folder->getDisplayName()), i18n("Yes"), i18n("No"),QString::null,1,1); if (yesno == 0) { if (imap->getWrapper()->deleteMbox(folder)) { - QListView*v=listView(); + Q3ListView*v=listView(); IMAPviewItem * box = imap; /* be carefull - after that this object is destroyd so don't use * any member of it after that call!!*/ imap->refreshFolders(true); if (v) { v->setSelected(box,true); } @@ -795,29 +797,29 @@ MHviewItem::~MHviewItem() delete wrapper; } AbstractMail *MHviewItem::getWrapper() { return wrapper; } -void MHviewItem::refresh( QValueList<RecMailP> & target) +void MHviewItem::refresh( Q3ValueList<RecMailP> & target) { refresh(false); getWrapper()->listMessages( "",target ); } void MHviewItem::refresh(bool force) { if (childCount()>0 && force==false) return; removeChilds(); currentFolders.clear(); - QValueList<FolderP> *folders = wrapper->listFolders(); - QValueList<FolderP>::ConstIterator it; + Q3ValueList<FolderP> *folders = wrapper->listFolders(); + Q3ValueList<FolderP>::ConstIterator it; MHfolderItem*item = 0; MHfolderItem*pmaster = 0; QString fname = ""; int pos; for ( it = folders->begin(); it!=folders->end(); ++it) { fname = (*it)->getDisplayName(); /* this folder itself */ @@ -852,19 +854,19 @@ void MHviewItem::refresh(bool force) } RECBODYP MHviewItem::fetchBody( const RecMailP &mail ) { return wrapper->fetchBody( mail ); } -QPopupMenu * MHviewItem::getContextMenu() +Q3PopupMenu * MHviewItem::getContextMenu() { - QPopupMenu *m = new QPopupMenu(0); + Q3PopupMenu *m = new Q3PopupMenu(0); if (m) { m->insertItem(i18n("Refresh folder list"),0); m->insertItem(i18n("Create new folder"),1); m->insertItem(i18n("Delete all mails"),2); m->insertItem(i18n("Move/Copie all mails"),3); } return m; @@ -915,24 +917,24 @@ void MHviewItem::contextMenuSelected(int which) default: break; } } MHfolderItem::~MHfolderItem() {} -MHfolderItem::MHfolderItem( const FolderP &folderInit, MHviewItem *parent , QListViewItem*after ) +MHfolderItem::MHfolderItem( const FolderP &folderInit, MHviewItem *parent , Q3ListViewItem*after ) : AccountViewItem(folderInit, parent,after ) { mbox = parent; initName(); } -MHfolderItem::MHfolderItem(const FolderP& folderInit, MHfolderItem *parent, QListViewItem*after, MHviewItem*master) +MHfolderItem::MHfolderItem(const FolderP& folderInit, MHfolderItem *parent, Q3ListViewItem*after, MHviewItem*master) : AccountViewItem(folderInit, parent,after ) { folder = folderInit; mbox = master; initName(); } void MHfolderItem::initName() @@ -962,17 +964,17 @@ void MHfolderItem::initName() setText( 0, bName ); } const FolderP&MHfolderItem::getFolder()const { return folder; } -void MHfolderItem::refresh(QValueList<RecMailP>&target) +void MHfolderItem::refresh(Q3ValueList<RecMailP>&target) { if (folder->may_select()) mbox->getWrapper()->listMessages( folder->getName(),target ); } RECBODYP MHfolderItem::fetchBody(const RecMailP&aMail) { return mbox->getWrapper()->fetchBody(aMail); @@ -984,32 +986,32 @@ void MHfolderItem::deleteFolder() i18n("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>").arg(folder->getDisplayName()), i18n("Yes"), i18n("No"),QString::null,1,1); if (yesno == 0) { if (mbox->getWrapper()->deleteMbox(folder)) { - QListView*v=listView(); + Q3ListView*v=listView(); MHviewItem * box = mbox; /* be carefull - after that this object is destroyd so don't use * any member of it after that call!!*/ mbox->refresh(true); if (v) { v->setSelected(box,true); } } } } -QPopupMenu * MHfolderItem::getContextMenu() +Q3PopupMenu * MHfolderItem::getContextMenu() { - QPopupMenu *m = new QPopupMenu(0); + Q3PopupMenu *m = new Q3PopupMenu(0); if (m) { m->insertItem(i18n("Move/Copie all mails"),2); m->insertItem(i18n("Delete all mails"),0); m->insertItem(i18n("Create new subfolder"),3); m->insertItem(i18n("Delete folder"),1); } return m; @@ -1026,17 +1028,17 @@ void MHfolderItem::createFolder() { Newmdirdlg ndirdlg(0,0,true); //ndirdlg.showMaximized(); if (ndirdlg.exec() ) { QString ndir = ndirdlg.Newdir(); if (mbox->getWrapper()->createMbox(ndir,folder)) { - QListView*v=listView(); + Q3ListView*v=listView(); MHviewItem * box = mbox; /* be carefull - after that this object is destroyd so don't use * any member of it after that call!!*/ mbox->refresh(true); if (v) { v->setSelected(box,true); } @@ -1073,36 +1075,36 @@ bool MHfolderItem::isDraftfolder() /** * Generic stuff */ const QString AccountViewItem::contextName="AccountViewItem"; AccountViewItem::AccountViewItem( AccountView *parent ) - : QListViewItem( parent ) + : Q3ListViewItem( parent ) { init(); m_Backlink = parent; } -AccountViewItem::AccountViewItem( QListViewItem *parent) - : QListViewItem( parent),folder(0) +AccountViewItem::AccountViewItem( Q3ListViewItem *parent) + : Q3ListViewItem( parent),folder(0) { init(); } -AccountViewItem::AccountViewItem( QListViewItem *parent , QListViewItem*after ) - :QListViewItem( parent,after ),folder(0) +AccountViewItem::AccountViewItem( Q3ListViewItem *parent , Q3ListViewItem*after ) + :Q3ListViewItem( parent,after ),folder(0) { init(); } -AccountViewItem::AccountViewItem( const Opie::Core::OSmartPointer<Folder>&folderInit,QListViewItem *parent , QListViewItem*after ) - :QListViewItem( parent,after ),folder(folderInit) +AccountViewItem::AccountViewItem( const Opie::Core::OSmartPointer<Folder>&folderInit,Q3ListViewItem *parent , Q3ListViewItem*after ) + :Q3ListViewItem( parent,after ),folder(folderInit) { init(); } void AccountViewItem::init() { m_Backlink = 0; } @@ -1135,20 +1137,20 @@ void AccountViewItem::deleteAllMail(AbstractMail*wrapper,const FolderP&folder) AccountView * view = (AccountView*)listView(); if (view) view->refreshCurrent(); } } } void AccountViewItem::removeChilds() { - QListViewItem *child = firstChild(); + Q3ListViewItem *child = firstChild(); while ( child ) { - QListViewItem *tmp = child; + Q3ListViewItem *tmp = child; child = child->nextSibling(); delete tmp; } } bool AccountViewItem::matchName(const QString&name)const { if (!folder) return false; diff --git a/kmicromail/accountitem.h b/kmicromail/accountitem.h index 4c92bfc..bbfd05f 100644 --- a/kmicromail/accountitem.h +++ b/kmicromail/accountitem.h @@ -1,44 +1,47 @@ #ifndef __ACCOUNT_ITEM #define __ACCOUNT_ITEM -#include <qlistview.h> +#include <q3listview.h> #include <qlist.h> +//Added by qt3to4: +#include <Q3ValueList> +#include <Q3PopupMenu> #include <opie2/osmartpointer.h> #include <libmailwrapper/mailwrapper.h> class POP3wrapper; class RecMail; class RecBody; -class QPopupMenu; +class Q3PopupMenu; class Selectstore; class AccountView; class POP3account; class NNTPaccount; class IMAPaccount; class AbstractMail; class Folder; #define RECBODYP Opie::Core::OSmartPointer<RecBody> -class AccountViewItem : public QListViewItem +class AccountViewItem : public Q3ListViewItem { public: AccountViewItem( AccountView *parent ); - AccountViewItem( QListViewItem *parent); - AccountViewItem( QListViewItem *parent , QListViewItem*after ); - AccountViewItem( const Opie::Core::OSmartPointer<Folder>&folderInit,QListViewItem *parent , QListViewItem*after ); + AccountViewItem( Q3ListViewItem *parent); + AccountViewItem( Q3ListViewItem *parent , Q3ListViewItem*after ); + AccountViewItem( const Opie::Core::OSmartPointer<Folder>&folderInit,Q3ListViewItem *parent , Q3ListViewItem*after ); virtual ~AccountViewItem(); - virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&)=0; + virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&)=0; virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&)=0; - virtual QPopupMenu * getContextMenu(){return 0;}; + virtual Q3PopupMenu * getContextMenu(){return 0;}; virtual void contextMenuSelected(int){} virtual AccountView*accountView(); virtual bool matchName(const QString&name)const; virtual bool isDraftfolder(); Opie::Core::OSmartPointer<Folder> getFolder() { return folder; }; protected: AccountViewItem*findSubItem(const QString&path,AccountViewItem*start=0); @@ -51,160 +54,160 @@ protected: }; class POP3viewItem : public AccountViewItem { public: POP3viewItem( POP3account *a, AccountView *parent ); virtual ~POP3viewItem(); - virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&target ); + virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&target ); virtual RECBODYP fetchBody( const Opie::Core::OSmartPointer<RecMail> &mail ); AbstractMail *getWrapper(); - virtual QPopupMenu * getContextMenu(); + virtual Q3PopupMenu * getContextMenu(); virtual void contextMenuSelected(int); protected: POP3account *account; virtual void refresh(); AbstractMail *wrapper; void disconnect(); void setOnOffline(); }; class POP3folderItem : public AccountViewItem { public: - POP3folderItem( const Opie::Core::OSmartPointer<Folder>&folder, POP3viewItem *parent , QListViewItem*after ); + POP3folderItem( const Opie::Core::OSmartPointer<Folder>&folder, POP3viewItem *parent , Q3ListViewItem*after ); virtual ~POP3folderItem(); - virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&); + virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&); virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&); - virtual QPopupMenu * getContextMenu(); + virtual Q3PopupMenu * getContextMenu(); virtual void contextMenuSelected(int); protected: void downloadMails(); POP3viewItem *pop3; }; class NNTPviewItem : public AccountViewItem { public: NNTPviewItem( NNTPaccount *a, AccountView *parent ); virtual ~NNTPviewItem(); - virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&target ); + virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&target ); virtual RECBODYP fetchBody( const Opie::Core::OSmartPointer<RecMail> &mail ); AbstractMail *getWrapper(); - virtual QPopupMenu * getContextMenu(); + virtual Q3PopupMenu * getContextMenu(); virtual void contextMenuSelected(int); protected: NNTPaccount *account; virtual void refresh(); AbstractMail *wrapper; void disconnect(); void setOnOffline(); void subscribeGroups(); }; class NNTPfolderItem : public AccountViewItem { public: - NNTPfolderItem(const Opie::Core::OSmartPointer<Folder>&folder, NNTPviewItem *parent , QListViewItem*after ); + NNTPfolderItem(const Opie::Core::OSmartPointer<Folder>&folder, NNTPviewItem *parent , Q3ListViewItem*after ); virtual ~NNTPfolderItem(); - virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&); + virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&); virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&); - virtual QPopupMenu * getContextMenu(); + virtual Q3PopupMenu * getContextMenu(); virtual void contextMenuSelected(int); protected: void downloadMails(); NNTPviewItem *nntp; }; class IMAPviewItem : public AccountViewItem { friend class IMAPfolderItem; public: IMAPviewItem( IMAPaccount *a, AccountView *parent ); virtual ~IMAPviewItem(); - virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&); + virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&); virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&); AbstractMail *getWrapper(); - virtual QPopupMenu * getContextMenu(); + virtual Q3PopupMenu * getContextMenu(); virtual void contextMenuSelected(int); const QStringList&subFolders(); virtual void refreshFolders(bool force=false); bool offline(); protected: virtual void createNewFolder(); IMAPaccount *account; AbstractMail *wrapper; QStringList currentFolders; }; class IMAPfolderItem : public AccountViewItem { public: - IMAPfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, IMAPviewItem *parent , QListViewItem*after ); - IMAPfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, IMAPfolderItem *parent , QListViewItem*after, IMAPviewItem *master ); + IMAPfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, IMAPviewItem *parent , Q3ListViewItem*after ); + IMAPfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, IMAPfolderItem *parent , Q3ListViewItem*after, IMAPviewItem *master ); virtual ~IMAPfolderItem(); - virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&); + virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&); virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&); - virtual QPopupMenu * getContextMenu(); + virtual Q3PopupMenu * getContextMenu(); virtual void contextMenuSelected(int); virtual const QString& Delemiter()const; protected: virtual void createNewFolder(); virtual void deleteFolder(); virtual void downloadMails(); IMAPviewItem *imap; }; class MHviewItem : public AccountViewItem { friend class MHfolderItem; public: MHviewItem( const QString&aMboxPath, AccountView *parent ); virtual ~MHviewItem(); - virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&target ); + virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&target ); virtual RECBODYP fetchBody( const Opie::Core::OSmartPointer<RecMail> &mail ); AbstractMail *getWrapper(); - virtual QPopupMenu * getContextMenu(); + virtual Q3PopupMenu * getContextMenu(); virtual void contextMenuSelected(int); QStringList subFolders(); virtual void refresh(bool force=false); protected: void downloadMails(); virtual void createFolder(); QString m_Path; AbstractMail *wrapper; QStringList currentFolders; }; class MHfolderItem : public AccountViewItem { public: - MHfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, MHviewItem *parent , QListViewItem*after ); - MHfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, MHfolderItem *parent, QListViewItem*after, MHviewItem*master); + MHfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, MHviewItem *parent , Q3ListViewItem*after ); + MHfolderItem( const Opie::Core::OSmartPointer<Folder>&folder, MHfolderItem *parent, Q3ListViewItem*after, MHviewItem*master); virtual ~MHfolderItem(); - virtual void refresh(QValueList<Opie::Core::OSmartPointer<RecMail> >&); + virtual void refresh(Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&); virtual RECBODYP fetchBody(const Opie::Core::OSmartPointer<RecMail>&); - virtual QPopupMenu * getContextMenu(); + virtual Q3PopupMenu * getContextMenu(); virtual void contextMenuSelected(int); virtual const Opie::Core::OSmartPointer<Folder>&getFolder()const; virtual bool isDraftfolder(); protected: void downloadMails(); virtual void createFolder(); virtual void deleteFolder(); diff --git a/kmicromail/accountview.cpp b/kmicromail/accountview.cpp index d1d4f7e..eea1f65 100644 --- a/kmicromail/accountview.cpp +++ b/kmicromail/accountview.cpp @@ -8,57 +8,59 @@ #include <libmailwrapper/mailtypes.h> #include <libmailwrapper/abstractmail.h> /* OPIE */ #include <qpe/qpeapplication.h> /* QT */ #include <qmessagebox.h> -#include <qpopupmenu.h> +#include <q3popupmenu.h> #include <qcheckbox.h> #include <qtimer.h> #include <qspinbox.h> +//Added by qt3to4: +#include <Q3ValueList> #include <klocale.h> #include <kmessagebox.h> using namespace Opie::Core; -AccountView::AccountView( QWidget *parent, const char *name, WFlags flags ) - : QListView( parent, name, flags ) +AccountView::AccountView( QWidget *parent, const char *name, Qt::WFlags flags ) + : Q3ListView( parent, name, flags ) { //connect( this, SIGNAL( selectionChanged(QListViewItem*) ), // SLOT( refresh(QListViewItem*) ) ); - connect( this, SIGNAL( clicked(QListViewItem*) ), - SLOT( refresh(QListViewItem*) ) ); - connect( this, SIGNAL( returnPressed(QListViewItem*) ), - SLOT( refresh(QListViewItem*) ) ); - connect( this, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, - SLOT( slotHold(int,QListViewItem*,const QPoint&,int) ) ); + connect( this, SIGNAL( clicked(Q3ListViewItem*) ), + SLOT( refresh(Q3ListViewItem*) ) ); + connect( this, SIGNAL( returnPressed(Q3ListViewItem*) ), + SLOT( refresh(Q3ListViewItem*) ) ); + connect( this, SIGNAL( mouseButtonPressed(int,Q3ListViewItem*,const QPoint&,int) ),this, + SLOT( slotHold(int,Q3ListViewItem*,const QPoint&,int) ) ); setSorting(0); } AccountView::~AccountView() { imapAccounts.clear(); mhAccounts.clear(); } 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) +void AccountView::slotHold(int button, Q3ListViewItem * item,const QPoint&,int) { if (button==1) {return;} if (!item) return; AccountViewItem *view = static_cast<AccountViewItem *>(item); - QPopupMenu*m = view->getContextMenu(); + Q3PopupMenu*m = view->getContextMenu(); if (!m) return; connect(m,SIGNAL(activated(int)),this,SLOT(slotContextMenu(int))); m->setFocus(); m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); delete m; } void AccountView::populate( QList<Account> list ) @@ -88,17 +90,17 @@ void AccountView::populate( QList<Account> list ) { NNTPaccount *nntp = static_cast<NNTPaccount *>(it); /* must not be hold 'cause it isn't required */ (void) new NNTPviewItem( nntp, this ); } } } -void AccountView::refresh(QListViewItem *item) +void AccountView::refresh(Q3ListViewItem *item) { if ( item ) { bool ask = true; //qDebug("text -%s- ",item->text( 0 ).latin1() ); if ( item->text( 0 ) == i18n (" Local Mailfolders") ) ask = false; else { @@ -140,17 +142,17 @@ void AccountView::refreshOutgoing() if ( bName.lower() == "outgoing" || bName.lower() == "sent" || bName.lower() == "sendfailed" ) { refreshCurrent(); // qDebug("refresh "); } } void AccountView::refreshCurrentSelected() { if ( !m_currentItem ) return; - QValueList<RecMailP> headerlist; + Q3ValueList<RecMailP> headerlist; AccountViewItem *view = static_cast<AccountViewItem *>(m_currentItem); view->refresh(headerlist); emit refreshMailview(headerlist); topLevelWidget()->setCaption( i18n ( "KOpieMail/Pi" ) ) ; } void AccountView::refreshCurrent() { @@ -161,17 +163,17 @@ void AccountView::refreshCurrent() } void AccountView::refreshAll() { } RecBodyP AccountView::fetchBody(const RecMailP&aMail) { - QListViewItem*item = selectedItem (); + Q3ListViewItem*item = selectedItem (); if (!item) return new RecBody(); AccountViewItem *view = static_cast<AccountViewItem *>(item); return view->fetchBody(aMail); } void AccountView::setupFolderselect(Selectstore*sels) { diff --git a/kmicromail/accountview.h b/kmicromail/accountview.h index 33f3479..14b0ff9 100644 --- a/kmicromail/accountview.h +++ b/kmicromail/accountview.h @@ -1,48 +1,50 @@ #ifndef ACCOUNTVIEW_H #define ACCOUNTVIEW_H -#include <qlistview.h> +#include <q3listview.h> #include <qlist.h> +//Added by qt3to4: +#include <Q3ValueList> #include <opie2/osmartpointer.h> #include <libmailwrapper/mailtypes.h> class Selectstore; class Folder; class AbstractMail; class Account; class IMAPviewItem; class MHviewItem; -class AccountView : public QListView +class AccountView : public Q3ListView { Q_OBJECT public: - AccountView( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); + AccountView( QWidget *parent = 0, const char *name = 0, Qt::WFlags flags = 0 ); virtual ~AccountView(); virtual void populate( QList<Account> list ); virtual RecBodyP fetchBody(const Opie::Core::OSmartPointer<RecMail>&aMail); virtual void downloadMails(const Opie::Core::OSmartPointer<Folder>&fromFolder,AbstractMail*fromWrapper); virtual void downloadMailsInbox(const Opie::Core::OSmartPointer<Folder>&fromFolder,AbstractMail*fromWrapper); virtual bool currentisDraft(); - QValueList<MHviewItem*> allAccounts() { return mhAccounts;} + Q3ValueList<MHviewItem*> allAccounts() { return mhAccounts;} public slots: virtual void refreshAll(); - virtual void refresh(QListViewItem *item); + virtual void refresh(Q3ListViewItem *item); virtual void refreshCurrent(); virtual void refreshCurrentSelected(); virtual void refreshOutgoing(); - virtual void slotHold(int, QListViewItem *,const QPoint&,int); + virtual void slotHold(int, Q3ListViewItem *,const QPoint&,int); virtual void slotContextMenu(int id); void setupFolderselect(Selectstore*sels); signals: - void refreshMailview(const QValueList<RecMailP>& ); + void refreshMailview(const Q3ValueList<RecMailP>& ); protected: - QListViewItem* m_currentItem; - QValueList<IMAPviewItem*> imapAccounts; - QValueList<MHviewItem*> mhAccounts; + Q3ListViewItem* m_currentItem; + Q3ValueList<IMAPviewItem*> imapAccounts; + Q3ValueList<MHviewItem*> mhAccounts; }; #endif diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp index 4bc4441..81d7b52 100644 --- a/kmicromail/composemail.cpp +++ b/kmicromail/composemail.cpp @@ -33,24 +33,24 @@ #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 <qicon.h> #include <qtimer.h> #include <qmessagebox.h> #include <qpushbutton.h> -#include <qmultilineedit.h> +#include <q3multilineedit.h> #include <qlabel.h> #include <qtabwidget.h> -#include <qlistview.h> +#include <q3listview.h> //using namespace Opie::Core; //using namespace Opie::Ui; ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, bool modal ) : ComposeMailUI( parent, name, modal ) { topLevelWidget()->setCaption( i18n("Compose mail - Click OK to send ->") ); @@ -120,33 +120,33 @@ ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, boo 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; + QIcon icon; //icon = SmallIcon("fileexport"); icon = SmallIcon("filesave"); SaveButton->setIconSet (icon ) ; if ( QApplication::desktop()->width() < 320 ) { SaveButton->setText ("") ; SaveButton->setMaximumSize ( SaveButton->sizeHint().height(),SaveButton->sizeHint().height()) ; } else 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); + message->setWordWrap (Q3MultiLineEdit::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; } @@ -529,18 +529,18 @@ void ComposeMail::reEditMail(const RecMailP¤t) subjectLine->setText( data->getSubject()); toLine->setText(data->To().join(",")); ccLine->setText(data->CC().join(",")); bccLine->setText(data->Bcc().join(",")); replyLine->setText(data->Replyto()); setCharset(body->getCharset()); } -AttachViewItem::AttachViewItem( QListView *parent, Attachment *att ) - : QListViewItem( parent ) +AttachViewItem::AttachViewItem( Q3ListView *parent, Attachment *att ) + : Q3ListViewItem( parent ) { attachment = att; if ( !attachment->getPixmap().isNull() ) setPixmap( 0,attachment->getPixmap() ); setText( 0, att->getName().isEmpty() ? att->getFileName() : att->getName() ); setText( 1, QString::number( att->getSize() ) ); } diff --git a/kmicromail/composemail.h b/kmicromail/composemail.h index 966ac3e..9aef4e1 100644 --- a/kmicromail/composemail.h +++ b/kmicromail/composemail.h @@ -1,13 +1,13 @@ #ifndef COMPOSEMAIL_H #define COMPOSEMAIL_H #include <qlineedit.h> -#include <qlistview.h> +#include <q3listview.h> #include "composemailui.h" //#include "addresspickerui.h" #include <libmailwrapper/settings.h> #include <libmailwrapper/mailwrapper.h> class RecMail; @@ -75,20 +75,20 @@ protected: Opie::Core::OSmartPointer<Mail> mMail; Settings *settings; QList<SMTPaccount> smtpAccounts; QString m_replyid; QString mEncoding; bool warnAttach; }; -class AttachViewItem : public QListViewItem +class AttachViewItem : public Q3ListViewItem { public: - AttachViewItem( QListView *parent, Attachment *att ); + AttachViewItem( Q3ListView *parent, Attachment *att ); Attachment *getAttachment() { return attachment; } private: Attachment *attachment; }; #endif diff --git a/kmicromail/editaccounts.cpp b/kmicromail/editaccounts.cpp index 2c0f2d8..f274dc3 100644 --- a/kmicromail/editaccounts.cpp +++ b/kmicromail/editaccounts.cpp @@ -11,27 +11,27 @@ #include <qcombobox.h> #include <qcheckbox.h> #include <qmessagebox.h> #include <qpushbutton.h> #include <qlineedit.h> #include <qlabel.h> #include <qtabwidget.h> -#include <qlistview.h> +#include <q3listview.h> #include <qspinbox.h> #include <klocale.h> #include <kfiledialog.h> #include <libmailwrapper/nntpwrapper.h> using namespace Opie::Core; -AccountListItem::AccountListItem( QListView *parent, Account *a) - : QListViewItem( parent ) +AccountListItem::AccountListItem( Q3ListView *parent, Account *a) + : Q3ListViewItem( parent ) { account = a; setText( 0, account->getAccountName() ); QString ttext = ""; switch (account->getType()) { case MAILLIB::A_NNTP: ttext="NNTP"; break; @@ -46,17 +46,17 @@ AccountListItem::AccountListItem( QListView *parent, Account *a) break; default: ttext = "UNKNOWN"; break; } setText( 1, ttext); } -EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) +EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, Qt::WFlags flags ) : EditAccountsUI( parent, name, modal, flags ) { settings = s; mailList->addColumn( i18n( "Account" ) ); mailList->addColumn( i18n( "Type" ) ); newsList->addColumn( i18n( "Account" ) ); @@ -303,34 +303,34 @@ void EditAccounts::accept() QDialog::accept(); } /** * SelectMailType */ -SelectMailType::SelectMailType( QString *selection, QWidget *parent, const char *name, bool modal, WFlags flags ) +SelectMailType::SelectMailType( QString *selection, QWidget *parent, const char *name, bool modal, Qt::WFlags flags ) : SelectMailTypeUI( parent, name, modal, flags ) { selected = selection; selected->replace( 0, selected->length(), typeBox->currentText() ); connect( typeBox, SIGNAL( activated(const QString&) ), SLOT( slotSelection(const QString&) ) ); } void SelectMailType::slotSelection( const QString &sel ) { selected->replace( 0, selected->length(), sel ); } /** * IMAPconfig */ -IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) +IMAPconfig::IMAPconfig( IMAPaccount *account, QWidget *parent, const char *name, bool modal, Qt::WFlags flags ) : IMAPconfigUI( parent, name, modal, flags ) { data = account; //fillValues(); connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); ComboBox1->insertItem( "Only if available", 0 ); @@ -403,17 +403,17 @@ void IMAPconfig::accept() QDialog::accept(); } /** * POP3config */ -POP3config::POP3config( POP3account *account, QWidget *parent, const char *name, bool modal, WFlags flags ) +POP3config::POP3config( POP3account *account, QWidget *parent, const char *name, bool modal, Qt::WFlags flags ) : POP3configUI( parent, name, modal, flags ) { data = account; //fillValues(); connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); ComboBox1->insertItem( "Only if available", 0 ); ComboBox1->insertItem( "Always, Negotiated", 1 ); @@ -484,26 +484,26 @@ void POP3config::accept() QDialog::accept(); } /** * SMTPconfig */ -SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) +SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, bool modal, Qt::WFlags flags ) : SMTPconfigUI( parent, name, modal, flags ) { data = account; connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); // fillValues(); - QIconSet icon; + QIcon icon; //icon = SmallIcon("fileexport"); icon = SmallIcon("fileopen"); SignaturButton->setText(""); SignaturButton->setIconSet (icon ) ; SignaturButton->setMaximumSize ( SignaturButton->sizeHint().height()+4,SignaturButton->sizeHint().height()) ; connect( SignaturButton, SIGNAL( clicked() ), this, SLOT( chooseSig() ) ); connect( ComboBox1, SIGNAL( activated(int) ), SLOT( slotConnectionToggle(int) ) ); ComboBox1->insertItem( "No secure connection, no TLS", 0 ); @@ -567,17 +567,17 @@ void SMTPconfig::accept() QDialog::accept(); } /** * NNTPconfig */ -NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, bool modal, WFlags flags ) +NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, bool modal, Qt::WFlags flags ) : NNTPconfigUI( parent, name, modal, flags ) { data = account; connect( loginBox, SIGNAL( toggled(bool) ), userLine, SLOT( setEnabled(bool) ) ); connect( loginBox, SIGNAL( toggled(bool) ), passLine, SLOT( setEnabled(bool) ) ); connect( GetNGButton, SIGNAL( clicked() ), this, SLOT( slotGetNG() ) ); connect( ShowSubcribed, SIGNAL( clicked() ), this, SLOT( slotShowSub() ) ); @@ -588,32 +588,32 @@ NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, } void NNTPconfig::slotShowSub() { save(); data->save(); ListViewGroups->clear(); for ( QStringList::Iterator it = subscribedGroups.begin(); it != subscribedGroups.end(); ++it ) { - QCheckListItem *item; - item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); + Q3CheckListItem *item; + item = new Q3CheckListItem( ListViewGroups, (*it), Q3CheckListItem::CheckBox ); item->setOn( true ); } topLevelWidget()->setCaption( i18n("%1 groups subscribed").arg( subscribedGroups.count())); } void NNTPconfig::slotShowFilter() { save(); data->save(); ListViewGroups->clear(); int count = 0; for ( QStringList::Iterator it = allGroups.begin(); it != allGroups.end(); ++it ) { - QCheckListItem *item; + Q3CheckListItem *item; if ( GroupFilter->text().isEmpty() || (*it).find( GroupFilter->text() ) >= 0 ) { - item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); + item = new Q3CheckListItem( ListViewGroups, (*it), Q3CheckListItem::CheckBox ); ++count; if ( subscribedGroups.contains( (*it) ) >= 1 ) { item->setOn( true ); } } } topLevelWidget()->setCaption( i18n("Filter found %1 groups").arg( count)); } @@ -624,18 +624,18 @@ void NNTPconfig::slotGetNG() { qApp->processEvents(); NNTPwrapper* tmp = new NNTPwrapper( data ); allGroups = tmp->listAllNewsgroups(); topLevelWidget()->setCaption( i18n("Downloaded %1 group names").arg( allGroups.count())); ListViewGroups->clear(); for ( QStringList::Iterator it = allGroups.begin(); it != allGroups.end(); ++it ) { - QCheckListItem *item; - item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); + Q3CheckListItem *item; + item = new Q3CheckListItem( ListViewGroups, (*it), Q3CheckListItem::CheckBox ); if ( subscribedGroups.contains( (*it) ) >= 1 ) { item->setOn( true ); } } delete tmp; } @@ -658,37 +658,37 @@ void NNTPconfig::fillValues() portLine->setText( data->getPort() ); sslBox->setChecked( data->getSSL() ); loginBox->setChecked( data->getLogin() ); userLine->setText( data->getUser() ); passLine->setText( data->getPassword() ); subscribedGroups = data->getGroups(); /* don't forget that - you will overwrite values if user clicks cancel! */ for ( QStringList::Iterator it = subscribedGroups.begin(); it != subscribedGroups.end(); ++it ) { - QCheckListItem *item; - item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); + Q3CheckListItem *item; + item = new Q3CheckListItem( ListViewGroups, (*it), Q3CheckListItem::CheckBox ); item->setOn( true ); } } void NNTPconfig::save() { data->setAccountName( accountLine->text() ); data->setServer( serverLine->text() ); data->setPort( portLine->text() ); data->setSSL( sslBox->isChecked() ); data->setLogin( loginBox->isChecked() ); data->setUser( userLine->text() ); data->setPassword( passLine->text() ); - QListViewItemIterator list_it( ListViewGroups ); + Q3ListViewItemIterator list_it( ListViewGroups ); for ( ; list_it.current(); ++list_it ) { - if ( ( (QCheckListItem*)list_it.current() )->isOn() ) { + if ( ( (Q3CheckListItem*)list_it.current() )->isOn() ) { if ( subscribedGroups.contains( list_it.current()->text(0) ) < 1 ) subscribedGroups.append( list_it.current()->text(0) ); } else { if ( subscribedGroups.contains( list_it.current()->text(0) ) >= 1 ) subscribedGroups.remove( list_it.current()->text(0) ); } } diff --git a/kmicromail/editaccounts.h b/kmicromail/editaccounts.h index 465780c..3d01d23 100644 --- a/kmicromail/editaccounts.h +++ b/kmicromail/editaccounts.h @@ -1,43 +1,43 @@ #ifndef EDITACCOUNTS_H #define EDITACCOUNTS_H #include <qstring.h> -#include <qlistview.h> +#include <q3listview.h> #include "editaccountsui.h" #include "selectmailtypeui.h" #include "imapconfigui.h" #include "pop3configui.h" #include "smtpconfigui.h" #include "nntpconfigui.h" #include <libetpan/clist.h> #include <libmailwrapper/settings.h> -class AccountListItem : public QListViewItem +class AccountListItem : public Q3ListViewItem { public: - AccountListItem( QListView *parent, Account *a); + AccountListItem( Q3ListView *parent, Account *a); Account *getAccount() { return account; } private: Account *account; }; class EditAccounts : public EditAccountsUI { Q_OBJECT public: - EditAccounts( Settings *s, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); + EditAccounts( Settings *s, QWidget *parent = 0, const char *name = 0, bool modal = 0, Qt::WFlags flags = 0 ); public slots: void slotNewAccount( const QString &type ); void slotEditAccount( Account *account ); void slotDeleteAccount( Account * account ); void slotAdjustColumns(); protected slots: @@ -55,32 +55,32 @@ private: }; class SelectMailType : public SelectMailTypeUI { Q_OBJECT public: - SelectMailType( QString *selection = 0, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); + SelectMailType( QString *selection = 0, QWidget *parent = 0, const char *name = 0, bool modal = 0, Qt::WFlags flags = 0 ); private slots: void slotSelection( const QString &sel ); private: QString *selected; }; class IMAPconfig : public IMAPconfigUI { Q_OBJECT public: - IMAPconfig( IMAPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); + IMAPconfig( IMAPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, Qt::WFlags flags = 0 ); public slots: void fillValues(); protected slots: void slotConnectionToggle( int index ); void accept(); @@ -89,17 +89,17 @@ private: }; class POP3config : public POP3configUI { Q_OBJECT public: - POP3config( POP3account *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); + POP3config( POP3account *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, Qt::WFlags flags = 0 ); public slots: void fillValues(); protected slots: void slotConnectionToggle( int index ); void accept(); @@ -108,17 +108,17 @@ private: }; class SMTPconfig : public SMTPconfigUI { Q_OBJECT public: - SMTPconfig( SMTPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); + SMTPconfig( SMTPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, Qt::WFlags flags = 0 ); public slots: void fillValues(); protected slots: void slotConnectionToggle( int index ); void accept(); void chooseSig(); @@ -128,17 +128,17 @@ private: }; class NNTPconfig : public NNTPconfigUI { Q_OBJECT public: - NNTPconfig( NNTPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, WFlags flags = 0 ); + NNTPconfig( NNTPaccount *account, QWidget *parent = 0, const char *name = 0, bool modal = 0, Qt::WFlags flags = 0 ); public slots: void fillValues(); protected slots: void slotSSL( bool enabled ); void accept(); void slotGetNG(); diff --git a/kmicromail/kmicromail.pro b/kmicromail/kmicromail.pro index 9f4d4bd..ce30bbf 100644 --- a/kmicromail/kmicromail.pro +++ b/kmicromail/kmicromail.pro @@ -36,32 +36,33 @@ SOURCES = main.cpp \ newmaildir.cpp \ selectstore.cpp \ selectsmtp.cpp \ nntpgroups.cpp \ koprefs.cpp\ koprefsdialog.cpp\ nntpgroupsdlg.cpp -INTERFACES = editaccountsui.ui \ +#The following line was changed from INTERFACES to FORMS3 by qt3to4 +FORMS3 = 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 += ./qpe . .. ../libkdepim ../microkde ../microkde/kdecore ../libetpan/include ../microkde/kdeui -LIBS += -L../bin -lmicromailwrapper -lmicrolibetpan -lmicrokde -lssl -lcrypto -lmicrokdepim -lmicrokabc -lpthread +LIBS += -L../bin -lmicromailwrapper -lxmicrolibetpan -lxmicrokde -lssl -lcrypto -lxmicrokdepim -lxmicrokabc -lpthread DESTDIR= ../bin TARGET = ompi DEFINES += DESKTOP_VERSION unix : { OBJECTS_DIR = obj/unix MOC_DIR = moc/unix @@ -71,8 +72,13 @@ 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 } +#The following line was inserted by qt3to4 +QT += xml qt3support +#The following line was inserted by qt3to4 +CONFIG += uic3 + diff --git a/kmicromail/kmicromailE.pro b/kmicromail/kmicromailE.pro index a5a51f7..19fa398 100644 --- a/kmicromail/kmicromailE.pro +++ b/kmicromail/kmicromailE.pro @@ -50,17 +50,17 @@ INTERFACES = editaccountsui.ui \ settingsdialogui.ui \ statuswidgetui.ui \ newmaildirui.ui \ selectstoreui.ui \ nntpgroupsui.ui INCLUDEPATH += $(QPEDIR)/include . $(KDEPIMDIR) $(KDEPIMDIR)/libkdepim $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/libetpan/include $(KDEPIMDIR)/microkde/kdeui -LIBS += -L$(QPEDIR)/lib -lmicromailwrapper -lqpe -lmicrolibetpan -lmicrokde -lmicroqtcompat -lssl -lcrypto -ljpeg -lmicrokdepim -lpthread +LIBS += -L$(QPEDIR)/lib -lmicromailwrapper -lqpe -lxmicrolibetpan -lxmicrokde -lmicroqtcompat -lssl -lcrypto -ljpeg -lxmicrokdepim -lpthread LIBS += $(QTOPIALIB) #LIBS += -lqtopia #next line for Zaurus only #LIBS += -luuid LIBS += $(GCC3EXTRALIB1) LIBS += $(GCC3EXTRALIB2) # diff --git a/kmicromail/koprefs.cpp b/kmicromail/koprefs.cpp index e4b61dc..e2eed9a 100644 --- a/kmicromail/koprefs.cpp +++ b/kmicromail/koprefs.cpp @@ -21,17 +21,17 @@ without including the source code for Qt in the source distribution. */ #include <time.h> #ifndef _WIN32_ #include <unistd.h> #endif #include <qdir.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qtextcodec.h> #include <qstring.h> #include <qregexp.h> #include <qfont.h> #include <qcolor.h> #include <qstringlist.h> #include <stdlib.h> diff --git a/kmicromail/koprefsdialog.cpp b/kmicromail/koprefsdialog.cpp index 017f1f7..e3102a4 100644 --- a/kmicromail/koprefsdialog.cpp +++ b/kmicromail/koprefsdialog.cpp @@ -18,34 +18,39 @@ As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #include <kdialog.h> #include <qlayout.h> #include <qlabel.h> -#include <qgroupbox.h> -#include <qbuttongroup.h> +#include <q3groupbox.h> +#include <q3buttongroup.h> #include <qlineedit.h> #include <qfont.h> #include <qslider.h> #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qcombobox.h> -#include <qvbox.h> -#include <qhbox.h> +#include <q3vbox.h> +#include <q3hbox.h> #include <qregexp.h> #include <qspinbox.h> #include <qdatetime.h> #include <qcheckbox.h> #include <qradiobutton.h> #include <qpushbutton.h> -#include <qstrlist.h> +#include <q3strlist.h> #include <qapplication.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3GridLayout> +#include <QPixmap> +#include <Q3Frame> #include <kcolorbutton.h> #include <kdebug.h> #include <klocale.h> #include <kglobal.h> #include <kfontdialog.h> #include <kfiledialog.h> #include <kmessagebox.h> @@ -106,19 +111,19 @@ KOPrefsDialog::~KOPrefsDialog() void KOPrefsDialog::setupGlobalTab() { } void KOPrefsDialog::setupMainTab() { - QFrame *topFrame = addPage(i18n("General"),0,0); + Q3Frame *topFrame = addPage(i18n("General"),0,0); - QGridLayout *topLayout = new QGridLayout(topFrame,6,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); mNameEdit = new QLineEdit(topFrame); mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); topLayout->addWidget(mNameLabel,0,0); topLayout->addWidget(mNameEdit,0,1); @@ -131,19 +136,19 @@ void KOPrefsDialog::setupMainTab() topLayout->addMultiCellWidget(lab,2,2,0,1); KPrefsDialogWidBool* ttt = addWidBool(i18n("Ignore above settings and\nuse KA/Pi \"Who am I\" instead!"), &(KOPrefs::instance()->mUseKapi),topFrame); topLayout->addMultiCellWidget(ttt->checkBox(),3,3,0,1); } void KOPrefsDialog::setupMailTab() { - QFrame *topFrame = addPage(i18n("Mail"),0,0); + Q3Frame *topFrame = addPage(i18n("Mail"),0,0); - QGridLayout *topLayout = new QGridLayout(topFrame,4,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,4,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); KPrefsDialogWidBool* ttt = addWidBool(i18n("View mail as html"), &(KOPrefs::instance()->mViewAsHtml),topFrame); topLayout->addMultiCellWidget(ttt->checkBox(),0,0,0,1); @@ -177,20 +182,20 @@ void KOPrefsDialog::setupMailTab() topLayout->addMultiCellWidget( new QLabel(mCodecEdit, i18n("User defined codec for new mails:"), topFrame),2,2,0,1); topLayout->addMultiCellWidget(mCodecEdit,3,3,0,1); topLayout->addMultiCellWidget( new QLabel(0, i18n("Example: iso-8859-15"), topFrame),4,4,0,1); */ } void KOPrefsDialog::setupFontsTab() { - QFrame *topFrame = addPage(i18n("Fonts"),0,0); + Q3Frame *topFrame = addPage(i18n("Fonts"),0,0); // DesktopIcon("fonts",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,7,3); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,7,3); topLayout->setSpacing(1); topLayout->setMargin(3); KPrefsDialogWidFont * tVFont; int i = 0; KPrefsDialogWidFont *timeLabelsFont = addWidFont(i18n("OK"),i18n("Application(nr)"), &(KOPrefs::instance()->mAppFont),topFrame); topLayout->addWidget(timeLabelsFont->label(),i,0); @@ -233,18 +238,18 @@ void KOPrefsDialog::usrWriteConfig() //KOPrefs::instance()->mSendCodec = mCodecEdit->text(); } #if 0 void KOPrefsDialog::setupLocaleDateTab() { -QFrame *topFrame = addPage(i18n("Date Format"),0,0); - QGridLayout *topLayout = new QGridLayout(topFrame,3,2); +Q3Frame *topFrame = addPage(i18n("Date Format"),0,0); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,3,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); int iii = 0; KPrefsWidRadios *syncPrefsGroup = addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); QString format; @@ -287,18 +292,18 @@ QFrame *topFrame = addPage(i18n("Date Format"),0,0); lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); topLayout->addMultiCellWidget(lab ,iii,iii,0,1); ++iii; } void KOPrefsDialog::setupLocaleTab() { - QFrame *topFrame = addPage(i18n("Locale"),0,0); - QGridLayout *topLayout = new QGridLayout(topFrame,4,2); + Q3Frame *topFrame = addPage(i18n("Locale"),0,0); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,4,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); int iii = 0; KPrefsWidRadios *syncPrefsGroup = addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); syncPrefsGroup->addRadio(i18n("English")); syncPrefsGroup->addRadio(i18n("German")); syncPrefsGroup->addRadio(i18n("French")); @@ -326,17 +331,17 @@ void KOPrefsDialog::setupLocaleTab() ++iii; sb = addWidBool(i18n("Use short date in (WN/E) view"), &(KOPrefs::instance()->mShortDateInViewer),topFrame); topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); } else { QWidget * hb = new QWidget( topFrame ); - QHBoxLayout *hbLayout = new QHBoxLayout(hb); + Q3HBoxLayout *hbLayout = new Q3HBoxLayout(hb); sb = addWidBool(i18n("Week starts on Sunday"), &(KOPrefs::instance()->mWeekStartsOnSunday),hb); hbLayout->addWidget(sb->checkBox() ); sb = addWidBool(i18n("Use short date in (WN/E) view"), &(KOPrefs::instance()->mShortDateInViewer),hb); hbLayout->addWidget(sb->checkBox() ); @@ -356,19 +361,19 @@ void KOPrefsDialog::showSyncPage() { showPage ( 2 ) ; } void KOPrefsDialog::setupSyncAlgTab() { #if 0 QLabel * lab; - QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); + Q3Frame *topFrame = addPage(i18n("Sync Prefs"),0,0); mSetupSyncAlgTab = topFrame; - QGridLayout *topLayout = new QGridLayout(topFrame,6,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); int iii = 0; KPrefsDialogWidBool *sb = addWidBool(i18n("Ask for preferences before syncing"), &(KOPrefs::instance()->mAskForPreferences),topFrame); topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); @@ -398,18 +403,18 @@ void KOPrefsDialog::setupSyncAlgTab() } void KOPrefsDialog::setupSyncTab() { #if 0 QLabel * lab; - QFrame *topFrame = addPage(i18n("Sync Network"),0,0); - QGridLayout *topLayout = new QGridLayout(topFrame,6,2); + Q3Frame *topFrame = addPage(i18n("Sync Network"),0,0); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame); int iii = 0; topLayout->addMultiCellWidget(lab , iii,iii,0,1); ++iii; mRemoteIPEdit = new QLineEdit(topFrame); @@ -446,20 +451,20 @@ void KOPrefsDialog::setupSyncTab() topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); ++iii; #endif } void KOPrefsDialog::setupMainTab() { - QFrame *topFrame = addPage(i18n("General"),0,0); + Q3Frame *topFrame = addPage(i18n("General"),0,0); // DesktopIcon("identity",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,6,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); // KPrefsDialogWidBool *emailControlCenter = // addWidBool(i18n("&Use email settings from Control Center"), // &(KOPrefs::instance()->mEmailControlCenter),topFrame); // topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), @@ -470,47 +475,47 @@ void KOPrefsDialog::setupMainTab() topLayout->addWidget(mNameLabel,0,0); topLayout->addWidget(mNameEdit,0,1); mEmailEdit = new QLineEdit(topFrame); mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); topLayout->addWidget(mEmailLabel,1,0); topLayout->addWidget(mEmailEdit,1,1); KPrefsDialogWidBool *wb; - QHBox *dummy; + Q3HBox *dummy; if ( QApplication::desktop()->width() > 480 ) { - dummy = new QHBox(topFrame); + dummy = new Q3HBox(topFrame); } else { - dummy = new QVBox(topFrame); + dummy = new Q3VBox(topFrame); } topLayout->addMultiCellWidget(dummy, 2,2,0,1); addWidBool(i18n("Full menu bar(nr)"), &(KOPrefs::instance()->mShowFullMenu),dummy); addWidBool(i18n("Mini icons in toolbar(nr)"), &(KOPrefs::instance()->mToolBarMiniIcons),dummy); - dummy = new QHBox(topFrame); + dummy = new Q3HBox(topFrame); new QLabel(i18n("Days in What's Next:"),dummy); mWhatsNextSpin = new QSpinBox(1,14,1,dummy); topLayout->addMultiCellWidget(dummy,3,3,0,1); - dummy = new QHBox(topFrame); + dummy = new Q3HBox(topFrame); new QLabel(i18n("Days in Next-X-Days:"),dummy); mNextXDaysSpin = new QSpinBox(2,14,1,dummy); topLayout->addMultiCellWidget(dummy,4,4,0,1); - QHBox *prioBox = new QHBox(topFrame); + Q3HBox *prioBox = new Q3HBox(topFrame); // intervalBox->setSpacing(spacingHint()); topLayout->addMultiCellWidget(prioBox,5,5,0,1); QString messa = i18n("Show topmost todo prios in What's Next:"); if ( QApplication::desktop()->width() < 300 ) messa = i18n("Show topmost todo prios in What's N.:"); QLabel *prioLabel = new QLabel(messa, prioBox); mPrioSpin = new QSpinBox(0,5,1,prioBox); @@ -524,17 +529,17 @@ void KOPrefsDialog::setupMainTab() // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); // addWidBool(i18n("Enable automatic saving of calendar"), // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); - QHBox *intervalBox = new QHBox(topFrame); + Q3HBox *intervalBox = new Q3HBox(topFrame); // intervalBox->setSpacing(spacingHint()); topLayout->addMultiCellWidget(intervalBox,6,6,0,1); QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); /* QHBox * agendasize = new QHBox ( topFrame ); @@ -615,24 +620,24 @@ void KOPrefsDialog::setupMainTab() topLayout->setRowStretch(14,1); */ } void KOPrefsDialog::setupTimeTab() { - QFrame *topFrame = addPage(i18n("Time"),0,0); + Q3Frame *topFrame = addPage(i18n("Time"),0,0); // DesktopIcon("clock",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,4,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,4,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); - QHBox *dummy = new QHBox(topFrame); + Q3HBox *dummy = new Q3HBox(topFrame); KPrefsWidTime *dayBegins = addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), dummy); //topLayout->addWidget(dayBegins->label(),2,0); //topLayout->addWidget(dayBegins->spinBox(),2,1); topLayout->addMultiCellWidget(dummy,0,0,0,1); @@ -653,32 +658,32 @@ void KOPrefsDialog::setupTimeTab() << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), 3,0); mAlarmTimeCombo = new QComboBox(topFrame); mAlarmTimeCombo->insertStringList(alarmList); topLayout->addWidget(mAlarmTimeCombo,3,1); - QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, + Q3GroupBox *workingHoursGroup = new Q3GroupBox(1,Qt::Horizontal, i18n("Working Hours"), topFrame); topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); workingHoursGroup->layout()->setSpacing( 0 ); workingHoursGroup->layout()->setMargin( 4 ); - QHBox *workStartBox = new QHBox(workingHoursGroup); + Q3HBox *workStartBox = new Q3HBox(workingHoursGroup); // workStartBox->setMargin( 0 ); addWidTime(i18n("Daily starting hour:"), &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); - QHBox *workEndBox = new QHBox(workingHoursGroup); + Q3HBox *workEndBox = new Q3HBox(workingHoursGroup); //workEndBox->setMargin( 0 ); addWidTime(i18n("Daily ending hour:"), &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); - QVBox *excludeBox = new QVBox(workingHoursGroup); + Q3VBox *excludeBox = new Q3VBox(workingHoursGroup); //excludeBox->setMargin( 0 ); addWidBool(i18n("Exclude holidays"), &(KOPrefs::instance()->mExcludeHolidays),excludeBox); addWidBool(i18n("Exclude Saturdays"), &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); // KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), @@ -688,20 +693,20 @@ void KOPrefsDialog::setupTimeTab() // topLayout->setRowStretch(6,1); } void KOPrefsDialog::setupViewsTab() { - QFrame *topFrame = addPage(i18n("Views"),0,0); + Q3Frame *topFrame = addPage(i18n("Views"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,6,1); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,1); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); // QBoxLayout *dayBeginsLayout = new QHBoxLayout; // topLayout->addLayout(dayBeginsLayout,0,0); // KPrefsWidTime *dayBegins = // addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), @@ -780,17 +785,17 @@ void KOPrefsDialog::setupViewsTab() topFrame = addPage(i18n("ViewChange"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,6,1); + topLayout = new Q3GridLayout(topFrame,6,1); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); ii = 0; dummy = addWidBool(i18n("Hold fullscreen on view change"), &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); @@ -833,22 +838,22 @@ void KOPrefsDialog::setupViewsTab() topFrame = addPage(i18n("Month View"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,5,1); + topLayout = new Q3GridLayout(topFrame,5,1); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); ii = 0; QLabel *lab; - QHBox *habo = new QHBox( topFrame ); + Q3HBox *habo = new Q3HBox( topFrame ); if ( QApplication::desktop()->width() < 320 ) { lab = new QLabel ( i18n("Show events that recur "), topFrame ); topLayout->addMultiCellWidget(lab,ii, ii,0,1); ii++; } else { new QLabel ( i18n("Show events that recur "), habo ); @@ -860,17 +865,17 @@ void KOPrefsDialog::setupViewsTab() weeklyRecur = addWidBool(i18n("weekly"), &(KOPrefs::instance()->mMonthWeeklyRecur),habo); topLayout->addMultiCellWidget(habo,ii, ii,0,1); ii++; - habo = new QHBox( topFrame ); + habo = new Q3HBox( topFrame ); if ( QApplication::desktop()->width() < 320 ) { lab = new QLabel (i18n("Show in every cell ") , topFrame ); topLayout->addMultiCellWidget(lab,ii, ii,0,1); ii++; } else { new QLabel ( i18n("Show in every cell "), habo ); } @@ -928,17 +933,17 @@ void KOPrefsDialog::setupViewsTab() topLayout->addWidget(holidayColor->label(),ii,0); topLayout->addWidget(holidayColor->button(),ii++,1); // *********************** Todo View topFrame = addPage(i18n("Todo View"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,4,1); + topLayout = new Q3GridLayout(topFrame,4,1); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); ii = 0; KPrefsDialogWidBool *showCompletedTodo = addWidBool(i18n("To-do view shows completed Todos"), &(KOPrefs::instance()->mShowCompletedTodo),topFrame); topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); @@ -960,25 +965,25 @@ void KOPrefsDialog::setupViewsTab() topLayout->addWidget(dummy->checkBox(),ii++,0); QWidget* wid = new QWidget( topFrame ); // Todo due today color KPrefsWidColor *todoDueTodayColor = addWidColor(i18n("Todo due today color:"), &(KOPrefs::instance()->mTodoDueTodayColor),wid); - QHBoxLayout *widLayout = new QHBoxLayout(wid); + Q3HBoxLayout *widLayout = new Q3HBoxLayout(wid); widLayout->addWidget( todoDueTodayColor->label() ); widLayout->addWidget( todoDueTodayColor->button() ); topLayout->addWidget(wid,ii++,0); //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); // Todo overdue color wid = new QWidget( topFrame ); - widLayout = new QHBoxLayout(wid); + widLayout = new Q3HBoxLayout(wid); KPrefsWidColor *todoOverdueColor = addWidColor(i18n("Todo overdue color:"), &(KOPrefs::instance()->mTodoOverdueColor),wid); widLayout->addWidget(todoOverdueColor->label()); widLayout->addWidget(todoOverdueColor->button()); topLayout->addWidget(wid,ii++,0); dummy = @@ -992,62 +997,62 @@ void KOPrefsDialog::setupViewsTab() topLayout->addWidget(dummy->checkBox(),ii++,0); topFrame = addPage(i18n("Alarm"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,2,1); + topLayout = new Q3GridLayout(topFrame,2,1); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); int iii = 0; dummy = addWidBool(i18n("Use internal alarm notification"), &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); topLayout->addWidget(dummy->checkBox(),iii++,0); lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); topLayout->addWidget(lab ,iii++,0); #ifndef DESKTOP_VERSION - lab->setAlignment( AlignLeft|WordBreak|AlignTop); + lab->setAlignment( Qt::AlignLeft|Qt::TextWordWrap|Qt::AlignTop); #else - lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); + lab->setAlignment( Qt::AlignLeft|Qt::TextWrapAnywhere|Qt::TextWordWrap|Qt::AlignTop); lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); #endif - QHBox* dummyBox = new QHBox(topFrame); + Q3HBox* dummyBox = new Q3HBox(topFrame); new QLabel(i18n("Play beeps count:"),dummyBox); mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); topLayout->addWidget(dummyBox,iii++,0); - dummyBox = new QHBox(topFrame); + dummyBox = new Q3HBox(topFrame); new QLabel(i18n("Beeps interval in sec:"),dummyBox); mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); topLayout->addWidget(dummyBox,iii++,0); - dummyBox = new QHBox(topFrame); + dummyBox = new Q3HBox(topFrame); new QLabel(i18n("Default suspend time in min:"),dummyBox); mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); topLayout->addWidget(dummyBox,iii++,0); - dummyBox = new QHBox(topFrame); + dummyBox = new Q3HBox(topFrame); new QLabel(i18n("Auto suspend count:"),dummyBox); mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); topLayout->addWidget(dummyBox,iii++,0); - QHBox* hbo = new QHBox ( topFrame ); + Q3HBox* hbo = new Q3HBox ( topFrame ); mDefaultAlarmFile = new QLineEdit(hbo); QPushButton * loadTemplate = new QPushButton(hbo); QPixmap icon; if ( QApplication::desktop()->width() < 321 ) icon = SmallIcon("fileimport16"); else icon = SmallIcon("fileimport"); loadTemplate->setIconSet (icon ) ; @@ -1077,20 +1082,20 @@ void KOPrefsDialog::selectSoundFile() QString fileName = mDefaultAlarmFile->text(); fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this ); if ( fileName.length() > 0 ) mDefaultAlarmFile->setText( fileName ); } void KOPrefsDialog::setupFontsTab() { - QFrame *topFrame = addPage(i18n("Fonts"),0,0); + Q3Frame *topFrame = addPage(i18n("Fonts"),0,0); // DesktopIcon("fonts",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,7,3); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,7,3); topLayout->setSpacing(1); topLayout->setMargin(3); KPrefsDialogWidFont * tVFont; int i = 0; KPrefsDialogWidFont *timeLabelsFont = addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), &(KOPrefs::instance()->mDateNavigatorFont),topFrame); topLayout->addWidget(timeLabelsFont->label(),i,0); @@ -1147,17 +1152,17 @@ void KOPrefsDialog::setupFontsTab() topLayout->setColStretch(1,1); topLayout->setRowStretch(4,1); i = 0; topFrame = addPage(i18n("View Fonts"),0, DesktopIcon("fonts",KIcon::SizeMedium)); - topLayout = new QGridLayout(topFrame,7,3); + topLayout = new Q3GridLayout(topFrame,7,3); topLayout->setSpacing(1); topLayout->setMargin(3); tVFont = addWidFont(i18n("Configure KO"),i18n("What's Next View:"), &(KOPrefs::instance()->mWhatsNextFont),topFrame); topLayout->addWidget(tVFont->label(),i,0); topLayout->addWidget(tVFont->preview(),i,1); @@ -1215,30 +1220,30 @@ void KOPrefsDialog::setupFontsTab() } void KOPrefsDialog::setupColorsTab() { - QFrame *topFrame = addPage(i18n("Colors"),0,0); + Q3Frame *topFrame = addPage(i18n("Colors"),0,0); // DesktopIcon("colorize",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,5,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,5,2); // topLayout->setSpacing(spacingHint()); // topLayout->setMargin(marginHint()); topLayout->setSpacing(2); topLayout->setMargin(3); int ii = 1; - QGroupBox *categoryGroup ; + Q3GroupBox *categoryGroup ; - categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"), + categoryGroup = new Q3GroupBox(1,Qt::Vertical,i18n("Categories"), topFrame); topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); mCategoryCombo = new QComboBox(categoryGroup); mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor())); mCategoryButton = new KColorButton(categoryGroup); @@ -1321,30 +1326,30 @@ void KOPrefsDialog::updateCategoryColor() } } void KOPrefsDialog::setupPrinterTab() { mPrinterTab = addPage(i18n("Printing"),0, DesktopIcon("fileprint",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2); + Q3GridLayout *topLayout = new Q3GridLayout(mPrinterTab,5,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); topLayout->setRowStretch(4,1); } void KOPrefsDialog::setupGroupSchedulingTab() { #if 0 - QFrame *topFrame = addPage(i18n("Group Scheduling"),0, + Q3Frame *topFrame = addPage(i18n("Group Scheduling"),0, DesktopIcon("personal",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,6,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,6,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); #if 0 KPrefsWidRadios *schedulerGroup = addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler), topFrame); schedulerGroup->addRadio("Dummy"); // Only for debugging @@ -1357,17 +1362,17 @@ void KOPrefsDialog::setupGroupSchedulingTab() addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend), topFrame); sendGroup->addRadio(i18n("Send to outbox")); sendGroup->addRadio(i18n("Send directly")); topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); - mAMails = new QListView(topFrame); + mAMails = new Q3ListView(topFrame); mAMails->addColumn(i18n("Email"),300); topLayout->addMultiCellWidget(mAMails,3,3,0,1); topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0); aEmailsEdit = new QLineEdit(topFrame); aEmailsEdit->setEnabled(false); topLayout->addWidget(aEmailsEdit,4,1); @@ -1375,27 +1380,27 @@ void KOPrefsDialog::setupGroupSchedulingTab() topLayout->addWidget(add,5,0); QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove"); topLayout->addWidget(del,5,1); //topLayout->setRowStretch(2,1); connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); - connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); + connect(mAMails,SIGNAL(selectionChanged(Q3ListViewItem *)),SLOT(updateInput())); #endif } void KOPrefsDialog::setupGroupAutomationTab() { return; - QFrame *topFrame = addPage(i18n("Group Automation"),0, + Q3Frame *topFrame = addPage(i18n("Group Automation"),0, DesktopIcon("personal",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,5,1); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,5,1); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); KPrefsWidRadios *autoRefreshGroup = addWidRadios(i18n("Auto Send Refresh"), &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame); autoRefreshGroup->addRadio(i18n("Never")); autoRefreshGroup->addRadio(i18n("If attendee is in addressbook")); @@ -1538,17 +1543,17 @@ void KOPrefsDialog::usrWriteConfig() // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value(); KOPrefs::instance()->mStartTime = mStartTimeSpin->value(); KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value(); KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem(); //KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value(); - QDictIterator<QColor> it(mCategoryDict); + Q3DictIterator<QColor> it(mCategoryDict); while (it.current()) { KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); ++it; } KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value(); KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value(); KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value(); @@ -1678,24 +1683,24 @@ void KOPrefsDialog::updateTimezoneOffset( int index ) mTimezoneOffsetSpin->setValue( 0 ); } } */ } void KOPrefsDialog::setupTimeZoneTab() { - QFrame *topFrame = addPage(i18n("Time Zone"),0,0); + Q3Frame *topFrame = addPage(i18n("Time Zone"),0,0); // DesktopIcon("clock",KIcon::SizeMedium)); - QGridLayout *topLayout = new QGridLayout(topFrame,5,2); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,5,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); - QHBox *timeZoneBox = new QHBox( topFrame ); + Q3HBox *timeZoneBox = new Q3HBox( topFrame ); topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); new QLabel( i18n("Timezone:"), timeZoneBox ); mTimeZoneCombo = new QComboBox( timeZoneBox ); if ( QApplication::desktop()->width() < 300 ) { mTimeZoneCombo->setMaximumWidth(150); } diff --git a/kmicromail/koprefsdialog.h b/kmicromail/koprefsdialog.h index 7fa9261..042af3f 100644 --- a/kmicromail/koprefsdialog.h +++ b/kmicromail/koprefsdialog.h @@ -18,20 +18,22 @@ As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #ifndef _KOPREFSDIALOG_H #define _KOPREFSDIALOG_H -#include <qframe.h> -#include <qdict.h> +#include <q3frame.h> +#include <q3dict.h> #include <qcolor.h> -#include <qlistview.h> +#include <q3listview.h> +//Added by qt3to4: +#include <QLabel> #include <kdialogbase.h> #include <libkdepim/kprefsdialog.h> #include <libkdepim/kdateedit.h> #include <kcmconfigs/kdepimconfigwidget.h> class KColorButton; @@ -114,17 +116,17 @@ protected: void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0); private: KPrefsWidBool *mEnableGroupScheduling; KPrefsWidBool *mEnableProjectView; - QFrame *mPrinterTab; + Q3Frame *mPrinterTab; QLineEdit *nameEdit; QLineEdit *emailEdit; QComboBox *timeCombo; QComboBox *tzCombo; // widgets holding preferences data @@ -141,17 +143,17 @@ protected: QComboBox *mTimeZoneCombo; QStringList tzonenames; QSpinBox *mStartTimeSpin; QSpinBox *mDefaultDurationSpin; QComboBox *mAlarmTimeCombo; QComboBox *mCategoryCombo; KColorButton *mCategoryButton; - QDict<QColor> mCategoryDict; + Q3Dict<QColor> mCategoryDict; QSlider *mHourSizeSlider; QSpinBox *mNextXDaysSpin; QSpinBox *mWhatsNextSpin; QLineEdit * mRemoteIPEdit; QLineEdit * mRemoteUser; diff --git a/kmicromail/libetpan/libetpan.pro b/kmicromail/libetpan/libetpan.pro index dfafa07..4b2654e 100644 --- a/kmicromail/libetpan/libetpan.pro +++ b/kmicromail/libetpan/libetpan.pro @@ -1,14 +1,14 @@ ###################################################################### # Automatically generated by qmake (1.07a) Thu Jul 1 00:54:03 2004 ###################################################################### TEMPLATE = lib -TARGET = microlibetpan +TARGET = xmicrolibetpan OBJECTS_DIR = obj MOC_DIR = moc DESTDIR=../../bin DEPENDPATH += generic \ imap \ imf \ diff --git a/kmicromail/libetpan/libetpanE.pro b/kmicromail/libetpan/libetpanE.pro index 7f37948..ea22692 100644 --- a/kmicromail/libetpan/libetpanE.pro +++ b/kmicromail/libetpan/libetpanE.pro @@ -1,14 +1,14 @@ ###################################################################### # Automatically generated by qmake (1.07a) Thu Jul 1 00:54:03 2004 ###################################################################### TEMPLATE = lib -TARGET = microlibetpan +TARGET = xmicrolibetpan OBJECTS_DIR = obj/$(PLATFORM) MOC_DIR = moc/$(PLATFORM) DESTDIR=$(QPEDIR)/lib DEPENDPATH += generic \ imap \ imf \ diff --git a/kmicromail/libmailwrapper/abstractmail.cpp b/kmicromail/libmailwrapper/abstractmail.cpp index 870985e..746d2ae 100644 --- a/kmicromail/libmailwrapper/abstractmail.cpp +++ b/kmicromail/libmailwrapper/abstractmail.cpp @@ -3,23 +3,25 @@ #include "imapwrapper.h" #include "pop3wrapper.h" #include "nntpwrapper.h" #include "mhwrapper.h" #include "mailtypes.h" #include <qpe/global.h> -#include <qprogressbar.h> +#include <q3progressbar.h> #include <qapplication.h> #include <qmessagebox.h> +//Added by qt3to4: +#include <Q3ValueList> #include <klocale.h> #include <kdecore/kstandarddirs.h> #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <stdlib.h> #include <libetpan/mailmime_content.h> #include <libetpan/mailmime.h> using namespace Opie::Core; AbstractMail* AbstractMail::getWrapper(IMAPaccount *a) { return new IMAPwrapper(a); @@ -106,20 +108,20 @@ QString AbstractMail::convert_String(const char*text) if (res) free(res); return result; } /* cp & paste from launcher */ QString AbstractMail::gen_attachment_id() { QFile file( "/proc/sys/kernel/random/uuid" ); - if (!file.open(IO_ReadOnly ) ) + if (!file.open(QIODevice::ReadOnly ) ) return QString::null; - QTextStream stream(&file); + Q3TextStream stream(&file); return "{" + stream.read().stripWhiteSpace() + "}"; } int AbstractMail::createMbox(const QString&,const FolderP&,const QString& ,bool) { return 0; } @@ -133,26 +135,26 @@ QString AbstractMail::defaultLocalfolder() } QString AbstractMail::draftFolder() { return QString("Drafts"); } /* temporary - will be removed when implemented in all classes */ -void AbstractMail::deleteMails(const QString &,const QValueList<Opie::Core::OSmartPointer<RecMail> > &) +void AbstractMail::deleteMails(const QString &,const Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &) { } -void AbstractMail::deleteMailList(const QValueList<RecMailP>&target) +void AbstractMail::deleteMailList(const Q3ValueList<RecMailP>&target) { //qDebug("AbstractMail::deleteMailList:: Please reimplement! "); // this is currently re-implemented in pop3wrapper and imapwrapper int iii = 0; int count = target.count(); - QProgressBar wid ( count ); + Q3ProgressBar wid ( count ); wid.setCaption( i18n("Deleting ...")); wid.show(); while (iii < count ) { Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count)); wid.setProgress( iii ); wid.raise(); qApp->processEvents(); RecMailP mail = (*target.at( iii )); @@ -172,30 +174,30 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe lfName = acc->getAccountName(); // create local folder if ( !targetMail->createMbox(lfName)) { QMessageBox::critical(0,i18n("Error creating new Folder"), i18n("Error while creating new folder\n%1\n\nCancelling action.").arg(lfName)); return; } - QValueList<RecMailP> t; + Q3ValueList<RecMailP> t; listMessages(fromFolder->getName(),t,acc->getMaxMailSize() ); if ( t.count() == 0 ) { qDebug("There are no new messages %s", fromFolder->getName().latin1()); Global::statusMessage(i18n("There are no new messages")); return; } Global::statusMessage(i18n("%1 :Downloading mails..."). arg(acc->getAccountName())); qDebug(i18n("%1 :Downloading mails..."). arg(acc->getAccountName())); qApp->processEvents(); - QValueList<RecMailP> e; + Q3ValueList<RecMailP> e; targetMail->listMessages(lfName,e,acc->getMaxMailSize() ); //qDebug("target has mails %d ", e.count()); - QValueList<RecMailP> n; + Q3ValueList<RecMailP> n; int iii = 0; int count = t.count(); while (iii < count ) { RecMailP r = (*t.at( iii )); bool found = false; int jjj = 0; int countE = e.count(); while (jjj < countE ) { @@ -216,42 +218,42 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe if ( n.count() == 0 ) { Global::statusMessage(i18n("There are no new messages")); return; } mvcpMailList( n,lfName,targetMail,!acc->getLeaveOnServer()); Global::statusMessage(i18n("Downloaded %1 messages").arg(n.count())); #if 0 - QValueList<RecMailP> t; + Q3ValueList<RecMailP> t; listMessages(fromFolder->getName(),t, maxSizeInKb); mvcpMailList( t,targetFolder,targetWrapper,moveit); #endif } void AbstractMail::mvcpAllMails(const FolderP&fromFolder, const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb) { - QValueList<RecMailP> t; + Q3ValueList<RecMailP> t; listMessages(fromFolder->getName(),t, maxSizeInKb); mvcpMailList( t,targetFolder,targetWrapper,moveit); } -void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t, +void AbstractMail::mvcpMailList(const Q3ValueList<RecMailP>& t, const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) { encodedString*st = 0; int iii = 0; int count = t.count(); if ( count == 0 ) return; // wel, processevents is qite strange, we need a widget for getting // Global::statusMessage(i18n("Copy2 message %1").arg(iii)); displaye - QProgressBar wid ( count ); + Q3ProgressBar wid ( count ); wid.setCaption( i18n("Copying...")); wid.show(); while (iii < count ) { Global::statusMessage(i18n("Copy message %1 of %2").arg(iii).arg(count)); wid.setProgress( iii ); wid.raise(); qApp->processEvents(); RecMailP r = (*t.at( iii )); diff --git a/kmicromail/libmailwrapper/abstractmail.h b/kmicromail/libmailwrapper/abstractmail.h index 2069ca1..f606b1f 100644 --- a/kmicromail/libmailwrapper/abstractmail.h +++ b/kmicromail/libmailwrapper/abstractmail.h @@ -2,16 +2,18 @@ #ifndef __abstract_mail_ #define __abstract_mail_ #include "maildefines.h" #include "settings.h" #include <qobject.h> +//Added by qt3to4: +#include <Q3ValueList> #include <opie2/osmartpointer.h> #include "mailtypes.h" #include "mailwrapper.h" class IMAPwrapper; class POP3wrapper; @@ -20,36 +22,36 @@ class encodedString; struct folderStat; class AbstractMail:public QObject { Q_OBJECT public: AbstractMail(){}; virtual ~AbstractMail(){} - virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders()=0; - virtual void listMessages(const QString & mailbox,QValueList<RecMailP>&target, int sizeInKb = 0 )=0; + virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders()=0; + virtual void listMessages(const QString & mailbox,Q3ValueList<RecMailP>&target, int sizeInKb = 0 )=0; virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX")=0; virtual RecBodyP fetchBody(const RecMailP&mail)=0; virtual QString fetchTextPart(const RecMailP&mail,const RecPartP&part)=0; virtual encodedString* fetchDecodedPart(const RecMailP&mail,const RecPartP&part)=0; virtual encodedString* fetchRawPart(const RecMailP&mail,const RecPartP&part)=0; virtual encodedString* fetchRawBody(const RecMailP&mail)=0; virtual void deleteMail(const RecMailP&mail)=0; - virtual void deleteMailList(const QValueList<RecMailP>&target); + virtual void deleteMailList(const Q3ValueList<RecMailP>&target); virtual void answeredMail(const RecMailP&mail)=0; virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&)=0; - virtual void deleteMails(const QString & FolderName,const QValueList<Opie::Core::OSmartPointer<RecMail> >&target); + virtual void deleteMails(const QString & FolderName,const Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&target); virtual int deleteMbox(const Opie::Core::OSmartPointer<Folder>&)=0; virtual void storeMessage(const char*msg,size_t length, const QString&folder)=0; void downloadNewMails(const FolderP&fromFolder,AbstractMail*targetWrapper ); virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder, const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int sizeInKb = 0); - virtual void mvcpMailList(const QValueList<RecMailP>& t, + virtual void mvcpMailList(const Q3ValueList<RecMailP>& t, const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); virtual void cleanMimeCache(){}; /* mail box methods */ /* parameter is the box to create. * if the implementing subclass has prefixes, * them has to be appended automatic. diff --git a/kmicromail/libmailwrapper/generatemail.cpp b/kmicromail/libmailwrapper/generatemail.cpp index 2d213fe..ddad21b 100644 --- a/kmicromail/libmailwrapper/generatemail.cpp +++ b/kmicromail/libmailwrapper/generatemail.cpp @@ -2,16 +2,18 @@ #include "mailwrapper.h" #include <libetpan/libetpan.h> //#include <qt.h> #include <stdlib.h> #include <qfileinfo.h> +//Added by qt3to4: +#include <Q3CString> using namespace Opie::Core; const char* Generatemail::USER_AGENT="KOpieMail 33 1/3"; Generatemail::Generatemail() { mCharset = "iso-8859-1"; } @@ -223,17 +225,17 @@ void Generatemail::addFileParts( mailmime *message,const QList<Attachment>&files } mailmime *Generatemail::buildTxtPart(const QString&str ) { mailmime *txtPart; mailmime_fields *fields; mailmime_content *content; mailmime_parameter *param; int err; - QCString __str; + Q3CString __str; //qDebug(" Generatemail::buildTxtPart %s", str.latin1()); param = mailmime_parameter_new( strdup( "charset" ), strdup( mCharset.latin1() ) ); if ( param == NULL ) goto err_free; content = mailmime_content_new_with_str( "text/plain" ); if ( content == NULL ) @@ -247,17 +249,17 @@ mailmime *Generatemail::buildTxtPart(const QString&str ) { if ( fields == NULL ) goto err_free_content; txtPart = mailmime_new_empty( content, fields ); if ( txtPart == NULL ) goto err_free_fields; { //__str = str.utf8(); - __str = QCString (str.latin1()); + __str = Q3CString (str.latin1()); err = mailmime_set_body_text( txtPart, strdup(__str.data()), __str.length() ); } if ( err != MAILIMF_NO_ERROR ) goto err_free_txtPart; return txtPart; // Success :) err_free_txtPart: diff --git a/kmicromail/libmailwrapper/genericwrapper.cpp b/kmicromail/libmailwrapper/genericwrapper.cpp index 0b6adf7..633ab42 100644 --- a/kmicromail/libmailwrapper/genericwrapper.cpp +++ b/kmicromail/libmailwrapper/genericwrapper.cpp @@ -1,16 +1,18 @@ // CHANGED 2004-09-31 Lutz Rogowski #include "genericwrapper.h" #include <libetpan/libetpan.h> #include "mailtypes.h" #include <kconfig.h> #include <kglobal.h> #include <kstandarddirs.h> +//Added by qt3to4: +#include <Q3ValueList> using namespace Opie::Core; Genericwrapper::Genericwrapper() : AbstractMail() { bodyCache.clear(); m_storage = 0; @@ -177,17 +179,17 @@ QString Genericwrapper::getencoding(mailmime_mechanism*aEnc) if (aEnc->enc_token) { enc = QString(aEnc->enc_token); } break; } return enc; } -void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rec,int current_count) +void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,Q3ValueList<int>recList,unsigned int current_rec,int current_count) { if (current_rec >= 10) { ; // odebug << "too deep recursion!" << oendl; } if (!message || !mime) { return; } int r; @@ -195,17 +197,17 @@ void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*m size_t len; clistiter * cur = 0; QString b; RecPartP part = new RecPart(); switch (mime->mm_type) { case MAILMIME_SINGLE: { - QValueList<int>countlist = recList; + Q3ValueList<int>countlist = recList; countlist.append(current_count); r = mailmessage_fetch_section(message,mime,&data,&len); part->setSize(len); part->setPositionlist(countlist); b = gen_attachment_id(); part->setIdentifier(b); fillSingleBody(part,message,mime); if (part->Type()=="text" && target->Bodytext().isNull()) { @@ -245,17 +247,17 @@ void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*m target->addPart(part); } } break; case MAILMIME_MULTIPLE: { unsigned int ccount = 1; mailmime*cbody=0; - QValueList<int>countlist = recList; + Q3ValueList<int>countlist = recList; for (cur = clist_begin(mime->mm_data.mm_multipart.mm_mp_list) ; cur != NULL ; cur = clist_next(cur)) { cbody = (mailmime*)clist_content(cur); if (cbody->mm_type==MAILMIME_MULTIPLE) { RecPartP targetPart = new RecPart(); targetPart->setType("multipart"); countlist.append(current_count); targetPart->setPositionlist(countlist); target->addPart(targetPart); @@ -265,17 +267,17 @@ void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*m countlist = recList; } ++ccount; } } break; case MAILMIME_MESSAGE: { - QValueList<int>countlist = recList; + Q3ValueList<int>countlist = recList; countlist.append(current_count); /* the own header is always at recursion 0 - we don't need that */ if (current_rec > 0) { part->setPositionlist(countlist); r = mailmessage_fetch_section(message,mime,&data,&len); part->setSize(len); part->setPositionlist(countlist); b = gen_attachment_id(); @@ -297,17 +299,17 @@ RecBodyP Genericwrapper::parseMail( mailmessage * msg ) { int err = MAILIMF_NO_ERROR; //mailmime_single_fields fields; /* is bound to msg and will be freed there */ mailmime * mime=0; RecBodyP body = new RecBody(); //memset(&fields, 0, sizeof(struct mailmime_single_fields)); err = mailmessage_get_bodystructure(msg,&mime); - QValueList<int>recList; + Q3ValueList<int>recList; traverseBody(body,msg,mime,recList); return body; } QString Genericwrapper::parseAddressList( mailimf_address_list *list ) { QString result( "" ); @@ -442,17 +444,17 @@ QStringList Genericwrapper::parseInreplies(mailimf_in_reply_to * in_replies) } if (h.length()>0) { res.append(h); } } return res; } -void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to, int maxSizeInKb) +void Genericwrapper::parseList(Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to, int maxSizeInKb) { int r; mailmessage_list * env_list = 0; r = mailsession_get_messages_list(session,&env_list); if (r != MAIL_NO_ERROR) { ; // odebug << "Error message list" << oendl; return; } diff --git a/kmicromail/libmailwrapper/genericwrapper.h b/kmicromail/libmailwrapper/genericwrapper.h index c35a6da..a50161d 100644 --- a/kmicromail/libmailwrapper/genericwrapper.h +++ b/kmicromail/libmailwrapper/genericwrapper.h @@ -1,15 +1,17 @@ // CHANGED 2004-09-31 Lutz Rogowski #ifndef __GENERIC_WRAPPER_H #define __GENERIC_WRAPPER_H #include "abstractmail.h" #include <qmap.h> #include <qstring.h> +//Added by qt3to4: +#include <Q3ValueList> #include <libetpan/clist.h> class RecMail; class RecBody; class encodedString; struct mailpop3; struct mailmessage; struct mailmime; @@ -46,21 +48,21 @@ public: protected: RecBodyP parseMail( mailmessage * msg ); QString parseMailboxList( mailimf_mailbox_list *list ); QString parseMailbox( mailimf_mailbox *box ); QString parseGroup( mailimf_group *group ); QString parseAddressList( mailimf_address_list *list ); - void traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rek=0,int current_count=1); + void traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,Q3ValueList<int>recList,unsigned int current_rek=0,int current_count=1); static void fillSingleBody(RecPartP&target,mailmessage*message,mailmime*mime); static void fillParameters(RecPartP&target,clist*parameters); static QString getencoding(mailmime_mechanism*aEnc); - virtual void parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to=false, int maxSizeInKb = 0); + virtual void parseList(Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to=false, int maxSizeInKb = 0); QStringList parseInreplies(mailimf_in_reply_to * in_replies); QString msgTempName; unsigned int last_msg_id; QMap<QString,encodedString*> bodyCache; mailstorage * m_storage; mailfolder*m_folder; }; diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp index 4f0c849..f73f4cc 100644 --- a/kmicromail/libmailwrapper/imapwrapper.cpp +++ b/kmicromail/libmailwrapper/imapwrapper.cpp @@ -1,17 +1,19 @@ // CHANGED 2004-09-31 Lutz Rogowski #include <stdlib.h> #include <libetpan/libetpan.h> #include <qpe/global.h> #include <qapplication.h> +//Added by qt3to4: +#include <Q3ValueList> #include "imapwrapper.h" #include "mailtypes.h" #include "logindialog.h" -#include <qprogressbar.h> +#include <q3progressbar.h> #include "genericwrapper.h" #include <kglobal.h> using namespace Opie::Core; int IMAPwrapper::mMax = 0; int IMAPwrapper::mCurrent = 0; IMAPwrapper::IMAPwrapper( IMAPaccount *a ) @@ -234,17 +236,17 @@ void IMAPwrapper::logout() if (!m_imap) return; err = mailimap_logout( m_imap ); err = mailimap_close( m_imap ); mailimap_free( m_imap ); m_imap = 0; m_Lastmbox = ""; } -void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSmartPointer<RecMail> > &target , int maxSizeInKb) +void IMAPwrapper::listMessages(const QString&mailbox,Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target , int maxSizeInKb) { int tryAgain = 1; while ( tryAgain >= 0 ) { int err = MAILIMAP_NO_ERROR; clist *result = 0; clistcell *current; mailimap_fetch_type *fetchType = 0; @@ -315,26 +317,26 @@ void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSma else qDebug("try again... "); } if (result) mailimap_fetch_list_free(result); } } -QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders() +Q3ValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders() { const char *path, *mask; int err = MAILIMAP_NO_ERROR; clist *result = 0; clistcell *current = 0; clistcell*cur_flag = 0; mailimap_mbx_list_flags*bflags = 0; - QValueList<FolderP>* folders = new QValueList<FolderP>(); + Q3ValueList<FolderP>* folders = new Q3ValueList<FolderP>(); login(); if (!m_imap) { return folders; } /* * First we have to check for INBOX 'cause it sometimes it's not inside the path. * We must not forget to filter them out in next loop! @@ -608,17 +610,17 @@ RecBodyP IMAPwrapper::fetchBody(const RecMailP&mail) err = mailimap_fetch( m_imap, set, fetchType, &result ); mailimap_set_free( set ); mailimap_fetch_type_free( fetchType ); if (err == MAILIMAP_NO_ERROR && (current=clist_begin(result)) ) { mailimap_msg_att * msg_att; msg_att = (mailimap_msg_att*)current->data; mailimap_msg_att_item*item = (mailimap_msg_att_item*)msg_att->att_list->first->data; - QValueList<int> path; + Q3ValueList<int> path; body_desc = item->att_data.att_static->att_data.att_body; traverseBody(mail,body_desc,body,0,path); } else { qDebug("error fetching body %d (%d): %s", err, MAILIMAP_NO_ERROR, m_imap->imap_response ); } if (result) mailimap_fetch_list_free(result); return body; } @@ -659,17 +661,17 @@ QStringList IMAPwrapper::address_list_to_stringlist(clist*list) l.append(QString(from)); if (++count > 99) { break; } } return l; } -encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call) +encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const Q3ValueList<int>&path,bool internal_call) { encodedString*res=new encodedString; int err; mailimap_fetch_type *fetchType; mailimap_set *set; clistcell*current,*cur; mailimap_section_part * section_part = 0; mailimap_section_spec * section_spec = 0; @@ -733,25 +735,25 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const QValueList<int } if (result) mailimap_fetch_list_free(result); return res; } /* current_recursion is for recursive calls. current_count means the position inside the internal loop! */ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body, - int current_recursion,QValueList<int>recList,int current_count) + int current_recursion,Q3ValueList<int>recList,int current_count) { if (!body || current_recursion>=10) { return; } switch (body->bd_type) { case MAILIMAP_BODY_1PART: { - QValueList<int>countlist = recList; + Q3ValueList<int>countlist = recList; countlist.append(current_count); RecPartP currentPart = new RecPart(); mailimap_body_type_1part*part1 = body->bd_data.bd_body_1part; QString id(""); currentPart->setPositionlist(countlist); for (unsigned int j = 0; j < countlist.count();++j) { id+=(j>0?" ":""); id+=QString("%1").arg(countlist[j]); @@ -794,17 +796,17 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&t } if (part1->bd_type==MAILIMAP_BODY_TYPE_1PART_MSG) { traverseBody(mail,part1->bd_data.bd_type_msg->bd_body,target_body,current_recursion+1,countlist); } } break; case MAILIMAP_BODY_MPART: { - QValueList<int>countlist = recList; + Q3ValueList<int>countlist = recList; clistcell*current=0; mailimap_body*current_body=0; unsigned int ccount = 1; mailimap_body_type_mpart*mailDescription = body->bd_data.bd_body_mpart; for (current=clist_begin(mailDescription->bd_list);current!=0;current=clist_next(current)) { current_body = (mailimap_body*)current->data; if (current_body->bd_type==MAILIMAP_BODY_MPART) { RecPartP targetPart = new RecPart(); @@ -980,17 +982,17 @@ void IMAPwrapper::fillBodyFields(RecPartP&target_part,mailimap_body_fields*which } } if (which->bd_description) { target_part->setDescription(QString(which->bd_description)); } target_part->setEncoding(encoding); target_part->setSize(which->bd_size); } -void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target) +void IMAPwrapper::deleteMailList(const Q3ValueList<RecMailP>&target) { //#if 0 mailimap_flag_list*flist; mailimap_set *set; mailimap_store_att_flags * store_flags; int err; login(); //#endif @@ -1000,17 +1002,17 @@ void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target) int iii = 0; int count = target.count(); // qDebug("imap remove count %d ", count); mMax = count; progress( i18n("Delete")); - QProgressBar wid ( count ); + Q3ProgressBar wid ( count ); wid.setCaption( i18n("Deleting ...")); wid.show(); while (iii < count ) { Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count)); wid.setProgress( iii ); wid.raise(); qApp->processEvents(); RecMailP mail = (*target.at( iii )); @@ -1109,17 +1111,17 @@ void IMAPwrapper::answeredMail(const RecMailP&mail) mailimap_store_att_flags_free(store_flags); if (err != MAILIMAP_NO_ERROR) { // odebug << "error marking mail: " << m_imap->imap_response << "" << oendl; return; } } -QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call,const QString&enc) +QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const Q3ValueList<int>&path,bool internal_call,const QString&enc) { QString body(""); encodedString*res = fetchRawPart(mail,path,internal_call); encodedString*r = decode_String(res,enc); delete res; if (r) { if (r->Length()>0) { body = r->Content(); @@ -1294,17 +1296,17 @@ const QString&IMAPwrapper::getName()const { // odebug << "Get name: " << account->getAccountName().latin1() << "" << oendl; return account->getAccountName(); } encodedString* IMAPwrapper::fetchRawBody(const RecMailP&mail) { // dummy - QValueList<int> path; + Q3ValueList<int> path; return fetchRawPart(mail,path,false); } void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder, const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb) { if (targetWrapper != this || maxSizeInKb > 0 ) { mMax = 0; diff --git a/kmicromail/libmailwrapper/imapwrapper.h b/kmicromail/libmailwrapper/imapwrapper.h index 31c60a8..d3d3ecd 100644 --- a/kmicromail/libmailwrapper/imapwrapper.h +++ b/kmicromail/libmailwrapper/imapwrapper.h @@ -1,13 +1,15 @@ // CHANGED 2004-09-31 Lutz Rogowski #ifndef __IMAPWRAPPER #define __IMAPWRAPPER #include <qlist.h> +//Added by qt3to4: +#include <Q3ValueList> #include "mailwrapper.h" #include "abstractmail.h" #include <libetpan/clist.h> struct mailimap; struct mailimap_body; struct mailimap_body_type_1part; struct mailimap_body_type_text; @@ -19,22 +21,22 @@ struct mailimap_msg_att; class encodedString; class IMAPwrapper : public AbstractMail { Q_OBJECT public: IMAPwrapper( IMAPaccount *a ); virtual ~IMAPwrapper(); - virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); - virtual void listMessages(const QString & mailbox,QValueList<Opie::Core::OSmartPointer<RecMail> >&target , int sizeInKb = 0); + virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); + virtual void listMessages(const QString & mailbox,Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&target , int sizeInKb = 0); virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); virtual void deleteMail(const RecMailP&mail); - void deleteMailList(const QValueList<RecMailP>&target); + void deleteMailList(const Q3ValueList<RecMailP>&target); virtual void answeredMail(const RecMailP&mail); virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&folder); virtual void storeMessage(const char*msg,size_t length, const QString&folder); virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder, const QString&targetFolder,AbstractMail*targetWrapper,bool moveit,int sizeInKb = 0); virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); virtual RecBodyP fetchBody(const RecMailP&mail); @@ -54,26 +56,26 @@ public: virtual const QString&getName()const; virtual Account* getAccount() { return account; }; protected: RecMail*parse_list_result(mailimap_msg_att*); void login(bool tryTLS = true); bool start_tls(bool force=true); - virtual QString fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call=false,const QString&enc=""); - virtual encodedString*fetchRawPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call); + virtual QString fetchTextPart(const RecMailP&mail,const Q3ValueList<int>&path,bool internal_call=false,const QString&enc=""); + virtual encodedString*fetchRawPart(const RecMailP&mail,const Q3ValueList<int>&path,bool internal_call); int selectMbox(const QString&mbox); void fillSinglePart(RecPartP&target_part,mailimap_body_type_1part*Description); void fillSingleTextPart(RecPartP&target_part,mailimap_body_type_text*which); void fillSingleBasicPart(RecPartP&target_part,mailimap_body_type_basic*which); void fillSingleMsgPart(RecPartP&target_part,mailimap_body_type_msg*which); void fillMultiPart(RecPartP&target_part,mailimap_body_type_mpart*which); - void traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body,int current_recursion,QValueList<int>recList,int current_count=1); + void traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body,int current_recursion,Q3ValueList<int>recList,int current_count=1); /* just helpers */ static void fillBodyFields(RecPartP&target_part,mailimap_body_fields*which); static QStringList address_list_to_stringlist(clist*list); static void progress(QString mess = QString::null); static int mCurrent; static int mMax; diff --git a/kmicromail/libmailwrapper/libmailwrapper.pro b/kmicromail/libmailwrapper/libmailwrapper.pro index 646630b..6b595ab 100644 --- a/kmicromail/libmailwrapper/libmailwrapper.pro +++ b/kmicromail/libmailwrapper/libmailwrapper.pro @@ -33,17 +33,18 @@ SOURCES = imapwrapper.cpp \ statusmail.cpp \ mhwrapper.cpp \ nntpwrapper.cpp \ generatemail.cpp \ storemail.cpp \ ../qpe/qdialog_hacked.cpp \ ../qpe/global.cpp -INTERFACES = logindialogui.ui \ +#The following line was changed from INTERFACES to FORMS3 by qt3to4 +FORMS3 = logindialogui.ui \ sendmailprogressui.ui INCLUDEPATH += ../qpe .. ../../microkde ../../microkde/kdecore ../../libetpan/include LIBS += -lssl -lcrypto #-lqpe -letpan DESTDIR = ../../bin @@ -58,8 +59,13 @@ 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 } +#The following line was inserted by qt3to4 +QT += xml qt3support +#The following line was inserted by qt3to4 +CONFIG += uic3 + diff --git a/kmicromail/libmailwrapper/logindialog.cpp b/kmicromail/libmailwrapper/logindialog.cpp index 31b75d0..d1f4b5d 100644 --- a/kmicromail/libmailwrapper/logindialog.cpp +++ b/kmicromail/libmailwrapper/logindialog.cpp @@ -1,17 +1,17 @@ #include <qlineedit.h> #include "logindialog.h" //using namespace Opie::Core; -LoginDialog::LoginDialog(const QString&user,const QString&pass, QWidget *parent, const char *name, bool modal, WFlags flags ) +LoginDialog::LoginDialog(const QString&user,const QString&pass, QWidget *parent, const char *name, bool modal, Qt::WFlags flags ) : LoginDialogUI( parent, name, modal, flags ) { userLine->setText( (user.isEmpty()?QString(""):user) ); passLine->setText( (pass.isEmpty()?QString(""):pass) ); _user = user; _pass = pass; if ( user.isEmpty() ) { diff --git a/kmicromail/libmailwrapper/logindialog.h b/kmicromail/libmailwrapper/logindialog.h index f406f2c..a18daa5 100644 --- a/kmicromail/libmailwrapper/logindialog.h +++ b/kmicromail/libmailwrapper/logindialog.h @@ -3,17 +3,17 @@ #include "logindialogui.h" class LoginDialog : public LoginDialogUI { Q_OBJECT public: - LoginDialog(const QString&user,const QString&pass, QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags flags = 0 ); + LoginDialog(const QString&user,const QString&pass, QWidget *parent = 0, const char *name = 0, bool modal = false, Qt::WFlags flags = 0 ); QString getUser() { return _user; } QString getPassword() { return _pass; } protected slots: void accept(); private: QString _user, _pass; diff --git a/kmicromail/libmailwrapper/mailtypes.cpp b/kmicromail/libmailwrapper/mailtypes.cpp index 70a0ab5..84ccf9f 100644 --- a/kmicromail/libmailwrapper/mailtypes.cpp +++ b/kmicromail/libmailwrapper/mailtypes.cpp @@ -1,13 +1,15 @@ #include "mailtypes.h" //#include <opie2/odebug.h> #include <stdlib.h> +//Added by qt3to4: +#include <Q3ValueList> using namespace Opie::Core; RecMail::RecMail() :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7) { init(); } @@ -278,22 +280,22 @@ const QString RecPart::searchParamter(const QString&key)const QString value(""); part_plist_t::ConstIterator it = m_Parameters.find(key); if (it != m_Parameters.end()) { value = it.data(); } return value; } -void RecPart::setPositionlist(const QValueList<int>&poslist) +void RecPart::setPositionlist(const Q3ValueList<int>&poslist) { m_poslist = poslist; } -const QValueList<int>& RecPart::Positionlist()const +const Q3ValueList<int>& RecPart::Positionlist()const { return m_poslist; } RecBody::RecBody() : Opie::Core::ORefCount(),m_BodyText(),m_description(new RecPart()) { m_PartsList.clear(); @@ -318,23 +320,23 @@ void RecBody::setBodytext(const QString&bodyText) m_BodyText = bodyText; } const QString& RecBody::Bodytext()const { return m_BodyText; } -void RecBody::setParts(const QValueList<RecPartP>&parts) +void RecBody::setParts(const Q3ValueList<RecPartP>&parts) { m_PartsList.clear(); m_PartsList = parts; } -const QValueList<RecPartP>& RecBody::Parts()const +const Q3ValueList<RecPartP>& RecBody::Parts()const { return m_PartsList; } void RecBody::addPart(const RecPartP& part) { m_PartsList.append(part); } diff --git a/kmicromail/libmailwrapper/mailtypes.h b/kmicromail/libmailwrapper/mailtypes.h index 97f10d7..ac7f8da 100644 --- a/kmicromail/libmailwrapper/mailtypes.h +++ b/kmicromail/libmailwrapper/mailtypes.h @@ -9,17 +9,17 @@ #define FLAG_RECENT 5 #include <opie2/osmartpointer.h> #include <qbitarray.h> #include <qstring.h> #include <qstringlist.h> #include <qmap.h> -#include <qvaluelist.h> +#include <q3valuelist.h> class AbstractMail; /* a class to describe mails in a mailbox */ /* Attention! From programmers point of view it would make sense to store the mail body into this class, too. But: not from the point of view of the device. Mailbodies can be real large. So we request them when @@ -104,17 +104,17 @@ typedef QMap<QString,QString> part_plist_t; class RecPart:public Opie::Core::ORefCount { protected: QString m_type,m_subtype,m_identifier,m_encoding,m_description; unsigned int m_lines,m_size; part_plist_t m_Parameters; /* describes the position in the mail */ - QValueList<int> m_poslist; + Q3ValueList<int> m_poslist; public: RecPart(); RecPart(const RecPart&); virtual ~RecPart(); const QString&Type()const; void setType(const QString&type); @@ -131,44 +131,44 @@ public: void setSize(unsigned int size); const unsigned int Size()const; void setParameters(const part_plist_t&list); const part_plist_t&Parameters()const; void addParameter(const QString&key,const QString&value); const QString searchParamter(const QString&key)const; - void setPositionlist(const QValueList<int>&poslist); - const QValueList<int>& Positionlist()const; + void setPositionlist(const Q3ValueList<int>&poslist); + const Q3ValueList<int>& Positionlist()const; }; typedef Opie::Core::OSmartPointer<RecPart> RecPartP; class RecBody:public Opie::Core::ORefCount { protected: QString m_BodyText; QString mCharset; - QValueList<RecPartP> m_PartsList; + Q3ValueList<RecPartP> m_PartsList; RecPartP m_description; public: RecBody(); RecBody(const RecBody&old); virtual ~RecBody(); void setBodytext(const QString&); const QString& Bodytext()const; void setCharset(const QString&); QString getCharset()const; void setDescription(const RecPartP&des); const RecPartP& Description()const; - void setParts(const QValueList<RecPartP>&parts); - const QValueList<RecPartP>& Parts()const; + void setParts(const Q3ValueList<RecPartP>&parts); + const Q3ValueList<RecPartP>& Parts()const; void addPart(const RecPartP&part); }; typedef Opie::Core::OSmartPointer<RecBody> RecBodyP; class encodedString { public: diff --git a/kmicromail/libmailwrapper/mailwrapper.cpp b/kmicromail/libmailwrapper/mailwrapper.cpp index 2ee1ab3..9c299e8 100644 --- a/kmicromail/libmailwrapper/mailwrapper.cpp +++ b/kmicromail/libmailwrapper/mailwrapper.cpp @@ -1,15 +1,17 @@ #include <stdlib.h> #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> #include <fcntl.h> #include <string.h> #include <qdir.h> +//Added by qt3to4: +#include <Q3CString> #include "mailwrapper.h" //#include "logindialog.h" //#include "defines.h" #define UNDEFINED 64 #define MAXLINE 76 #define UTF16MASK 0x03FFUL @@ -76,41 +78,41 @@ static unsigned char base64chars[] = * Code taken from kde cvs: kdebase/kioslave/imap4/rfcdecoder.cc */ QString IMAPFolder::decodeFolderName( const QString &name ) { unsigned char c, i, bitcount; unsigned long ucs4, utf16, bitbuf; unsigned char base64[256], utf8[6]; unsigned long srcPtr = 0; - QCString dst = ""; - QCString src = name.ascii(); + Q3CString dst = ""; + Q3CString src = name.ascii(); /* initialize modified base64 decoding table */ memset(base64, UNDEFINED, sizeof(base64)); for (i = 0; i < sizeof(base64chars); ++i) { base64[(int)base64chars[i]] = i; } /* loop until end of string */ while (srcPtr < src.length ()) { - c = src[srcPtr++]; + c = src.at(srcPtr++); /* deal with literal characters and &- */ - if (c != '&' || src[srcPtr] == '-') { + if (c != '&' || src.at(srcPtr) == '-') { /* encode literally */ dst += c; /* skip over the '-' if this is an &- sequence */ if (c == '&') srcPtr++; } else { /* convert modified UTF-7 -> UTF-16 -> UCS-4 -> UTF-8 -> HEX */ bitbuf = 0; bitcount = 0; ucs4 = 0; - while ((c = base64[(unsigned char) src[srcPtr]]) != UNDEFINED) { + while ((c = base64[(unsigned char) src.at(srcPtr)]) != UNDEFINED) { ++srcPtr; bitbuf = (bitbuf << 6) | c; bitcount += 6; /* enough bits for a UTF-16 character? */ if (bitcount >= 16) { bitcount -= 16; utf16 = (bitcount ? bitbuf >> bitcount : bitbuf) & 0xffff; /* convert UTF16 to UCS4 */ @@ -144,17 +146,17 @@ QString IMAPFolder::decodeFolderName( const QString &name ) } /* copy it */ for (c = 0; c < i; ++c) { dst += utf8[c]; } } } /* skip over trailing '-' in modified UTF-7 encoding */ - if (src[srcPtr] == '-') + if (src.at(srcPtr) == '-') ++srcPtr; } } return QString::fromUtf8( dst.data() ); } Mail::Mail() diff --git a/kmicromail/libmailwrapper/mailwrapper.h b/kmicromail/libmailwrapper/mailwrapper.h index 3e8b51f..bebabf4 100644 --- a/kmicromail/libmailwrapper/mailwrapper.h +++ b/kmicromail/libmailwrapper/mailwrapper.h @@ -1,16 +1,18 @@ #ifndef MAILWRAPPER_H #define MAILWRAPPER_H //#include <qpe/applnk.h> #include <qbitarray.h> #include <qdatetime.h> #include <qfileinfo.h> +//Added by qt3to4: +#include <QPixmap> #include <kiconloader.h> #include "settings.h" #include <opie2/osmartpointer.h> /* class Attachment { @@ -56,17 +58,17 @@ public: Mail(); /* Possible that this destructor must not be declared virtual * 'cause it seems that it will never have some child classes. * in this case this object will not get a virtual table -> memory and * speed will be a little bit better? */ virtual ~Mail(){} void addAttachment( Attachment *att ) { attList.append( att ); } - const QList<Attachment>& getAttachments()const { return attList; } + const QList<Attachment*>& getAttachments()const { return attList; } void removeAttachment( Attachment *att ) { attList.remove( att ); } const QString&getName()const { return name; } void setName( QString s ) { name = s; } const QString&getMail()const{ return mail; } void setMail( const QString&s ) { mail = s; } const QString&getTo()const{ return to; } void setTo( const QString&s ) { to = s; } const QString&getCC()const{ return cc; } @@ -81,17 +83,17 @@ public: void setReply( const QString&a ) { reply = a; } void setInreply(const QStringList&list){m_in_reply_to = list;} const QStringList&Inreply()const{return m_in_reply_to;} void setCharset( const QString&a ) { charset= a; } const QString& getCharset() const { return charset; } private: - QList<Attachment> attList; + QList<Attachment*> attList; QString name, mail, to, cc, bcc, reply, subject, message, charset; QStringList m_in_reply_to; }; class Folder:public Opie::Core::ORefCount { public: Folder( const QString&init_name,const QString&sep ); diff --git a/kmicromail/libmailwrapper/mboxwrapper.cpp b/kmicromail/libmailwrapper/mboxwrapper.cpp index 87f8c8a..888cae2 100644 --- a/kmicromail/libmailwrapper/mboxwrapper.cpp +++ b/kmicromail/libmailwrapper/mboxwrapper.cpp @@ -1,13 +1,15 @@ #include "mboxwrapper.h" #include "mailtypes.h" #include "mailwrapper.h" #include <libetpan/libetpan.h> #include <qdir.h> +//Added by qt3to4: +#include <Q3ValueList> #include <stdlib.h> #include <klocale.h> #include <qpe/global.h> using namespace Opie::Core; MBOXwrapper::MBOXwrapper(const QString & mbox_dir,const QString&mbox_name) @@ -18,17 +20,17 @@ MBOXwrapper::MBOXwrapper(const QString & mbox_dir,const QString&mbox_name) dir.mkdir(MBOXPath); } } MBOXwrapper::~MBOXwrapper() { } -void MBOXwrapper::listMessages(const QString & mailbox, QValueList<RecMailP> &target ) +void MBOXwrapper::listMessages(const QString & mailbox, Q3ValueList<RecMailP> &target ) { mailstorage*storage = mailstorage_new(NULL); QString p = MBOXPath+"/"; p+=mailbox; int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); mailfolder*folder; folder = mailfolder_new( storage,(char*)p.latin1(),NULL); @@ -43,19 +45,19 @@ void MBOXwrapper::listMessages(const QString & mailbox, QValueList<RecMailP> &ta parseList(target,folder->fld_session,mailbox); mailfolder_disconnect(folder); mailfolder_free(folder); mailstorage_free(storage); Global::statusMessage(i18n("Mailbox has %1 mail(s)").arg(target.count())); } -QValueList<Opie::Core::OSmartPointer<Folder> >* MBOXwrapper::listFolders() +Q3ValueList<Opie::Core::OSmartPointer<Folder> >* MBOXwrapper::listFolders() { - QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >(); + Q3ValueList<Opie::Core::OSmartPointer<Folder> >* folders = new Q3ValueList<Opie::Core::OSmartPointer<Folder> >(); QDir dir(MBOXPath); if (!dir.exists()) return folders; dir.setFilter(QDir::Files|QDir::Writable|QDir::Readable); QStringList entries = dir.entryList(); QStringList::ConstIterator it = entries.begin(); for (;it!=entries.end();++it) { FolderP inb=new Folder(*it,"/"); folders->append(inb); @@ -212,35 +214,35 @@ encodedString* MBOXwrapper::fetchRawBody(const RecMailP&mail) encodedString*result = new encodedString(data,size); mailfolder_free(folder); mailstorage_free(storage); mailmessage_free(msg); return result; } -void MBOXwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &target) +void MBOXwrapper::deleteMails(const QString & mailbox,const Q3ValueList<RecMailP> &target) { QString p = MBOXPath+"/"; p+=mailbox; mailmbox_folder*f = 0; int r = mailmbox_init(p.latin1(),0,1,0,&f); if (r != MAIL_NO_ERROR) { ; // << "Error init folder" << oendl; return; } deleteMails(f,target); mailmbox_done(f); } -void MBOXwrapper::deleteMails(mailmbox_folder*f,const QValueList<RecMailP> &target) +void MBOXwrapper::deleteMails(mailmbox_folder*f,const Q3ValueList<RecMailP> &target) { if (!f) return; int r; - QValueList<RecMailP>::ConstIterator it; + Q3ValueList<RecMailP>::ConstIterator it; for (it=target.begin(); it != target.end();++it) { r = mailmbox_delete_msg(f,(*it)->getNumber()); if (r!=MAILMBOX_NO_ERROR) { ; // << "error delete mail" << oendl; } } r = mailmbox_expunge(f); if (r != MAILMBOX_NO_ERROR) { diff --git a/kmicromail/libmailwrapper/mboxwrapper.h b/kmicromail/libmailwrapper/mboxwrapper.h index d03940f..e658a71 100644 --- a/kmicromail/libmailwrapper/mboxwrapper.h +++ b/kmicromail/libmailwrapper/mboxwrapper.h @@ -1,47 +1,49 @@ #ifndef __MBOX_WRAPPER_H #define __MBOX_WRAPPER_H #include "genericwrapper.h" #include <qstring.h> +//Added by qt3to4: +#include <Q3ValueList> class encodedString; struct mailmbox_folder; class MBOXwrapper : public Genericwrapper { Q_OBJECT public: MBOXwrapper(const QString & dir,const QString&name); virtual ~MBOXwrapper(); - virtual void listMessages(const QString & mailbox, QValueList<RecMailP>&target ); - virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); + virtual void listMessages(const QString & mailbox, Q3ValueList<RecMailP>&target ); + virtual Q3ValueList<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 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<RecMailP> &target); + virtual void deleteMails(const QString & FolderName,const Q3ValueList<RecMailP> &target); virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); virtual MAILLIB::ATYPE getType()const; virtual const QString&getName()const; virtual Account* getAccount() { return 0; }; protected: - static void deleteMails(mailmbox_folder*f,const QValueList<RecMailP> &target); + static void deleteMails(mailmbox_folder*f,const Q3ValueList<RecMailP> &target); QString MBOXPath; QString MBOXName; }; #endif diff --git a/kmicromail/libmailwrapper/mhwrapper.cpp b/kmicromail/libmailwrapper/mhwrapper.cpp index 787e85d..4cd7a94 100644 --- a/kmicromail/libmailwrapper/mhwrapper.cpp +++ b/kmicromail/libmailwrapper/mhwrapper.cpp @@ -1,15 +1,17 @@ // 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> +//Added by qt3to4: +#include <Q3ValueList> #include <stdlib.h> #include <qpe/global.h> #include <klocale.h> #include <kglobal.h> //#include <opie2/odebug.h> using namespace Opie::Core; MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name) @@ -59,35 +61,35 @@ void MHwrapper::clean_storage() } } MHwrapper::~MHwrapper() { clean_storage(); } -void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) +void MHwrapper::listMessages(const QString & mailbox, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) { init_storage(); if (!m_storage) { return; } QString f = buildPath(mailbox); int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); if (r!=MAIL_NO_ERROR) { qDebug("listMessages: error selecting folder! "); return; } parseList(target,m_storage->sto_session,f, false, maxSizeInKb ); Global::statusMessage(i18n("Mailbox has %1 mail(s)").arg(target.count())); } -QValueList<Opie::Core::OSmartPointer<Folder> >* MHwrapper::listFolders() +Q3ValueList<Opie::Core::OSmartPointer<Folder> >* MHwrapper::listFolders() { - QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >(); + Q3ValueList<Opie::Core::OSmartPointer<Folder> >* folders = new Q3ValueList<Opie::Core::OSmartPointer<Folder> >(); /* this is needed! */ if (m_storage) mailstorage_disconnect(m_storage); init_storage(); if (!m_storage) { return folders; } mail_list*flist = 0; clistcell*current=0; @@ -250,25 +252,25 @@ encodedString* MHwrapper::fetchRawBody(const RecMailP&mail) if (msg) mailmessage_free(msg); return 0; } result = new encodedString(data,size); if (msg) mailmessage_free(msg); return result; } -void MHwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &target) +void MHwrapper::deleteMails(const QString & mailbox,const Q3ValueList<RecMailP> &target) { QString f = buildPath(mailbox); int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); if (r!=MAIL_NO_ERROR) { qDebug("deleteMails: error selecting folder! "); return; } - QValueList<RecMailP>::ConstIterator it; + Q3ValueList<RecMailP>::ConstIterator it; for (it=target.begin(); it!=target.end();++it) { r = mailsession_remove_message(m_storage->sto_session,(*it)->getNumber()); if (r != MAIL_NO_ERROR) { qDebug("error deleting mail "); break; } } } diff --git a/kmicromail/libmailwrapper/mhwrapper.h b/kmicromail/libmailwrapper/mhwrapper.h index 36a443a..6151ff1 100644 --- a/kmicromail/libmailwrapper/mhwrapper.h +++ b/kmicromail/libmailwrapper/mhwrapper.h @@ -1,28 +1,30 @@ // CHANGED 2004-09-31 Lutz Rogowski #ifndef __MH_WRAPPER_H #define __MH_WRAPPER_H #include "maildefines.h" #include "genericwrapper.h" #include <qstring.h> +//Added by qt3to4: +#include <Q3ValueList> class encodedString; struct mailmbox_folder; 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 listMessages(const QString & mailbox, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); + virtual Q3ValueList<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); @@ -31,17 +33,17 @@ public: 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 void deleteMails(const QString & FolderName,const Q3ValueList<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: protected: diff --git a/kmicromail/libmailwrapper/nntpwrapper.cpp b/kmicromail/libmailwrapper/nntpwrapper.cpp index 93cd2b5..b328ecd 100644 --- a/kmicromail/libmailwrapper/nntpwrapper.cpp +++ b/kmicromail/libmailwrapper/nntpwrapper.cpp @@ -1,14 +1,16 @@ // CHANGED 2004-09-31 Lutz Rogowski #include "nntpwrapper.h" #include "logindialog.h" #include "mailtypes.h" #include <qfile.h> +//Added by qt3to4: +#include <Q3ValueList> #include <stdlib.h> #include <libetpan/libetpan.h> #define HARD_MSG_SIZE_LIMIT 5242880 @@ -55,24 +57,24 @@ RecBodyP NNTPwrapper::fetchBody( const RecMailP &mail ) { QFile msg_cache(msgTempName); cleanMimeCache(); if (mail->getNumber()!=last_msg_id) { if (msg_cache.exists()) { msg_cache.remove(); } - msg_cache.open(IO_ReadWrite|IO_Truncate); + msg_cache.open(QIODevice::ReadWrite|QIODevice::Truncate); last_msg_id = mail->getNumber(); err = mailsession_get_message(m_nntp->sto_session, mail->getNumber(), &mailmsg); err = mailmessage_fetch(mailmsg,&message,&length); msg_cache.writeBlock(message,length); } else { QString msg=""; - msg_cache.open(IO_ReadOnly); + msg_cache.open(QIODevice::ReadOnly); message = new char[4096]; memset(message,0,4096); while (msg_cache.readBlock(message,4095)>0) { msg+=message; memset(message,0,4096); } delete message; message = (char*)malloc(msg.length()+1*sizeof(char)); @@ -94,17 +96,17 @@ RecBodyP NNTPwrapper::fetchBody( const RecMailP &mail ) { mailmessage_free(mailmsg); if (message) free(message); return body; } -void NNTPwrapper::listMessages(const QString & which, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb) +void NNTPwrapper::listMessages(const QString & which, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb) { login(); if (!m_nntp) return; uint32_t res_messages,res_recent,res_unseen; mailsession_status_folder(m_nntp->sto_session,(char*)which.latin1(),&res_messages,&res_recent,&res_unseen); parseList(target,m_nntp->sto_session,which,true, maxSizeInKb); } @@ -181,19 +183,19 @@ void NNTPwrapper::logout() { int err = NEWSNNTP_NO_ERROR; if ( m_nntp == NULL ) return; mailstorage_free(m_nntp); m_nntp = 0; } -QValueList<Opie::Core::OSmartPointer<Folder> >* NNTPwrapper::listFolders() { +Q3ValueList<Opie::Core::OSmartPointer<Folder> >* NNTPwrapper::listFolders() { - QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >(); + Q3ValueList<Opie::Core::OSmartPointer<Folder> >* folders = new Q3ValueList<Opie::Core::OSmartPointer<Folder> >(); QStringList groups; if (account) { groups = account->getGroups(); } for ( QStringList::Iterator it = groups.begin(); it != groups.end(); ++it ) { folders->append(new Folder((*it),".")); } return folders; diff --git a/kmicromail/libmailwrapper/nntpwrapper.h b/kmicromail/libmailwrapper/nntpwrapper.h index 8c54f12..7c8e671 100644 --- a/kmicromail/libmailwrapper/nntpwrapper.h +++ b/kmicromail/libmailwrapper/nntpwrapper.h @@ -1,34 +1,36 @@ // CHANGED 2004-09-31 Lutz Rogowski #ifndef __NNTPWRAPPER #define __NNTPWRAPPER #include "mailwrapper.h" #include "genericwrapper.h" #include <qstring.h> +//Added by qt3to4: +#include <Q3ValueList> #include <libetpan/clist.h> class encodedString; struct mailstorage; struct mailfolder; class NNTPwrapper : public Genericwrapper { Q_OBJECT public: NNTPwrapper( NNTPaccount *a ); virtual ~NNTPwrapper(); /* mailbox will be ignored */ - virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); + virtual void listMessages(const QString & mailbox, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); /* should only get the subscribed one */ - virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); + virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); /* mailbox will be ignored */ virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); QStringList listAllNewsgroups(const QString&mask = QString::null); virtual void deleteMail(const RecMailP&mail); virtual void answeredMail(const RecMailP&mail); virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); virtual RecBodyP fetchBody( const RecMailP &mail ); diff --git a/kmicromail/libmailwrapper/pop3wrapper.cpp b/kmicromail/libmailwrapper/pop3wrapper.cpp index 2888f7c..ebeed71 100644 --- a/kmicromail/libmailwrapper/pop3wrapper.cpp +++ b/kmicromail/libmailwrapper/pop3wrapper.cpp @@ -4,18 +4,20 @@ #include "mailtypes.h" #include "logindialog.h" #include <libetpan/libetpan.h> #include <klocale.h> #include <qpe/global.h> #include <qfile.h> -#include <qprogressbar.h> +#include <q3progressbar.h> #include <qapplication.h> +//Added by qt3to4: +#include <Q3ValueList> /* we don't fetch messages larger than 5 MB */ #define HARD_MSG_SIZE_LIMIT 5242880 using namespace Opie::Core; POP3wrapper::POP3wrapper( POP3account *a ) : Genericwrapper() { account = a; @@ -57,24 +59,24 @@ RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) { QFile msg_cache(msgTempName); cleanMimeCache(); if (mail->getNumber()!=last_msg_id) { if (msg_cache.exists()) { msg_cache.remove(); } - msg_cache.open(IO_ReadWrite|IO_Truncate); + msg_cache.open(QIODevice::ReadWrite|QIODevice::Truncate); last_msg_id = mail->getNumber(); err = mailsession_get_message(m_pop3->sto_session, mail->getNumber(), &mailmsg); err = mailmessage_fetch(mailmsg,&message,&length); msg_cache.writeBlock(message,length); } else { QString msg=""; - msg_cache.open(IO_ReadOnly); + msg_cache.open(QIODevice::ReadOnly); message = new char[4096]; memset(message,0,4096); while (msg_cache.readBlock(message,4095)>0) { msg+=message; memset(message,0,4096); } delete message; message = (char*)malloc(msg.length()+1*sizeof(char)); @@ -95,17 +97,17 @@ RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) { if (mailmsg) mailmessage_free(mailmsg); if (message) free(message); return body; } -void POP3wrapper::listMessages(const QString &, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) +void POP3wrapper::listMessages(const QString &, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) { login(); if (!m_pop3) return; uint32_t res_messages,res_recent,res_unseen; mailsession_status_folder(m_pop3->sto_session,"INBOX",&res_messages,&res_recent,&res_unseen); parseList(target,m_pop3->sto_session,"INBOX", false, maxSizeInKb); Global::statusMessage( i18n("Mailbox contains %1 mail(s)").arg(res_messages)); @@ -182,32 +184,32 @@ void POP3wrapper::logout() { if ( m_pop3 == NULL ) return; mailstorage_free(m_pop3); m_pop3 = 0; } -QValueList<Opie::Core::OSmartPointer<Folder> >* POP3wrapper::listFolders() { - QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<FolderP>(); +Q3ValueList<Opie::Core::OSmartPointer<Folder> >* POP3wrapper::listFolders() { + Q3ValueList<Opie::Core::OSmartPointer<Folder> >* folders = new Q3ValueList<FolderP>(); FolderP inb=new Folder("INBOX","/"); folders->append(inb); return folders; } -void POP3wrapper::deleteMailList(const QValueList<RecMailP>&target) +void POP3wrapper::deleteMailList(const Q3ValueList<RecMailP>&target) { login(); if (!m_pop3) return; int iii = 0; int count = target.count(); - QProgressBar wid ( count ); + Q3ProgressBar wid ( count ); wid.setCaption( i18n("Deleting ...")); wid.show(); while (iii < count ) { Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count)); wid.setProgress( iii ); wid.raise(); qApp->processEvents(); //qDebug("delete "); @@ -241,17 +243,17 @@ int POP3wrapper::deleteAllMail(const FolderP&) { int err = mailsession_messages_number(m_pop3->sto_session,NULL,&result); if (err != MAIL_NO_ERROR) { Global::statusMessage(i18n("Error getting folder info")); return 0; } - QProgressBar wid ( result ); + Q3ProgressBar wid ( result ); wid.setCaption( i18n("Deleting ...")); wid.show(); for (unsigned int i = 0; i < result; ++i) { Global::statusMessage(i18n("Delete message %1 of %2").arg(i).arg(result)); wid.setProgress( i ); wid.raise(); qApp->processEvents(); diff --git a/kmicromail/libmailwrapper/pop3wrapper.h b/kmicromail/libmailwrapper/pop3wrapper.h index ebc2fc7..a077877 100644 --- a/kmicromail/libmailwrapper/pop3wrapper.h +++ b/kmicromail/libmailwrapper/pop3wrapper.h @@ -1,35 +1,37 @@ // CHANGED 2004-09-31 Lutz Rogowski #ifndef __POP3WRAPPER #define __POP3WRAPPER #include "mailwrapper.h" #include "genericwrapper.h" #include <qstring.h> +//Added by qt3to4: +#include <Q3ValueList> class encodedString; struct mailstorage; struct mailfolder; class POP3wrapper : public Genericwrapper { Q_OBJECT public: POP3wrapper( POP3account *a ); virtual ~POP3wrapper(); /* mailbox will be ignored */ - virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); - virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); + virtual void listMessages(const QString & mailbox, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); + virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); /* mailbox will be ignored */ virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); virtual void deleteMail(const RecMailP&mail); - virtual void deleteMailList(const QValueList<RecMailP>&target); + virtual void deleteMailList(const Q3ValueList<RecMailP>&target); virtual void answeredMail(const RecMailP&mail); virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); virtual RecBodyP fetchBody( const RecMailP &mail ); virtual encodedString* fetchRawBody(const RecMailP&mail); virtual void logout(); virtual MAILLIB::ATYPE getType()const; virtual const QString&getName()const; diff --git a/kmicromail/libmailwrapper/sendmailprogress.cpp b/kmicromail/libmailwrapper/sendmailprogress.cpp index 20dfe9b..6cd6409 100644 --- a/kmicromail/libmailwrapper/sendmailprogress.cpp +++ b/kmicromail/libmailwrapper/sendmailprogress.cpp @@ -1,10 +1,10 @@ #include "sendmailprogress.h" -#include <qprogressbar.h> +#include <q3progressbar.h> #include <qlabel.h> #include <klocale.h> progressMailSend::progressMailSend(QWidget*parent, const char * name) :progressMailSendUI(parent,name,true),m_current_mail(0),m_current_single(0),m_max_mail(0),m_max_single(0) { } diff --git a/kmicromail/libmailwrapper/settings.cpp b/kmicromail/libmailwrapper/settings.cpp index 9436d43..fc01528 100644 --- a/kmicromail/libmailwrapper/settings.cpp +++ b/kmicromail/libmailwrapper/settings.cpp @@ -1,13 +1,13 @@ #include <stdlib.h> #include <qdir.h> #include <qtextcodec.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qfile.h> //#include <opie2/odebug.h> #include <kconfig.h> #include <kstandarddirs.h> #include "settings.h" //#include "defines.h" @@ -371,21 +371,21 @@ SMTPaccount::SMTPaccount( QString filename ) QString SMTPaccount::getSignature() { QFileInfo fi ( signature ); if ( ! fi.exists() ) return QString(); QFile file( signature ); - if (!file.open( IO_ReadOnly ) ) { + if (!file.open( QIODevice::ReadOnly ) ) { return QString(); } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); QString text = ts.read(); file.close(); return text; } void SMTPaccount::setSignature( QString b ) @@ -394,21 +394,21 @@ void SMTPaccount::setSignature( QString b ) QFileInfo fi ( signature ); if ( ! fi.exists() ) { QString filedir( locateLocal("data", "kopiemail" ) ); signature = filedir+ "/" + getAccountName() +".sig"; qDebug("new sig %s ", signature.latin1()); save(); } QFile fileIn( signature ); - if (!fileIn.open( IO_WriteOnly ) ) { + if (!fileIn.open( QIODevice::WriteOnly ) ) { qDebug("OM: Cannot write signature file %s ", signature.latin1() ); return ; } - QTextStream tsIn( &fileIn ); + Q3TextStream tsIn( &fileIn ); tsIn.setCodec( QTextCodec::codecForName("utf8") ); tsIn << b ; fileIn.close(); } QString SMTPaccount::getUniqueFileName() { int num = 0; QString unique; diff --git a/kmicromail/libmailwrapper/smtpwrapper.cpp b/kmicromail/libmailwrapper/smtpwrapper.cpp index 7c813cc..2df55ff 100644 --- a/kmicromail/libmailwrapper/smtpwrapper.cpp +++ b/kmicromail/libmailwrapper/smtpwrapper.cpp @@ -4,16 +4,18 @@ #include "logindialog.h" #include "mailtypes.h" #include "sendmailprogress.h" //#include <opie2/odebug.h> //#include <qt.h> #include <qapplication.h> #include <qmessagebox.h> +//Added by qt3to4: +#include <Q3ValueList> #include <stdlib.h> #ifndef DESKTOP_VERSION //#include <qpe/config.h> #include <qpe/qcopenvelope_qws.h> #endif #include <libetpan/libetpan.h> #include <klocale.h> #include <kglobal.h> @@ -429,18 +431,18 @@ bool SMTPwrapper::flushOutbox() { bool reset_user_value = false; QString localfolders = AbstractMail::defaultLocalfolder(); AbstractMail*wrap = AbstractMail::getWrapper(localfolders); if (!wrap) { ; // odebug << "memory error" << oendl; return false; } QString oldPw, oldUser; - QValueList<RecMailP> mailsToSend; - QValueList<RecMailP> mailsToRemove; + Q3ValueList<RecMailP> mailsToSend; + Q3ValueList<RecMailP> mailsToRemove; QString mbox("Outgoing"); wrap->listMessages(mbox,mailsToSend); if (mailsToSend.count()==0) { delete wrap; ; // odebug << "No mails to send" << oendl; return false; } diff --git a/kmicromail/mailistviewitem.cpp b/kmicromail/mailistviewitem.cpp index 41cee52..d8eee7d 100644 --- a/kmicromail/mailistviewitem.cpp +++ b/kmicromail/mailistviewitem.cpp @@ -1,17 +1,17 @@ // CHANGED 2004-08-06 Lutz Rogowski #include "mailistviewitem.h" #include <libmailwrapper/abstractmail.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <kiconloader.h> #include "koprefs.h" //#include <qpe/resource.h> -MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item ) +MailListViewItem::MailListViewItem(Q3ListView * parent, MailListViewItem * item ) :KListViewItem(parent,item),mail_data() { } void MailListViewItem::showEntry() { if ( mail_data->getFlags().testBit( FLAG_ANSWERED ) == true) { setPixmap( 0, SmallIcon ( "kmmsgreplied") ); diff --git a/kmicromail/mailistviewitem.h b/kmicromail/mailistviewitem.h index b409c9d..ecc01ba 100644 --- a/kmicromail/mailistviewitem.h +++ b/kmicromail/mailistviewitem.h @@ -4,17 +4,17 @@ #include <klistview.h> #include <libmailwrapper/mailtypes.h> #include <libmailwrapper/maildefines.h> class MailListViewItem:public KListViewItem { public: - MailListViewItem(QListView * parent, MailListViewItem * after ); + MailListViewItem(Q3ListView * parent, MailListViewItem * after ); virtual ~MailListViewItem(){} void storeData(const RecMailP&data); const RecMailP&data()const; void showEntry(); MAILLIB::ATYPE wrapperType(); QString key(int column, bool) const; void setSortKey(int column,const QString &key); diff --git a/kmicromail/main.cpp b/kmicromail/main.cpp index fe4bc76..dc73455 100644 --- a/kmicromail/main.cpp +++ b/kmicromail/main.cpp @@ -1,13 +1,15 @@ // CHANGED 2004-08-06 Lutz Rogowski #ifndef DESKTOP_VERSION #include <qpe/qpeapplication.h> +//Added by qt3to4: +#include <Q3CString> #include <libkdepim/externalapphandler.h> #include <stdlib.h> #else #include <qapplication.h> #include <qstring.h> #include <qwindowsstyle.h> #include <qplatinumstyle.h> #include <qsgistyle.h> @@ -18,16 +20,17 @@ #include <kglobal.h> #include <stdio.h> #include "mainwindow.h" #include "koprefs.h" #include <libkdepim/kpimglobalprefs.h> void dumpMissing(); //using namespace Opie::Core; int main( int argc, char **argv ) { + if(!getenv("QPEDIR")) putenv("QPEDIR=/usr/lib/kdepimpi"); #ifndef DESKTOP_VERSION QPEApplication a( argc, argv ); a.setKeepRunning (); #else QApplication a( argc, argv ); QApplication::setStyle( new QPlatinumStyle ()); #endif @@ -46,17 +49,17 @@ int main( int argc, char **argv ) { #endif KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kopiemail"))); KPimGlobalPrefs::instance()->setGlobalConfig(); QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont ); QApplication::setFont( KOPrefs::instance()->mAppFont ); OpieMail mw; #ifndef DESKTOP_VERSION //qDebug("CONNECT "); - QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&mw, SLOT(message( const QCString&, const QByteArray& ))); + QObject::connect( &a, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )),&mw, SLOT(message( const Q3CString&, const QByteArray& ))); // QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); a.showMainWidget(&mw ); #else a.setMainWidget(&mw ); mw.show(); //m.resize( 800, 600 ); QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); #endif diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp index d547dda..627d92e 100644 --- a/kmicromail/mainwindow.cpp +++ b/kmicromail/mainwindow.cpp @@ -1,15 +1,21 @@ // CHANGED 2004-08-06 Lutz Rogowski #include <qlabel.h> -#include <qvbox.h> -#include <qheader.h> +#include <q3vbox.h> +#include <q3header.h> #include <qtimer.h> #include <qlayout.h> +//Added by qt3to4: +#include <Q3CString> +#include <Q3GridLayout> +#include <Q3ValueList> +#include <QPixmap> +#include <Q3PopupMenu> //#include <kdialog.h> #include <kiconloader.h> #include <kapplication.h> #ifdef DESKTOP_VERSION #include <qapplication.h> #include <qstatusbar.h> #include <kabc/stdaddressbook.h> @@ -22,30 +28,30 @@ extern QStatusBar* globalSstatusBarMainWindow; #include "koprefs.h" #include "mainwindow.h" #include "mailistviewitem.h" #include <KDGanttMinimizeSplitter.h> #include <libkdepim/kpimglobalprefs.h> #include "koprefs.h" -MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) - : QMainWindow( parent, name ) //, flags ) +MainWindow::MainWindow( QWidget *parent, const char *name, Qt::WFlags flags ) + : Q3MainWindow( parent, name ) //, flags ) { #ifdef DESKTOP_VERSION globalSstatusBarMainWindow = statusBar(); #endif setCaption( i18n( "KOpieMail/Pi" ) ); setToolBarsMovable( false ); //KABC::StdAddressBook::self(); - toolBar = new QToolBar( this ); + toolBar = new Q3ToolBar( this ); menuBar = new QPEMenuBar( toolBar ); - mailMenu = new QPopupMenu( menuBar ); + mailMenu = new Q3PopupMenu( menuBar ); menuBar->insertItem( i18n( "Mail" ), mailMenu ); - settingsMenu = new QPopupMenu( menuBar ); + settingsMenu = new Q3PopupMenu( menuBar ); menuBar->insertItem( i18n( "Settings" ), settingsMenu ); addToolBar( toolBar ); toolBar->setHorizontalStretchable( true ); QAction* getMail = new QAction( i18n( "Get all new mails" ), SmallIcon("enter"), 0, 0, this ); connect(getMail, SIGNAL( activated() ), SLOT( slotGetAllMail() ) ); @@ -109,42 +115,42 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) connect( editSettings2, SIGNAL( activated() ), SLOT( slotEditGlobalSettings() ) ); editAccounts = new QAction( i18n( "Configure accounts" ), SmallIcon("editaccounts") , 0, 0, this ); editAccounts->addTo( settingsMenu ); - codecMenu = new QPopupMenu( menuBar ); + codecMenu = new Q3PopupMenu( menuBar ); codecMenu->insertItem( "Western (iso-8859-1)",0,0); codecMenu->insertItem( "Cyrillic (iso-8859-5)",1,1); codecMenu->insertItem( "Western (iso-8859-15)",2,2); codecMenu->insertItem( "Chinese (big-5)",3,3); codecMenu->insertItem( "Unicode (utf-8)",4,4); codecMenu->insertItem( "Userdefined ("+KOPrefs::instance()->mSendCodec+")",5,5); //disabled //settingsMenu->insertItem( i18n("Codec for new mails"), codecMenu); //setCentralWidget( view ); - QVBox* wrapperBox = new QVBox( this ); + Q3VBox* wrapperBox = new Q3VBox( this ); setCentralWidget( wrapperBox ); // QWidget *view = new QWidget( wrapperBox ); KDGanttMinimizeSplitter* splithor = new KDGanttMinimizeSplitter( Qt::Vertical, wrapperBox); splithor->setMinimizeDirection( KDGanttMinimizeSplitter::Down); KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, splithor); split->setMinimizeDirection( KDGanttMinimizeSplitter::Left); //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); subLE = 0; fromLE = 0; toLE = 0; if ( KOPrefs::instance()->mShowInfoSub || KOPrefs::instance()->mShowInfoFrom || KOPrefs::instance()->mShowInfoTo ) { QWidget* infoBox = new QWidget( splithor ); - QGridLayout *griLay = new QGridLayout( infoBox, 2,2); + Q3GridLayout *griLay = new Q3GridLayout( infoBox, 2,2); if ( KOPrefs::instance()->mShowInfoSub ) { griLay->addWidget( new QLabel ( i18n("Su:"), infoBox ),0,0 ); griLay->addWidget( subLE = new QLineEdit( infoBox ),0,1) ; } if ( KOPrefs::instance()->mShowInfoFrom ) { griLay->addWidget( new QLabel ( i18n("Fr:"), infoBox ),1,0 ); griLay->addWidget( fromLE = new QLineEdit( infoBox ),1,1) ; } @@ -163,28 +169,28 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) folderView->header()->hide(); folderView->setRootIsDecorated( false ); folderView->addColumn( i18n( "Mailbox" ) ); //layout->addWidget( folderView ); mailView = new KListView( split ); mailView->addColumn( i18n( " " ) ); - mailView->addColumn( i18n( "Subject" ),QListView::Manual ); - mailView->addColumn( i18n( "Sender" ),QListView::Manual ); - mailView->addColumn( i18n( "Size" ),QListView::Manual); - mailView->addColumn( i18n( "Date" ),QListView::Manual); + mailView->addColumn( i18n( "Subject" ),Q3ListView::Manual ); + mailView->addColumn( i18n( "Sender" ),Q3ListView::Manual ); + mailView->addColumn( i18n( "Size" ),Q3ListView::Manual); + mailView->addColumn( i18n( "Date" ),Q3ListView::Manual); if ( KOPrefs::instance()->mShowToField ) - mailView->addColumn( i18n( "To" ),QListView::Manual); + mailView->addColumn( i18n( "To" ),Q3ListView::Manual); mailView->setAllColumnsShowFocus(true); //mailView->setSorting(-1); mailView->setRootIsDecorated( false ); statusWidget = new StatusWidget( wrapperBox ); statusWidget->hide(); - mailView->setSelectionMode( QListView::Multi ); + mailView->setSelectionMode( Q3ListView::Multi ); mailView->setMultiSelection( true); mailView->setAlternateBackground(KPimGlobalPrefs::instance()->mAlternateColor ); //layout->addWidget( mailView ); //layout->setStretchFactor( folderView, 1 ); //layout->setStretchFactor( mailView, 2 ); slotAdjustLayout(); #ifndef DESKTOP_VERSION @@ -192,35 +198,35 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); if ( subLE ) QPEApplication::setStylusOperation( subLE ,QPEApplication::RightOnHold); if ( fromLE ) QPEApplication::setStylusOperation( fromLE ,QPEApplication::RightOnHold); if ( toLE ) QPEApplication::setStylusOperation( toLE ,QPEApplication::RightOnHold); #endif - connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, - SLOT( mailLeftClicked(QListViewItem*) ) ); - connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, - SLOT( mailLeftClicked(QListViewItem*) ) ); - connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, - SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); - connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), - this,SLOT(refreshMailView(const QValueList<RecMailP>&))); - - connect( mailView, SIGNAL( currentChanged (QListViewItem* )),this, - SLOT( setInfoFields(QListViewItem*) ) ); + connect( mailView, SIGNAL( doubleClicked (Q3ListViewItem* )),this, + SLOT( mailLeftClicked(Q3ListViewItem*) ) ); + connect( mailView, SIGNAL( returnPressed (Q3ListViewItem* )),this, + SLOT( mailLeftClicked(Q3ListViewItem*) ) ); + connect( mailView, SIGNAL( mouseButtonPressed(int,Q3ListViewItem*,const QPoint&,int) ),this, + SLOT( mailHold(int,Q3ListViewItem*,const QPoint&,int) ) ); + connect(folderView, SIGNAL(refreshMailview(const Q3ValueList<RecMailP>&)), + this,SLOT(refreshMailView(const Q3ValueList<RecMailP>&))); + + connect( mailView, SIGNAL( currentChanged (Q3ListViewItem* )),this, + SLOT( setInfoFields(Q3ListViewItem*) ) ); connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); //mailView->setMultiSelection ( true ); //mailView->setSelectionMode( QListView::Extended ); - QValueList<int> list; + Q3ValueList<int> list; int fw = 100; if ( QApplication::desktop()->width() > 320 ) fw = 50; list.append( fw ); list.append( 100 ); split->setSizes( list ); QTimer::singleShot( 100, this, SLOT( slotAdjustColumns() ) ); mailView->setShowSortIndicator ( true ); @@ -230,17 +236,17 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) QAction* closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); if ( QApplication::desktop()->width() > 320 ) closeMail->addTo(toolBar); closeMail->addTo(mailMenu); - QPopupMenu* helpMenu = new QPopupMenu( menuBar ); + Q3PopupMenu* helpMenu = new Q3PopupMenu( menuBar ); menuBar->insertItem( i18n( "Help" ), helpMenu ); QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this); connect( li, SIGNAL( activated() ), SLOT( showAbout()) ); li->addTo(helpMenu); li = new QAction(i18n("Licence"),QPixmap(), 0, 0, this); connect( li, SIGNAL( activated() ), SLOT( showLicence()) ); li->addTo(helpMenu); li = new QAction(i18n("LibEtPan Licence"), QPixmap(), 0, 0, this); @@ -254,17 +260,17 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) resize ( 640, 480 ); #endif } MainWindow::~MainWindow() { } -void MainWindow::setInfoFields(QListViewItem* item ) +void MainWindow::setInfoFields(Q3ListViewItem* item ) { if ( item == 0) { if ( subLE ) subLE->setText(""); if ( fromLE ) fromLE->setText(""); if ( toLE ) toLE->setText(""); return; } RecMailP mail = ((MailListViewItem*)item)->data(); @@ -340,17 +346,17 @@ void MainWindow::showAbout() KApplication::showText( cap, text ); } void MainWindow::showEtpanLicence() { KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" ); } -void MainWindow::appMessage(const QCString &, const QByteArray &) +void MainWindow::appMessage(const Q3CString &, const QByteArray &) { qDebug("appMessage implemented by subclass"); } void MainWindow::slotAdjustLayout() { /* QWidget *d = QApplication::desktop(); @@ -400,37 +406,37 @@ void MainWindow::slotEditGlobalSettings() { } void MainWindow::slotShowFolders( bool ) { qDebug("not implemented: "); } -void MainWindow::refreshMailView(const QValueList<RecMailP>&) +void MainWindow::refreshMailView(const Q3ValueList<RecMailP>&) { qDebug("not implemented: "); } -void MainWindow::mailLeftClicked(QListViewItem * ) +void MainWindow::mailLeftClicked(Q3ListViewItem * ) { qDebug("not implemented: "); } void MainWindow::displayMail() { qDebug("not implemented: "); } void MainWindow::slotDeleteMail() { qDebug("not implemented: "); } -void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) +void MainWindow::mailHold(int, Q3ListViewItem *,const QPoint&,int ) { qDebug("not implemented: "); } void MainWindow::slotSendQueued() { qDebug("not implemented: "); } diff --git a/kmicromail/mainwindow.h b/kmicromail/mainwindow.h index f65f3b4..1ccadc2 100644 --- a/kmicromail/mainwindow.h +++ b/kmicromail/mainwindow.h @@ -1,74 +1,78 @@ // CHANGED 2004-08-06 Lutz Rogowski #ifndef MAINWINDOW_H #define MAINWINDOW_H -#include <qmainwindow.h> +#include <q3mainwindow.h> +//Added by qt3to4: +#include <Q3CString> +#include <Q3ValueList> +#include <Q3PopupMenu> #include <klistview.h> #include <qaction.h> #include <qlineedit.h> -#include <qtoolbar.h> +#include <q3toolbar.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 +class MainWindow : public Q3MainWindow { Q_OBJECT public: - MainWindow( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); + MainWindow( QWidget *parent = 0, const char *name = 0, Qt::WFlags flags = 0 ); virtual ~MainWindow(); public slots: virtual void slotAdjustColumns(); virtual void slotAdjustColumnsWide(); - virtual void appMessage(const QCString &msg, const QByteArray &data); + virtual void appMessage(const Q3CString &msg, const QByteArray &data); virtual void slotComposeMail(); protected slots: - virtual void setInfoFields(QListViewItem* ); + virtual void setInfoFields(Q3ListViewItem* ); virtual void slotSendQueued(); virtual void slotEditAccounts(); virtual void slotShowFolders( bool show ); - virtual void refreshMailView(const QValueList<RecMailP>&); + virtual void refreshMailView(const Q3ValueList<RecMailP>&); virtual void displayMail(); virtual void slotGetMail() = 0; virtual void slotGetAllMail() = 0; virtual void slotDeleteMail(); virtual void slotDeleteAllMail() = 0; virtual void slotSetCodec(int); - virtual void mailHold(int, QListViewItem *,const QPoint&,int); + virtual void mailHold(int, Q3ListViewItem *,const QPoint&,int); virtual void slotAdjustLayout(); virtual void slotEditSettings(); virtual void slotEditGlobalSettings(); - virtual void mailLeftClicked( QListViewItem * ); + virtual void mailLeftClicked( Q3ListViewItem * ); void showLicence(); void showAbout(); void showEtpanLicence(); protected: - QToolBar *toolBar; + Q3ToolBar *toolBar; StatusWidget *statusWidget; QPEMenuBar *menuBar; - QPopupMenu *mailMenu, *settingsMenu, *codecMenu; + Q3PopupMenu *mailMenu, *settingsMenu, *codecMenu; QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails, *editSettings, *editAccounts, *syncFolders; AccountView *folderView; KListView *mailView; QLineEdit* toLE,*fromLE,*subLE; //QBoxLayout *layout; }; diff --git a/kmicromail/nntpgroups.cpp b/kmicromail/nntpgroups.cpp index c729f79..d2213d4 100644 --- a/kmicromail/nntpgroups.cpp +++ b/kmicromail/nntpgroups.cpp @@ -1,17 +1,17 @@ #include "nntpgroups.h" #include <libmailwrapper/settings.h> -#include <qlistview.h> +#include <q3listview.h> #include <qlineedit.h> using namespace Opie::Core; -NNTPGroups::NNTPGroups(NNTPaccount *account, QWidget* parent, const char* name, WFlags fl) +NNTPGroups::NNTPGroups(NNTPaccount *account, QWidget* parent, const char* name, Qt::WFlags fl) : NNTPGroupsUI(parent,name,fl),subscribedGroups() { m_Account = account; fillGroups(); } NNTPGroups::~NNTPGroups() { @@ -22,41 +22,41 @@ void NNTPGroups::slotGetNG() { if (!m_Account) return; GroupListView->clear(); NNTPwrapper tmp( m_Account ); QString filter = Groupfilteredit->text(); QStringList list = tmp.listAllNewsgroups(filter); subscribedGroupsNotListed = subscribedGroups; for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { - QCheckListItem *item; - item = new QCheckListItem( GroupListView, (*it), QCheckListItem::CheckBox ); + Q3CheckListItem *item; + item = new Q3CheckListItem( GroupListView, (*it), Q3CheckListItem::CheckBox ); if ( subscribedGroups.contains( (*it) ) >= 1 ) { item->setOn( true ); subscribedGroupsNotListed.remove((*it)); } } } void NNTPGroups::fillGroups() { if (!m_Account) return; subscribedGroups = m_Account->getGroups(); for ( QStringList::Iterator it = subscribedGroups.begin(); it != subscribedGroups.end(); ++it ) { - QCheckListItem *item; - item = new QCheckListItem( GroupListView, (*it), QCheckListItem::CheckBox ); + Q3CheckListItem *item; + item = new Q3CheckListItem( GroupListView, (*it), Q3CheckListItem::CheckBox ); item->setOn( true ); } } void NNTPGroups::storeValues() { if (!m_Account) return; - QListViewItemIterator list_it( GroupListView ); + Q3ListViewItemIterator list_it( GroupListView ); subscribedGroups.clear(); for ( ; list_it.current(); ++list_it ) { - if ( ( (QCheckListItem*)list_it.current() )->isOn() ) { + if ( ( (Q3CheckListItem*)list_it.current() )->isOn() ) { subscribedGroups.append( list_it.current()->text(0) ); } } subscribedGroups+=subscribedGroupsNotListed; m_Account->setGroups( subscribedGroups ); } diff --git a/kmicromail/nntpgroups.h b/kmicromail/nntpgroups.h index e5b7c35..80cc329 100644 --- a/kmicromail/nntpgroups.h +++ b/kmicromail/nntpgroups.h @@ -7,17 +7,17 @@ class NNTPaccount; class QStringList; class NNTPGroups:public NNTPGroupsUI { Q_OBJECT public: - NNTPGroups(NNTPaccount *account, QWidget* parent = 0, const char* name = 0, WFlags fl = 0); + NNTPGroups(NNTPaccount *account, QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0); virtual ~NNTPGroups(); /* must be called from external. * it will store the new subscription list into the account * but don't save them, this must be done by the calling class. */ void storeValues(); protected slots: diff --git a/kmicromail/nntpgroupsdlg.cpp b/kmicromail/nntpgroupsdlg.cpp index f564b10..bfe1d35 100644 --- a/kmicromail/nntpgroupsdlg.cpp +++ b/kmicromail/nntpgroupsdlg.cpp @@ -1,22 +1,24 @@ #include "nntpgroupsdlg.h" #include "nntpgroups.h" #include <klocale.h> #include <libmailwrapper/settings.h> #include <qlayout.h> +//Added by qt3to4: +#include <Q3VBoxLayout> NNTPGroupsDlg::NNTPGroupsDlg(NNTPaccount *account,QWidget * parent, const char * name) : QDialog(parent,name,true,0) { setCaption(i18n("Subscribed newsgroups")); m_Account = account; - QVBoxLayout*dlglayout = new QVBoxLayout(this); + Q3VBoxLayout*dlglayout = new Q3VBoxLayout(this); dlglayout->setSpacing(2); dlglayout->setMargin(1); groupsWidget = new NNTPGroups(account,this); dlglayout->addWidget(groupsWidget); } NNTPGroupsDlg::~NNTPGroupsDlg() { diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index 75a75b9..f453be5 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp @@ -1,14 +1,19 @@ // CHANGED 2004-09-31 Lutz Rogowski // CHANGED 2004-08-06 Lutz Rogowski #define protected public #include <qwidget.h> +//Added by qt3to4: +#include <Q3ValueList> +#include <Q3CString> +#include <QPixmap> +#include <Q3PopupMenu> #undef protected #include "koprefsdialog.h" #include <kapplication.h> #include <libkdepim/externalapphandler.h> #include <libkdepim/kpimglobalprefs.h> #ifdef MINIKDE_KDIALOG_H #undef MINIKDE_KDIALOG_H #endif @@ -22,17 +27,17 @@ #include "selectsmtp.h" #include "accountitem.h" #include "accountview.h" #include "klocale.h" #include <qmessagebox.h> #include <qtimer.h> #include <qcursor.h> -#include <qtextbrowser.h> +#include <q3textbrowser.h> #include <qregexp.h> #include <qpe/global.h> #ifdef DESKTOP_VERSION #include <qapplication.h> #else #include <qpe/qpeapplication.h> #endif @@ -58,54 +63,54 @@ OpieMail::OpieMail( QWidget *parent, const char *name ) OpieMail::~OpieMail() { if (settings) delete settings; if ( tb ) delete tb; } -void OpieMail::appMessage(const QCString &msg, const QByteArray &data) +void OpieMail::appMessage(const Q3CString &msg, const QByteArray &data) { } #include <stdlib.h> -void OpieMail::message(const QCString &msg, const QByteArray &data) +void OpieMail::message(const Q3CString &msg, const QByteArray &data) { // copied from old mail2 static int ii = 0; //qDebug("QCOP CALL ############################# %d ", ii); //QString mess ( msg ); //qDebug("Message = %s ",mess.latin1()); ++ii; //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this); mPendingEmail = QString::null; mPendingName = QString::null; if (msg == "writeMail(QString,QString)") { //qDebug("writeMail(QString,QString) "); - QDataStream stream(data,IO_ReadOnly); + QDataStream stream(data,QIODevice::ReadOnly); stream >> mPendingName >> mPendingEmail; // removing the whitespaces at beginning and end is needed! QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); } else if (msg == "newMail()") { //qDebug("slotComposeMail() "); // we cannot call slotComposeMail(); directly, because may be executing a QCOP call // and a QCOP call does not like a processevents in his execution // with the Qtimer we call slotComposeMail() after we reached the main event loop QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); // slotComposeMail(); } else if (msg == "newMail(QString)") { //qDebug(" newMail(QString)"); - QDataStream stream(data,IO_ReadOnly); + QDataStream stream(data,QIODevice::ReadOnly); stream >> mPendingName; // the format is // NAME <EMAIL>:SUBJECT QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); } else { mPendingData = data; mPendingMessage = msg; QTimer::singleShot ( 50, this, SLOT(slotExtAppHandler() ) ); @@ -274,17 +279,17 @@ void OpieMail::slotEditAccounts() if ( settings ) delete settings; settings = new Settings(); folderView->populate( settings->getAccounts() ); } void OpieMail::replyMail() { - QListViewItem*item = mailView->currentItem(); + Q3ListViewItem*item = mailView->currentItem(); if (!item) return; RecMailP mail = ((MailListViewItem*)item)->data(); RecBodyP body = folderView->fetchBody(mail); QString rtext; rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose .arg( mail->getFrom()) .arg( mail->getDate()); @@ -326,17 +331,17 @@ void OpieMail::replyMail() } void OpieMail::closeViewMail(ViewMail * vm) { vm->hide(); } void OpieMail::slotDownloadMail( ) { - QListViewItem*item = mailView->currentItem(); + Q3ListViewItem*item = mailView->currentItem(); if (!item ) { Global::statusMessage("Error: No item slected!"); return; } RecMailP mail = ((MailListViewItem*)item)->data(); Account * acc = mail->Wrapper()->getAccount(); if ( !acc ) { Global::statusMessage("Mail is already stored locally!"); @@ -367,17 +372,17 @@ void OpieMail::slotDownloadMail( ) } else { Global::statusMessage("Error: Cannot fetch mail!"); } } void OpieMail::deleteAndDisplayNextMail(ViewMail * vm) { - QListViewItem*item = mailView->currentItem(); + Q3ListViewItem*item = mailView->currentItem(); if (!item ) { closeViewMail(vm); return; } RecMailP mail = ((MailListViewItem*)item)->data(); mail->Wrapper()->deleteMail( mail ); item = item->itemBelow(); if (!item ) { @@ -387,33 +392,33 @@ void OpieMail::deleteAndDisplayNextMail(ViewMail * vm) mailView->setCurrentItem(item); mail = ((MailListViewItem*)item)->data(); RecBodyP body = folderView->fetchBody(mail); vm->setBody( body ); vm->setMail( mail ); } void OpieMail::displayNextMail(ViewMail * vm) { - QListViewItem*item = mailView->currentItem(); + Q3ListViewItem*item = mailView->currentItem(); if (!item) return; ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); item = item->itemBelow(); if (!item) { vm->setCaption(i18n("End of List" )); return; } mailView->setCurrentItem(item); RecMailP mail = ((MailListViewItem*)item)->data(); RecBodyP body = folderView->fetchBody(mail); vm->setBody( body ); vm->setMail( mail ); } void OpieMail::displayMail() { - QListViewItem*item = mailView->currentItem(); + Q3ListViewItem*item = mailView->currentItem(); if (!item) return; RecMailP mail = ((MailListViewItem*)item)->data(); RecBodyP body = folderView->fetchBody(mail); ViewMail readMail( this,"", Qt::WType_Modal ); readMail.setBody( body ); readMail.setMail( mail ); #ifndef DESKTOP_VERSION readMail.showMaximized(); @@ -427,49 +432,49 @@ void OpieMail::displayMail() readMail.exec(); if ( readMail.deleted ) { folderView->refreshCurrent(); } else { - QListViewItem*item = mailView->currentItem(); + Q3ListViewItem*item = mailView->currentItem(); if (item) ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); } } void OpieMail::slotGetAllMail() { - QListViewItem * item = folderView->firstChild(); + Q3ListViewItem * item = folderView->firstChild(); while ( item ){ ((AccountViewItem *)item)->contextMenuSelected( 101 ); item = item->nextSibling (); } } void OpieMail::slotGetMail() { - QListViewItem * item = folderView->currentItem(); + Q3ListViewItem * item = folderView->currentItem(); if ( ! item ) return; ((AccountViewItem *)item)->contextMenuSelected( 101 ); } void OpieMail::slotDeleteMail() { if (!mailView->currentItem()) return; RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) { mail->Wrapper()->deleteMail( mail ); folderView->refreshCurrent(); } } void OpieMail::slotDeleteAllMail() { - QValueList<RecMailP> t; + Q3ValueList<RecMailP> t; if ( QMessageBox::warning(this, i18n("Delete All Mails"), i18n("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) { MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); while ( item ) { if ( item->isSelected() ) { t.append( item->data() ); } item = (MailListViewItem*)item->nextSibling(); @@ -487,31 +492,31 @@ void OpieMail::slotDeleteAllMail() } void OpieMail::clearSelection() { mailView->clearSelection(); } void OpieMail::selectAll() { - QListViewItem* item = mailView->firstChild (); + Q3ListViewItem* item = mailView->firstChild (); while ( item ) { mailView->setSelected ( item, true ); item = item->nextSibling(); } } -void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) +void OpieMail::mailHold(int button, Q3ListViewItem *item,const QPoint&,int ) { if (!mailView->currentItem()) return; MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType(); /* just the RIGHT button - or hold on pda */ if (button!=2) {return;} if (!item) return; - QPopupMenu *m = new QPopupMenu(0); + Q3PopupMenu *m = new Q3PopupMenu(0); if (m) { if (mailtype==MAILLIB::A_NNTP) { m->insertItem(i18n("Read this posting"),this,SLOT(displayMail())); m->insertItem(i18n("Copy this posting"),this,SLOT(slotMoveCopyMail())); m->insertSeparator(); m->insertItem(i18n("Copy all selected postings"),this,SLOT(slotMoveCopyAllMail())); m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection())); @@ -548,32 +553,32 @@ void OpieMail::slotShowFolders( bool show ) else if ( !show && !folderView->isHidden() ) { slotAdjustColumnsWide(); folderView->hide(); //slotAdjustColumnsWide(); } } -void OpieMail::refreshMailView(const QValueList<RecMailP>&list) +void OpieMail::refreshMailView(const Q3ValueList<RecMailP>&list) { MailListViewItem*item = 0; mailView->clear(); - QValueList<RecMailP>::ConstIterator it; + Q3ValueList<RecMailP>::ConstIterator it; for (it = list.begin(); it != list.end();++it) { item = new MailListViewItem(mailView,item); item->storeData((*it)); item->showEntry(); } mailView->setSorting ( 4, false ); } -void OpieMail::mailLeftClicked( QListViewItem *item ) +void OpieMail::mailLeftClicked( Q3ListViewItem *item ) { mailView->clearSelection(); /* just LEFT button - or tap with stylus on pda */ //if (button!=1) return; if (!item) return; if (folderView->currentisDraft()) { reEditMail(); } else { @@ -609,17 +614,17 @@ void OpieMail::slotMoveCopyMail() mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails()); folderView->refreshCurrent(); } void OpieMail::slotMoveCopyAllMail() { if (!mailView->currentItem()) return; - QValueList<RecMailP> t; + Q3ValueList<RecMailP> t; // if ( QMessageBox::warning(this, i18n("Move/Copy all selected mails"), i18n("Do you really want to copy/move\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) { MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); while ( item ) { if ( item->isSelected() ) { t.append( item->data() ); } item = (MailListViewItem*)item->nextSibling(); diff --git a/kmicromail/opiemail.h b/kmicromail/opiemail.h index bdd9058..ea64dc4 100644 --- a/kmicromail/opiemail.h +++ b/kmicromail/opiemail.h @@ -4,16 +4,19 @@ #include "mainwindow.h" #include <libmailwrapper/settings.h> #include <opie2/osmartpointer.h> #include <libmailwrapper/mailtypes.h> #include <viewmail.h> #include <qstringlist.h> +//Added by qt3to4: +#include <Q3CString> +#include <Q3ValueList> class ComposeMail; class OpieMail : public MainWindow { Q_OBJECT public: @@ -21,48 +24,48 @@ public: virtual ~OpieMail(); static QString appName() { return QString::fromLatin1("kopiemail"); } public slots: virtual void slotwriteMail(const QString&name,const QString&email); virtual void slotwriteMail2(const QString&nameemail); virtual void slotComposeMail(); virtual void slotExtAppHandler(); - virtual void appMessage(const QCString &msg, const QByteArray &data); - virtual void message(const QCString &msg, const QByteArray &data); + virtual void appMessage(const Q3CString &msg, const QByteArray &data); + virtual void message(const Q3CString &msg, const QByteArray &data); void insertAttendees(const QString&, const QStringList& namelist, const QStringList& emaillist, const QStringList& uidlist); protected slots: virtual void deleteAndDisplayNextMail(ViewMail * vm); virtual void displayNextMail(ViewMail * vm); virtual void slotSendQueued(); virtual void slotSearchMails(); virtual void slotEditSettings(); virtual void slotEditGlobalSettings(); virtual void slotEditAccounts(); virtual void displayMail(); virtual void replyMail(); virtual void slotDeleteMail(); virtual void slotGetMail(); virtual void slotGetAllMail(); virtual void slotDeleteAllMail(); - virtual void mailHold(int, QListViewItem *,const QPoint&,int); + virtual void mailHold(int, Q3ListViewItem *,const QPoint&,int); virtual void slotShowFolders( bool show ); - virtual void refreshMailView(const QValueList<RecMailP>&); - virtual void mailLeftClicked( QListViewItem * ); + virtual void refreshMailView(const Q3ValueList<RecMailP>&); + virtual void mailLeftClicked( Q3ListViewItem * ); virtual void slotMoveCopyMail(); virtual void slotMoveCopyAllMail(); virtual void reEditMail(); void clearSelection(); void selectAll(); void slotDownloadMail(); private: ComposeMail* mCurrentComposer; void closeViewMail(ViewMail * vm); QString mPendingEmail; QString mPendingName; QByteArray mPendingData; - QCString mPendingMessage; + Q3CString mPendingMessage; Settings *settings; - QTextBrowser * tb; + Q3TextBrowser * tb; }; #endif diff --git a/kmicromail/qpe/qdialog.h b/kmicromail/qpe/qdialog.h index c63133d..3720182 100644 --- a/kmicromail/qpe/qdialog.h +++ b/kmicromail/qpe/qdialog.h @@ -9,17 +9,17 @@ #warning please adjust your path here! #include "/usr/local/qt/include/qdialog.h" class QDialog_hacked : public QDialog { //Q__OBJECT public: - QDialog_hacked ( QWidget * parent=0, const char * name=0, bool modal=true, WFlags f=0 ); + QDialog_hacked ( QWidget * parent=0, const char * name=0, bool modal=true, Qt::WFlags f=0 ); }; #define QDialog QDialog_hacked #endif #else diff --git a/kmicromail/qpe/qdialog_hacked.cpp b/kmicromail/qpe/qdialog_hacked.cpp index 0a34cec..5d4d353 100644 --- a/kmicromail/qpe/qdialog_hacked.cpp +++ b/kmicromail/qpe/qdialog_hacked.cpp @@ -1,24 +1,24 @@ #include <qdialog.h> -#include <qhbox.h> +#include <q3hbox.h> #include <qpushbutton.h> #include <klocale.h> #ifdef QDialog #undef QDialog #endif - QDialog_hacked::QDialog_hacked ( QWidget * parent, const char * name, bool modal, WFlags f ) + QDialog_hacked::QDialog_hacked ( QWidget * parent, const char * name, bool modal, Qt::WFlags f ) : QDialog( parent,name,modal, f) { qDebug("New hacked QDialog for ompi desktop"); //QTimer::singleShot( 1, this,SLOT(addaddbuttons()) ); setOrientation ( Vertical ); - QHBox * hb = new QHBox ( this ); + Q3HBox * hb = new Q3HBox ( this ); QPushButton *ok = new QPushButton( i18n("OK"), hb ); QPushButton *cancel = new QPushButton( i18n("Cancel"), hb ); setExtension ( hb ); showExtension ( true ); connect ( ok, SIGNAL ( clicked()),this, SLOT (accept() ) ); connect ( cancel, SIGNAL ( clicked()),this, SLOT (reject() ) ); //setWFlags(WStyle_MinMax ); diff --git a/kmicromail/selectsmtp.cpp b/kmicromail/selectsmtp.cpp index 10b6d79..ead723c 100644 --- a/kmicromail/selectsmtp.cpp +++ b/kmicromail/selectsmtp.cpp @@ -3,19 +3,19 @@ #include <qcombobox.h> #include <qcheckbox.h> #include <qmessagebox.h> #include <qpushbutton.h> #include <qlineedit.h> #include <qlabel.h> #include <qtabwidget.h> -#include <qlistview.h> +#include <q3listview.h> #include <klocale.h> -selectsmtp::selectsmtp(QWidget* parent, const char* name, bool modal, WFlags fl) +selectsmtp::selectsmtp(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : selectstoreui(parent,name,modal,fl) { //m_smtpList.setAutoDelete(false); m_smtpList = 0; //headlabel->setText(i18n("<center>Select SMTP account to use</center>")); headlabel->hide(); folderSelection->hide(); folderLabel->hide(); diff --git a/kmicromail/selectsmtp.h b/kmicromail/selectsmtp.h index 9157ddf..d7accf6 100644 --- a/kmicromail/selectsmtp.h +++ b/kmicromail/selectsmtp.h @@ -6,17 +6,17 @@ #include <qlist.h> class SMTPaccount; class selectsmtp : public selectstoreui { Q_OBJECT public: - selectsmtp(QWidget* parent = 0, const char* name = 0, bool modal = TRUE, WFlags fl = 0 ); + selectsmtp(QWidget* parent = 0, const char* name = 0, bool modal = TRUE, Qt::WFlags fl = 0 ); virtual ~selectsmtp(); void setSelectionlist(QList<SMTPaccount>*list); SMTPaccount*selected_smtp(); protected: QList<SMTPaccount>*m_smtpList; SMTPaccount*m_current_smtp; diff --git a/kmicromail/selectstore.h b/kmicromail/selectstore.h index 447a6ae..d312c1d 100644 --- a/kmicromail/selectstore.h +++ b/kmicromail/selectstore.h @@ -1,13 +1,13 @@ #ifndef _SELECTSTORE_H #define _SELECTSTORE_H #include "selectstoreui.h" -#include <qvaluelist.h> +#include <q3valuelist.h> #include <qmap.h> #include <qstringlist.h> class AbstractMail; class Selectstore:public selectstoreui { Q_OBJECT diff --git a/kmicromail/settingsdialog.cpp b/kmicromail/settingsdialog.cpp index c593b48..889c490 100644 --- a/kmicromail/settingsdialog.cpp +++ b/kmicromail/settingsdialog.cpp @@ -1,29 +1,31 @@ #include <qcheckbox.h> #include <qspinbox.h> #include <qlayout.h> #include <qtabwidget.h> +//Added by qt3to4: +#include <Q3GridLayout> #include <kconfig.h> #include <kprefs.h> #include <klocale.h> #include <kglobal.h> #include <kfontdialog.h> #include "settingsdialog.h" -SettingsDialog::SettingsDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) +SettingsDialog::SettingsDialog( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) : SettingsDialogUI( parent, name, modal, fl ) { #if 0 QTabWidget *topFrame = TabWidget2; - QGridLayout *topLayout = new QGridLayout(topFrame,3,3); + Q3GridLayout *topLayout = new Q3GridLayout(topFrame,3,3); topLayout->setSpacing(2); topLayout->setMargin(3); KPrefsWidFont * tVFont; int i = 0; KPrefsWidFont *timeLabelsFont = addWidFont(i18n("OK"),i18n("Application(nr):"), &(mAppFont),topFrame); topLayout->addWidget(timeLabelsFont->label(),i,0); diff --git a/kmicromail/settingsdialog.h b/kmicromail/settingsdialog.h index 042b69f..b168226 100644 --- a/kmicromail/settingsdialog.h +++ b/kmicromail/settingsdialog.h @@ -6,17 +6,17 @@ #include "settingsdialogui.h" class SettingsDialog : public SettingsDialogUI { Q_OBJECT public: - SettingsDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + SettingsDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); ~SettingsDialog(); private: void readConfig(); void writeConfig(); QFont mAppFont, mComposeFont, mReadFont; private slots: diff --git a/kmicromail/statuswidget.cpp b/kmicromail/statuswidget.cpp index 19cf635..6da6f54 100644 --- a/kmicromail/statuswidget.cpp +++ b/kmicromail/statuswidget.cpp @@ -1,18 +1,18 @@ #include <qtimer.h> -#include <qprogressbar.h> +#include <q3progressbar.h> #include <qlabel.h> #include "statuswidget.h" // the current problem I see is "locking": used exclusive by one sender -StatusWidget::StatusWidget( QWidget* parent, const char* name,WFlags fl ) +StatusWidget::StatusWidget( QWidget* parent, const char* name,Qt::WFlags fl ) : StatusWidgetUI( parent, name, fl ) { setMaximumHeight( 15 ); // hide for now since nothing reports decent progress data yet. statusProgress->hide(); } StatusWidget::~StatusWidget() { diff --git a/kmicromail/statuswidget.h b/kmicromail/statuswidget.h index 73f0d75..1d29daf 100644 --- a/kmicromail/statuswidget.h +++ b/kmicromail/statuswidget.h @@ -4,17 +4,17 @@ #include <qwidget.h> #include "statuswidgetui.h" class StatusWidget : public StatusWidgetUI { Q_OBJECT public: - StatusWidget( QWidget* parent = 0, const char* name = 0,WFlags fl = 0 ); + StatusWidget( QWidget* parent = 0, const char* name = 0,Qt::WFlags fl = 0 ); ~StatusWidget(); public slots: void setText( const QString& text ); void setProgress( int progress ); }; diff --git a/kmicromail/viewmail.cpp b/kmicromail/viewmail.cpp index 685b4e4..c9dedb0 100644 --- a/kmicromail/viewmail.cpp +++ b/kmicromail/viewmail.cpp @@ -19,65 +19,68 @@ #include <libmailwrapper/abstractmail.h> #include <libmailwrapper/mailtypes.h> #include <qdialog.h> #include <qpe/qpeapplication.h> /* QT */ -#include <qtextbrowser.h> +#include <q3textbrowser.h> #include <qmessagebox.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qaction.h> -#include <qpopupmenu.h> +#include <q3popupmenu.h> #include <qfile.h> #include <qlayout.h> +//Added by qt3to4: +#include <Q3ValueList> +#include <Q3VBoxLayout> //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) +AttachItem::AttachItem(Q3ListView * parent,Q3ListViewItem *after, const QString&mime,const QString&desc,const QString&file, + const QString&fsize,int num,const Q3ValueList<int>&path) + : Q3ListViewItem(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) +AttachItem::AttachItem(Q3ListViewItem * parent,Q3ListViewItem *after, const QString&mime,const QString&desc,const QString&file, + const QString&fsize,int num,const Q3ValueList<int>&path) + : Q3ListViewItem(parent,after),_partNum(num) { _path=path; setText(0, mime); setText(1, desc); setText(2, file); setText(3, fsize); } -bool AttachItem::isParentof(const QValueList<int>&path) +bool AttachItem::isParentof(const Q3ValueList<int>&path) { /* if not set, then no parent */ if (path.count()==0||_path.count()==0) return false; /* the parent must have one digit less then a child */ if (path.count()!=_path.count()+1) return false; for (unsigned int i=0; i < _path.count();++i) { if (_path[i]!=path[i]) return false; } return true; } -AttachItem* ViewMail::searchParent(const QValueList<int>&path) +AttachItem* ViewMail::searchParent(const Q3ValueList<int>&path) { - QListViewItemIterator it( attachments ); + Q3ListViewItemIterator it( attachments ); for ( ; it.current(); ++it ) { AttachItem*ati = (AttachItem*)it.current(); if (ati->isParentof(path)) return ati; } return 0; } @@ -149,17 +152,17 @@ void ViewMail::setBody(const RecBodyP&body ) { /* I did not found a method to make a CONTENT reset on a QTextStream so I use this construct that the stream will re-constructed in each loop. To let it work, the textstream is packed into a own area of code is it will be destructed after finishing its small job. */ QTextOStream o(&fsize); if (w>0) o.precision(2); else o.precision(0); - o.setf(QTextStream::fixed); + o.setf(Q3TextStream::fixed); o << s << " " << q << "Byte"; } curItem=new AttachItem(attachments,curItem,type,"Mailbody","",fsize,-1,body->Description()->Positionlist()); QString filename = ""; for (unsigned int i = 0; i < body->Parts().count();++i) { @@ -190,17 +193,17 @@ void ViewMail::setBody(const RecBodyP&body ) q="M"; break; default: q=""; break; } QTextOStream o(&fsize); if (w>0) o.precision(2); else o.precision(0); - o.setf(QTextStream::fixed); + o.setf(Q3TextStream::fixed); o << s << " " << q << "Byte"; desc = body->Parts()[i]->Description(); parentItem = searchParent(body->Parts()[i]->Positionlist()); if (parentItem) { AttachItem*temp = lastChild(parentItem); if (temp) curItem = temp; curItem=new AttachItem(parentItem,curItem,type,desc,filename,fsize,i,body->Parts()[i]->Positionlist()); @@ -234,27 +237,27 @@ void ViewMail::slotViewSource() } void ViewMail::slotShowHtml( bool state ) { m_showHtml = state; setText(); } -void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ) +void ViewMail::slotItemClicked( Q3ListViewItem * item , const QPoint & point, int ) { if (!item ) return; if ( ( ( AttachItem* )item )->Partnumber() == -1 ) { setText(); return; } - QPopupMenu *menu = new QPopupMenu(); + Q3PopupMenu *menu = new Q3PopupMenu(); int ret=0; if ( item->text( 0 ).left( 5 ) == "text/" || item->text(0)=="message/rfc822" ) { menu->insertItem( i18n( "Show Text" ), 1 ); } if (item->text(0).left(6)=="image/") { menu->insertItem(i18n("Display image preview"),2); @@ -273,17 +276,17 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int QString str = KFileDialog::getSaveFileName( "/", item->text( 2 ), this ); if( !str.isEmpty() ) { encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); if (content) { QFile output(str); - output.open(IO_WriteOnly); + output.open(QIODevice::WriteOnly); output.writeBlock(content->Content(),content->Length()); output.close(); delete content; } } } break ; @@ -292,17 +295,17 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int #ifdef DESKTOP_VERSION QString tmpfile = locateLocal( "tmp", "opiemail-image"); #else QString tmpfile = "/tmp/opiemail-image"; #endif encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); if (content) { QFile output(tmpfile); - output.open(IO_WriteOnly); + output.open(QIODevice::WriteOnly); output.writeBlock(content->Content(),content->Length()); output.close(); delete content; MailImageDlg iview(""); iview.setName(tmpfile); KApplication::execDialog(&iview); output.remove(); } @@ -347,34 +350,34 @@ void ViewMail::slotNextMail() { nextMail->blockSignals( true ); setCaption(i18n("Displaying next mail...please wait!")); qApp->processEvents(); emit showNextMail(this); nextMail->blockSignals( false ); } -ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) +ViewMail::ViewMail( QWidget *parent, const char *name, Qt::WFlags fl) : ViewMailBase(parent, name, fl), _inLoop(false) { m_gotBody = false; deleted = false; sourceOn = false; readConfig(); connect( reply, SIGNAL(activated()), SLOT(slotReply())); connect( forward, SIGNAL(activated()), SLOT(slotForward())); connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail() ) ); connect( showHtml, SIGNAL( toggled(bool) ), SLOT( slotShowHtml(bool) ) ); connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); connect( nextMail, SIGNAL( activated() ), SLOT( slotNextMail() ) ); connect( viewSource, SIGNAL( activated() ), SLOT( slotViewSource() ) ); connect( downloadMail, SIGNAL( activated() ), SIGNAL( signalDownloadMail() ) ); attachments->setEnabled(m_gotBody); - connect( attachments, SIGNAL( clicked(QListViewItem*,const QPoint&, int) ), SLOT( slotItemClicked(QListViewItem*,const QPoint&, int) ) ); + connect( attachments, SIGNAL( clicked(Q3ListViewItem*,const QPoint&, int) ), SLOT( slotItemClicked(Q3ListViewItem*,const QPoint&, int) ) ); attachments->setSorting(-1); } void ViewMail::readConfig() { setFont ( KOPrefs::instance()->mReadFont ); @@ -552,20 +555,20 @@ void ViewMail::slotDeleteMail( ) { emit deleteAndDisplayNextMail( this); //m_recMail->Wrapper()->deleteMail( m_recMail ); //hide(); deleted = true; } } -MailImageDlg::MailImageDlg(const QString&fname,QWidget *parent, const char *name, bool modal, WFlags f) +MailImageDlg::MailImageDlg(const QString&fname,QWidget *parent, const char *name, bool modal, Qt::WFlags f) : QDialog(parent,name,modal) { - QVBoxLayout*dlglayout = new QVBoxLayout(this); + Q3VBoxLayout*dlglayout = new Q3VBoxLayout(this); dlglayout->setSpacing(2); dlglayout->setMargin(1); //m_imageview = new Opie::MM::OImageScrollView(this); //dlglayout->addWidget(m_imageview); } MailImageDlg::~MailImageDlg() { diff --git a/kmicromail/viewmail.h b/kmicromail/viewmail.h index bb5b685..6cf6efb 100644 --- a/kmicromail/viewmail.h +++ b/kmicromail/viewmail.h @@ -2,68 +2,68 @@ #define VIEWMAIL_H #include "viewmailbase.h" #include <libmailwrapper/mailtypes.h> #include <qdialog.h> #include <qapplication.h> -#include <qlistview.h> +#include <q3listview.h> #include <qmap.h> #include <klocale.h> #include <qstringlist.h> -#include <qvaluelist.h> +#include <q3valuelist.h> //namespace Opie { namespace MM { class OImageScrollView; } } -class AttachItem : public QListViewItem +class AttachItem : public Q3ListViewItem { 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); + AttachItem(Q3ListView * parent,Q3ListViewItem *after, const QString&mime,const QString&desc,const QString&file, + const QString&fsize,int num,const Q3ValueList<int>&path); + AttachItem(Q3ListViewItem * parent,Q3ListViewItem *after, const QString&mime,const QString&desc,const QString&file, + const QString&fsize,int num,const Q3ValueList<int>&path); int Partnumber() { return _partNum; } - bool isParentof(const QValueList<int>&path); + bool isParentof(const Q3ValueList<int>&path); private: int _partNum; /* needed for a better display of attachments */ - QValueList<int> _path; + Q3ValueList<int> _path; }; class ViewMail : public ViewMailBase { Q_OBJECT public: - ViewMail( QWidget *parent = 0, const char *name = 0, WFlags fl = 0); + ViewMail( QWidget *parent = 0, const char *name = 0, Qt::WFlags fl = 0); ~ViewMail(); void hide(); void exec(); void setMail(const RecMailP&mail ); void setBody(const RecBodyP&body); bool deleted; signals: void showNextMail(ViewMail*); void deleteAndDisplayNextMail(ViewMail *); void signalDownloadMail(); protected: QString deHtml(const QString &string); - AttachItem* searchParent(const QValueList<int>&path); + AttachItem* searchParent(const Q3ValueList<int>&path); AttachItem* lastChild(AttachItem*parent); protected slots: void slotNextMail(); void slotReply(); void slotForward(); void setText(); - void slotItemClicked( QListViewItem * item , const QPoint & point, int c ); + void slotItemClicked( Q3ListViewItem * item , const QPoint & point, int c ); void slotDeleteMail( ); void slotShowHtml( bool ); void slotViewSource(); private: void readConfig(); bool sourceOn;; bool _inLoop; @@ -78,16 +78,16 @@ private: // 0 to 1 cc 2 bcc QMap <int,QStringList> m_mail2; }; class MailImageDlg:public QDialog { Q_OBJECT public: - MailImageDlg(const QString&,QWidget *parent = 0, const char *name = 0, bool modal = true, WFlags f = 0); + MailImageDlg(const QString&,QWidget *parent = 0, const char *name = 0, bool modal = true, Qt::WFlags f = 0); ~MailImageDlg(); void setName(const QString&); protected: //Opie::MM::OImageScrollView*m_imageview; }; #endif diff --git a/kmicromail/viewmailbase.cpp b/kmicromail/viewmailbase.cpp index 3bb964e..371ee91 100644 --- a/kmicromail/viewmailbase.cpp +++ b/kmicromail/viewmailbase.cpp @@ -1,34 +1,37 @@ // CHANGED 2004-08-06 Lutz Rogowski -#include <qtextbrowser.h> -#include <qlistview.h> +#include <q3textbrowser.h> +#include <q3listview.h> #include <qaction.h> #include <qlabel.h> -#include <qvbox.h> +#include <q3vbox.h> #include <qapplication.h> -#include <qtoolbar.h> +#include <q3toolbar.h> #include <qmenubar.h> +//Added by qt3to4: +#include <QKeyEvent> +#include <Q3PopupMenu> #include <kiconloader.h> //#include <qpe/resource.h> #include <klocale.h> #include "viewmailbase.h" //#include "opendiag.h" -ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl) - : QMainWindow(parent, name, fl) +ViewMailBase::ViewMailBase(QWidget *parent, const char *name, Qt::WFlags fl) + : Q3MainWindow(parent, name, fl) { setToolBarsMovable(false); - toolbar = new QToolBar(this); + toolbar = new Q3ToolBar(this); menubar = new QMenuBar( toolbar ); - mailmenu = new QPopupMenu( menubar ); + mailmenu = new Q3PopupMenu( menubar ); menubar->insertItem( i18n( "Mail" ), mailmenu ); toolbar->setHorizontalStretchable(true); addToolBar(toolbar); viewSource = new QAction(i18n("View Source"), 0, 0, this); viewSource->addTo(mailmenu); @@ -64,33 +67,33 @@ ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl) nextMail->addTo(mailmenu); closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); //QLabel *spacer = new QLabel(toolbar); spacer->setBackgroundMode(QWidget::PaletteButton); toolbar->setStretchableWidget(spacer); closeMail->addTo(toolbar); closeMail->addTo(mailmenu); - QVBox *view = new QVBox(this); + Q3VBox *view = new Q3VBox(this); setCentralWidget(view); - attachments = new QListView(view); + attachments = new Q3ListView(view); int fixh = 100; if ( QApplication::desktop()->width() > 320 ) fixh = 200; attachments->setFixedHeight(fixh); attachments->setAllColumnsShowFocus(true); attachments->addColumn("Mime Type", fixh-30); attachments->addColumn(i18n("Description"), 100); attachments->addColumn(i18n("Filename"), 80); attachments->addColumn(i18n("Size"), 80); attachments->setSorting(-1); attachments->hide(); - browser = new QTextBrowser(view); + browser = new Q3TextBrowser(view); // openDiag = new OpenDiag(view); // openDiag->hide(); } void ViewMailBase::slotChangeAttachview(bool state) { diff --git a/kmicromail/viewmailbase.h b/kmicromail/viewmailbase.h index 7c075eb..3f1dead 100644 --- a/kmicromail/viewmailbase.h +++ b/kmicromail/viewmailbase.h @@ -1,42 +1,45 @@ // CHANGED 2004-08-06 Lutz Rogowski #ifndef VIEWMAILBASE_H #define VIEWMAILBASE_H -#include <qmainwindow.h> +#include <q3mainwindow.h> +//Added by qt3to4: +#include <Q3PopupMenu> +#include <QKeyEvent> #ifndef DESKTOP_VERSION #include <qpe/qpemenubar.h> #define QMenuBar QPEMenuBar #endif class QAction; class OpenDiag; -class QListView; -class QToolBar; -class QTextBrowser; +class Q3ListView; +class Q3ToolBar; +class Q3TextBrowser; class QMenuBar; -class QPopupMenu; +class Q3PopupMenu; -class ViewMailBase : public QMainWindow +class ViewMailBase : public Q3MainWindow { Q_OBJECT public: - ViewMailBase(QWidget *parent = 0, const char *name = 0, WFlags fl = 0); + ViewMailBase(QWidget *parent = 0, const char *name = 0, Qt::WFlags fl = 0); protected: QAction *reply, *forward, *attachbutton, *deleteMail, *showHtml, *closeMail, *nextMail, *downloadMail, *viewSource; - QListView *attachments; - QToolBar *toolbar; - QTextBrowser *browser; + Q3ListView *attachments; + Q3ToolBar *toolbar; + Q3TextBrowser *browser; OpenDiag *openDiag; QMenuBar *menubar; - QPopupMenu *mailmenu; + Q3PopupMenu *mailmenu; protected slots: void slotChangeAttachview(bool state); virtual void keyPressEvent ( QKeyEvent * e ); }; |