diff --git a/kbusyptr.cpp b/kbusyptr.cpp index dea47e95d..ee30428a3 100644 --- a/kbusyptr.cpp +++ b/kbusyptr.cpp @@ -8,6 +8,7 @@ #include #include #include +#include //----------------------------------------------------------------------------- KBusyPtr :: KBusyPtr () @@ -115,9 +116,7 @@ bool KBusyPtr :: loadBitmap (QBitmap& bm, const QString& filename) } else { - f = app->kde_datadir().copy(); - f += "/kmail/pics/"; - f += filename; + f = locate("data", "kmail/pics/" + filename); } rc = bm.load(f); if (!rc) printf ("ERROR: cannot load bitmap %s\n", f.data()); diff --git a/kfileio.cpp b/kfileio.cpp index ca40e06b5..027529574 100644 --- a/kfileio.cpp +++ b/kfileio.cpp @@ -3,7 +3,6 @@ #include #include -#include #include #include #include @@ -24,8 +23,8 @@ static void msgDialog(const char* msg, const char* arg=NULL) if (arg) str.sprintf(msg, arg); else str = msg; - KMsgBox::message(NULL, i18n("File I/O Error"), str, - KMsgBox::STOP, i18n("OK")); + QMessageBox::warning(NULL, i18n("File I/O Error"), str, + i18n("OK")); } diff --git a/kmaccount.h b/kmaccount.h index c3acef435..41922cd39 100644 --- a/kmaccount.h +++ b/kmaccount.h @@ -9,7 +9,6 @@ #include #include #include -#include #include "kmnewiostatuswdg.h" class KMAcctMgr; diff --git a/kmacctlocal.cpp b/kmacctlocal.cpp index 890c5d0b1..88a8e0938 100644 --- a/kmacctlocal.cpp +++ b/kmacctlocal.cpp @@ -12,12 +12,12 @@ #include #include -#include #include #include #include #include +#include #ifdef HAVE_PATHS_H #include /* defines _PATH_MAILDIR */ @@ -83,7 +83,7 @@ bool KMAcctLocal::processNewMail(KMIOStatus *statusWdg) QString aStr; aStr = i18n("Cannot open file:"); aStr += mailFolder.path()+"/"+mailFolder.name(); - KMsgBox::message(0,"KMail notification",aStr); + QMessageBox::information(0,i18n("KMail notification"),aStr, i18n("OK")); perror("cannot open file "+mailFolder.path()+"/"+mailFolder.name()); return FALSE; } diff --git a/kmacctpop.cpp b/kmacctpop.cpp index 782560fbe..4c8ae2a4d 100644 --- a/kmacctpop.cpp +++ b/kmacctpop.cpp @@ -23,6 +23,7 @@ #include "kmacctfolder.h" #include "kmfiltermgr.h" #include +#include //----------------------------------------------------------------------------- @@ -327,7 +328,7 @@ bool KMAcctPop::popError(const QString aStage, DwPopClient& aClient) const .arg(name()) .arg(aStage) .arg(msg); - KMsgBox::message(0, caption, tmp); + QMessageBox::information(0, caption, tmp, i18n("OK")); //kbp->busy(); aClient.Quit(); return gotMsgs; diff --git a/kmacctpop.h b/kmacctpop.h index 6e83c35ce..527a90524 100644 --- a/kmacctpop.h +++ b/kmacctpop.h @@ -6,6 +6,7 @@ #include "kmaccount.h" #include +#include class QLineEdit; class QPushButton; class DwPopClient; diff --git a/kmaddrbook.cpp b/kmaddrbook.cpp index bd6d1d75b..ccb62d899 100644 --- a/kmaddrbook.cpp +++ b/kmaddrbook.cpp @@ -5,11 +5,11 @@ #include "kmaddrbook.h" #include #include -#include #include #include #include #include +#include //----------------------------------------------------------------------------- KMAddrBook::KMAddrBook(): KMAddrBookInherited() @@ -24,8 +24,9 @@ KMAddrBook::~KMAddrBook() if (mModified) { if(store() == IO_FatalError) - KMsgBox::message(0,i18n("KMail Error"), - i18n("Storing the addressbook failed!\n")); + QMessageBox::warning(0,i18n("KMail Error"), + i18n("Storing the addressbook failed!\n"), + i18n("OK")); } writeConfig(FALSE); @@ -161,8 +162,8 @@ int KMAddrBook::fileError(int status) const } str.sprintf(msg, mDefaultFileName.data()); - KMsgBox::message(NULL, i18n("File I/O Error"), str, - KMsgBox::STOP, i18n("OK")); + QMessageBox::warning(NULL, i18n("File I/O Error"), str, + i18n("OK")); return status; } diff --git a/kmaddrbookdlg.cpp b/kmaddrbookdlg.cpp index 3f81716b3..31a44e257 100644 --- a/kmaddrbookdlg.cpp +++ b/kmaddrbookdlg.cpp @@ -5,8 +5,8 @@ #include "kmaddrbook.h" #include #include -#include #include +#include //----------------------------------------------------------------------------- KMAddrBookSelDlg::KMAddrBookSelDlg(KMAddrBook* aAddrBook, const char* aCap): @@ -176,8 +176,9 @@ void KMAddrBookEditDlg::slotOk() } if(mAddrBook->store() == IO_FatalError) { - KMsgBox::message(0,i18n("KMail error"), - i18n("Storing addressbook failed")); + QMessageBox::warning(0,i18n("KMail error"), + i18n("Storing addressbook failed"), + i18n("OK")); } accept(); } diff --git a/kmcomposewin.cpp b/kmcomposewin.cpp index 22f943fcd..091663a71 100644 --- a/kmcomposewin.cpp +++ b/kmcomposewin.cpp @@ -22,12 +22,10 @@ #endif #include -#include #include #include #include #include -#include #include #include #include @@ -52,6 +50,7 @@ #include #include #include +#include #if defined CHARSETS #include diff --git a/kmcomposewin.h b/kmcomposewin.h index 056aadee0..2027b2357 100644 --- a/kmcomposewin.h +++ b/kmcomposewin.h @@ -16,7 +16,6 @@ #include #include -#include #include "kmmsgpart.h" diff --git a/kmfilterdlg.cpp b/kmfilterdlg.cpp index ded7c2755..261fa0bb5 100644 --- a/kmfilterdlg.cpp +++ b/kmfilterdlg.cpp @@ -11,7 +11,6 @@ #include "kmfoldermgr.h" #include -#include #include #include #include diff --git a/kmfolderdia.cpp b/kmfolderdia.cpp index 164a2e84e..fadf4445c 100644 --- a/kmfolderdia.cpp +++ b/kmfolderdia.cpp @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include diff --git a/kmfoldertree.cpp b/kmfoldertree.cpp index 05af4614d..b03177a65 100644 --- a/kmfoldertree.cpp +++ b/kmfoldertree.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include @@ -35,9 +34,7 @@ KMFolderTree::KMFolderTree(QWidget *parent,const char *name) : mUpdateTimer = NULL; - mDropZone = new KDNDDropZone(this, DndRawData); - connect(mDropZone, SIGNAL(dropAction(KDNDDropZone*)), - this, SLOT(doDropAction(KDNDDropZone*))); + setDropAccepted(true); connect(this, SIGNAL(highlighted(int,int)), this, SLOT(doFolderSelected(int,int))); @@ -114,8 +111,7 @@ KMFolderTree::~KMFolderTree() disconnect(folderMgr, SIGNAL(changed()), this, SLOT(doFolderListChanged())); - if (mDropZone) delete mDropZone; - if (mUpdateTimer) delete mUpdateTimer; + delete mUpdateTimer; } @@ -204,7 +200,7 @@ void KMFolderTree::doFolderListChanged() //----------------------------------------------------------------------------- -void KMFolderTree::doDropAction(KDNDDropZone* aDropZone) +void KMFolderTree::dropEvent(QDropEvent * event) { KMFolder *toFld, *fromFld; KMDragData* dd; diff --git a/kmfoldertree.h b/kmfoldertree.h index 5e3ad1d61..74d49e1e5 100644 --- a/kmfoldertree.h +++ b/kmfoldertree.h @@ -5,7 +5,7 @@ #include #include "kmfolder.h" -class KDNDDropZone; +class QDropEvent; class QTimer; #define KMFolderTreeInherited KTabListBox @@ -33,7 +33,7 @@ protected slots: void doFolderListChanged(); /** called when a drop occurs. */ - void doDropAction(KDNDDropZone*); + void dropEvent(QDropEvent*); /** Updates the folder tree only if some folder lable has changed */ void refresh(KMFolder*); @@ -51,7 +51,6 @@ protected: virtual void resizeEvent(QResizeEvent*); KMFolderNodeList mList; - KDNDDropZone* mDropZone; QTimer* mUpdateTimer; }; diff --git a/kmheaders.cpp b/kmheaders.cpp index f48a76335..0a89464a0 100644 --- a/kmheaders.cpp +++ b/kmheaders.cpp @@ -4,7 +4,6 @@ #include #include "kmcomposewin.h" #include -#include #include #include diff --git a/kmmainwin.cpp b/kmmainwin.cpp index be14ad008..94c63caf6 100644 --- a/kmmainwin.cpp +++ b/kmmainwin.cpp @@ -28,13 +28,11 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include @@ -183,7 +181,7 @@ void KMMainWin::writeConfig(void) //----------------------------------------------------------------------------- void KMMainWin::createWidgets(void) { - KNewPanner *pnrMsgView, *pnrMsgList, *pnrFldList; + QSplitter *pnrMsgView, *pnrMsgList, *pnrFldList; QAccel *accel = new QAccel(this); // create panners @@ -398,8 +396,8 @@ void KMMainWin::slotCheckMail() if(checkingMail) { - KMsgBox::message(0,i18n("KMail error"), - i18n("Already checking for mail!")); + QMessageBox::warning(0,i18n("KMail error"), + i18n("Already checking for mail!"), i18n("OK")); return; } @@ -432,8 +430,8 @@ void KMMainWin::slotCheckOneAccount(int item) if(checkingMail) { - KMsgBox::message(0,i18n("KMail error"), - i18n("Already checking for mail!")); + QMessageBox::warning(0,i18n("KMail error"), + i18n("Already checking for mail!"), i18n("OK")); return; } @@ -524,7 +522,7 @@ void KMMainWin::slotRemoveFolder() str = i18n("Are you sure you want to remove the folder\n" "\"%1\", discarding it's contents ?") .arg(mFolder->label()); - if ((KMsgBox::yesNo(this,i18n("Confirmation"),str, KMsgBox::DB_SECOND))==1) + if ((QMessageBox::information(this,i18n("Confirmation"),str, i18n("Yes"), i18n("No")))==0) { mHeaders->setFolder(NULL); mMsgView->clear(); diff --git a/kmmainwin.h b/kmmainwin.h index 4501bffc3..e209fd47e 100644 --- a/kmmainwin.h +++ b/kmmainwin.h @@ -11,7 +11,7 @@ class KMFolder; class KMFolderTree; class KMHeaders; class KMReaderWin; -class KNewPanner; +class QSplitter; class KMenuBar; class KToolBar; class KStatusBar; @@ -134,7 +134,7 @@ protected: KStatusBar *mStatusBar; KMFolderTree *mFolderTree; KMReaderWin *mMsgView; - KNewPanner *mHorizPanner, *mVertPanner; + QSplitter *mHorizPanner, *mVertPanner; KMHeaders *mHeaders; KMFolder *mFolder; QPopupMenu *mViewMenu, *mBodyPartsMenu; diff --git a/kmmsgpart.cpp b/kmmsgpart.cpp index 6e62f7243..a29f26463 100644 --- a/kmmsgpart.cpp +++ b/kmmsgpart.cpp @@ -165,8 +165,7 @@ const QString KMMessagePart::iconName(void) const QString fileName, icon; QDir dir; - fileName = KApplication::kde_mimedir() + "/" + mType + "/" + - mSubtype + ".kdelnk"; + fileName = locate("mime", mType + "/" + mSubtype + ".desktop"); if (dir.exists(fileName)) { diff --git a/kmreaderwin.cpp b/kmreaderwin.cpp index 237f15fe0..f9eb56865 100644 --- a/kmreaderwin.cpp +++ b/kmreaderwin.cpp @@ -75,7 +75,6 @@ KMReaderWin::KMReaderWin(QWidget *aParent, const char *aName, int aFlags) { initMetaObject(); - mPicsDir = app->kde_datadir()+"/kmail/pics/"; mAutoDelete = FALSE; mMsg = NULL; diff --git a/kmreaderwin.h b/kmreaderwin.h index c90ad0a33..d0a1650bf 100644 --- a/kmreaderwin.h +++ b/kmreaderwin.h @@ -173,7 +173,6 @@ protected: KMMessage *mMsg; KHTMLWidget *mViewer; QScrollBar *mSbVert, *mSbHorz; - QString mPicsDir; HeaderStyle mHeaderStyle; AttachmentStyle mAttachmentStyle; bool mAutoDelete; diff --git a/kmsettings.cpp b/kmsettings.cpp index 3323c2c98..c5bceb8b0 100644 --- a/kmsettings.cpp +++ b/kmsettings.cpp @@ -20,7 +20,6 @@ #include #include -#include #include #include #include diff --git a/kpgp.cpp b/kpgp.cpp index 8a7d194c4..92aa3b1d5 100644 --- a/kpgp.cpp +++ b/kpgp.cpp @@ -26,8 +26,8 @@ #include #include #include -#include #include +#include Kpgp *Kpgp::kpgpObject = 0L; @@ -282,12 +282,11 @@ Kpgp::encryptFor(const QStrList& aPers, bool sign) } if(persons.isEmpty()) { - int ret = KMsgBox::yesNo(0,i18n("PGP Warning"), + int ret = QMessageBox::warning(0,i18n("PGP Warning"), i18n("Could not find the public keys for the\n" "recipients of this mail.\n" "Message will not be encrypted."), - KMsgBox::EXCLAMATION, - i18n("Continue"), i18n("Cancel")); + i18n("Continue"), i18n("Cancel")); if(ret == 2) return false; } else if(!noKeyFor.isEmpty()) diff --git a/main.cpp b/main.cpp index ac19488eb..82c8459fa 100644 --- a/main.cpp +++ b/main.cpp @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -114,7 +113,7 @@ static void ungrabPtrKb(void) // Message handler static void kmailMsgHandler(QtMsgType aType, const char* aMsg) { - QString appName = app->name(); + QString appName = app->getCaption(); QString msg = aMsg; static int recurse=-1; @@ -136,8 +135,7 @@ static void kmailMsgHandler(QtMsgType aType, const char* aMsg) !recurse) { ungrabPtrKb(); - KMsgBox::message(NULL, appName+" "+i18n("warning"), msg.data(), - KMsgBox::EXCLAMATION); + QMessageBox::warning(NULL, kapp->getCaption(), msg, i18n("OK")); } else kdebug(KDEBUG_INFO, 0, msg); break; @@ -145,8 +143,8 @@ static void kmailMsgHandler(QtMsgType aType, const char* aMsg) case QtFatalMsg: ungrabPtrKb(); fprintf(stderr, appName+" "+i18n("fatal error")+": %s\n", msg.data()); - KMsgBox::message(NULL, appName+" "+i18n("fatal error"), - aMsg, KMsgBox::STOP); + QMessageBox::critical(NULL, appName+" "+i18n("fatal error"), + aMsg, i18n("OK")); abort(); } @@ -325,8 +323,10 @@ static void testDir(const char *_name) QString c = getenv("HOME"); if(c.isEmpty()) { - KMsgBox::message(0,i18n("KMail notification"), - i18n("$HOME is not set!\nKMail cannot start without it.\n")); + QMessageBox::critical(0,i18n("KMail notification"), + i18n("$HOME is not set!\n" + "KMail cannot start without it.\n"), + i18n("OK")); exit(-1); } @@ -722,6 +722,10 @@ main(int argc, char *argv[]) sprintf (lf, "%s.kmail%d.msg", _PATH_TMP, getuid()); msg = fopen (lf, "w"); int i; + KGlobal::dirs()-> + addResourceType("kmail_pic", + KStandardDirs::kde_default("data") + "kmail/pics/"); + app = new KApplication(argc, argv, "kmail"); // clear arg list argc--; argv++;