diff --git a/importarchivedialog.cpp b/importarchivedialog.cpp index c88a59a5b..c09cce540 100644 --- a/importarchivedialog.cpp +++ b/importarchivedialog.cpp @@ -32,8 +32,8 @@ using namespace KMail; -ImportArchiveDialog::ImportArchiveDialog( QWidget *parent ) - : KDialog( parent ), mParentWidget( parent ) +ImportArchiveDialog::ImportArchiveDialog( QWidget *parent, Qt::WFlags flags ) + : KDialog( parent, flags ), mParentWidget( parent ) { setObjectName( "import_archive_dialog" ); setCaption( i18n( "Import Archive" ) ); diff --git a/importarchivedialog.h b/importarchivedialog.h index 0b0e5e87c..f92330f77 100644 --- a/importarchivedialog.h +++ b/importarchivedialog.h @@ -35,7 +35,7 @@ class ImportArchiveDialog : public KDialog public: - ImportArchiveDialog( QWidget *parent = 0 ); + ImportArchiveDialog( QWidget *parent, Qt::WFlags flags ); void setFolder( KMFolder *defaultFolder ); protected slots: diff --git a/kmail_part.rc b/kmail_part.rc index 7974cdf6a..439e1d357 100644 --- a/kmail_part.rc +++ b/kmail_part.rc @@ -19,7 +19,6 @@ - diff --git a/kmkernel.cpp b/kmkernel.cpp index fd02e3673..d2cb9968e 100644 --- a/kmkernel.cpp +++ b/kmkernel.cpp @@ -37,6 +37,7 @@ using KPIM::RecentAddresses; #include "configuredialog.h" #include "kmcommands.h" #include "kmsystemtray.h" +#include "importarchivedialog.h" #include #include @@ -98,7 +99,7 @@ KMKernel::KMKernel (QObject *parent, const char *name) : mIdentityManager(0), mConfigureDialog(0), mICalIface(0), mMailService(0), mContextMenuShown( false ), mWallet( 0 ) { - kDebug(5006); + kDebug(); setObjectName( name ); mySelf = this; the_startingUp = true; @@ -189,7 +190,7 @@ KMKernel::~KMKernel () delete mWallet; mWallet = 0; mySelf = 0; - kDebug(5006); + kDebug(); } void KMKernel::setupDBus() @@ -348,7 +349,7 @@ QStringList KMKernel::accounts() void KMKernel::checkAccount( const QString &account ) //might create a new reader but won't show!! { - kDebug(5006); + kDebug(); if ( account.isEmpty() ) checkMail(); else { @@ -370,7 +371,7 @@ void KMKernel::openReader( bool onlyCheck ) { mWin = 0; KMainWindow *ktmw = 0; - kDebug(5006); + kDebug(); foreach ( KMainWindow *window, KMainWindow::memberList() ) { @@ -410,7 +411,7 @@ int KMKernel::openComposer( const QString &to, const QString &cc, const QStringList &attachmentPaths, const QStringList &customHeaders ) { - kDebug(5006); + kDebug(); KMMessage *msg = new KMMessage; msg->initHeader(); msg->setCharset("utf-8"); @@ -493,7 +494,7 @@ int KMKernel::openComposer (const QString &to, const QString &cc, const QByteArray &attachCharset, unsigned int identity ) { - kDebug(5006); + kDebug(); KMMessage *msg = new KMMessage; KMMessagePart *msgPart = 0; @@ -548,7 +549,7 @@ int KMKernel::openComposer (const QString &to, const QString &cc, msgPart->setContentDisposition( attachContDisp ); } if( !attachCharset.isEmpty() ) { - // kDebug(5006) << "Set attachCharset to" << attachCharset; + // kDebug() << "Set attachCharset to" << attachCharset; msgPart->setCharset( attachCharset ); } // Don't show the composer window if the automatic sending is checked @@ -595,7 +596,7 @@ void KMKernel::setDefaultTransport( const QString & transport ) { MailTransport::Transport *t = MailTransport::TransportManager::self()->transportByName( transport, false ); if ( !t ) { - kWarning(5006) <<"The transport you entered is not available"; + kWarning() <<"The transport you entered is not available"; return; } MailTransport::TransportManager::self()->setDefaultTransport( t->id() ); @@ -731,7 +732,7 @@ int KMKernel::dbusAddMessage( const QString & foldername, const QString & MsgStatusFlags) { // FIXME: Remove code duplication between this method and dbusAddMessage_fastImport()! - kDebug(5006); + kDebug(); if ( foldername.isEmpty() || foldername.startsWith('.')) return -1; @@ -764,7 +765,7 @@ int KMKernel::dbusAddMessage( const QString & foldername, KMFolderDir *subfolder; bool root = true; - QStringList subFList = _foldername.split("/", QString::SkipEmptyParts); + QStringList subFList = _foldername.split('/', QString::SkipEmptyParts); for ( QStringList::Iterator it = subFList.begin(); it != subFList.end(); ++it ) { QString _newFolder = *it; @@ -905,7 +906,7 @@ int KMKernel::dbusAddMessage_fastImport( const QString & foldername, { // Use this function to import messages without // search for already existing emails. - kDebug(5006); + kDebug(); if ( foldername.isEmpty() || foldername.startsWith('.')) return -1; @@ -932,7 +933,7 @@ int KMKernel::dbusAddMessage_fastImport( const QString & foldername, KMFolderDir *subfolder; bool root = true; - QStringList subFList = _foldername.split("/", QString::SkipEmptyParts); + QStringList subFList = _foldername.split('/', QString::SkipEmptyParts); for ( QStringList::Iterator it = subFList.begin(); it != subFList.end(); ++it ) { QString _newFolder = *it; @@ -991,6 +992,14 @@ int KMKernel::dbusAddMessage_fastImport( const QString & foldername, return retval; } +void KMKernel::showImportArchiveDialog() +{ + KMMainWidget *mainWidget = getKMMainWidget(); + KMail::ImportArchiveDialog *importDialog = new KMail::ImportArchiveDialog( mainWidget, Qt::WDestructiveClose ); + importDialog->setFolder( mainWidget->folderTree()->currentFolder() ); + importDialog->show(); +} + QStringList KMKernel::folderList() const { QStringList folders; @@ -1024,7 +1033,7 @@ QString KMKernel::getFolder( const QString& vpath ) folderAdaptor = new KMail::FolderAdaptor(adaptorName); return vpath; } - kWarning(5006) << "Folder not found:" << vpath; + kWarning() << "Folder not found:" << vpath; return QString(); } @@ -1689,7 +1698,7 @@ void KMKernel::cleanup(void) the_folderMgr->createFolderList(&strList, &folders); QList >::const_iterator it; - for ( it = folders.begin(); it != folders.end(); it++ ) { + for ( it = folders.begin(); it != folders.end(); ++it ) { folder = *it; if ( !folder || folder->isDir() ) { continue; @@ -1699,7 +1708,7 @@ void KMKernel::cleanup(void) strList.clear(); folders.clear(); the_searchFolderMgr->createFolderList(&strList, &folders); - for ( it = folders.begin(); it != folders.end(); it++ ) { + for ( it = folders.begin(); it != folders.end(); ++it ) { folder = *it; if ( !folder || folder->isDir() ) { continue; @@ -1802,8 +1811,8 @@ bool KMKernel::transferMail( QString & destinationDir ) } if ( !KIO::NetAccess::move( dir, destinationDir ) ) { - kDebug(5006) <<"Moving" << dir <<" to" << destinationDir <<" failed:" << KIO::NetAccess::lastErrorString(); - kDebug(5006) <<"Deleting" << destinationDir; + kDebug() <<"Moving" << dir <<" to" << destinationDir <<" failed:" << KIO::NetAccess::lastErrorString(); + kDebug() <<"Deleting" << destinationDir; KIO::NetAccess::del( destinationDir, 0 ); destinationDir = dir; return false; @@ -1880,8 +1889,8 @@ void KMKernel::slotDataReq(KIO::Job *job, QByteArray &data) // send MAX_CHUNK_SIZE bytes to the receiver (deep copy) data = QByteArray( (*it).data.data() + (*it).offset, MAX_CHUNK_SIZE ); (*it).offset += MAX_CHUNK_SIZE; - //kDebug( 5006 ) <<"Sending" << MAX_CHUNK_SIZE <<" bytes (" - // << remainingBytes - MAX_CHUNK_SIZE << " bytes remain)\n"; + //kDebug() <<"Sending" << MAX_CHUNK_SIZE <<" bytes (" + // << remainingBytes - MAX_CHUNK_SIZE << " bytes remain)\n"; } else { @@ -1889,7 +1898,7 @@ void KMKernel::slotDataReq(KIO::Job *job, QByteArray &data) data = QByteArray( (*it).data.data() + (*it).offset, remainingBytes ); (*it).data = QByteArray(); (*it).offset = 0; - //kDebug( 5006 ) <<"Sending" << remainingBytes <<" bytes"; + //kDebug() <<"Sending" << remainingBytes <<" bytes"; } } @@ -1991,7 +2000,7 @@ void KMKernel::emergencyExit( const QString& reason ) "terminate now.\nThe error was:\n%1", reason ); } - kWarning(5006) << mesg; + kWarning() << mesg; KMessageBox::error( 0, mesg ); ::exit(1); @@ -2072,7 +2081,7 @@ bool KMKernel::folderIsSentMailFolder( const KMFolder * folder ) KPIMIdentities::IdentityManager * KMKernel::identityManager() { if ( !mIdentityManager ) { - kDebug(5006); + kDebug(); mIdentityManager = new KPIMIdentities::IdentityManager( false, this, "mIdentityManager" ); } return mIdentityManager; @@ -2154,7 +2163,7 @@ KMailICalIfaceImpl& KMKernel::iCalIface() void KMKernel::selectFolder( const QString &folderPath ) { - kDebug(5006)<<"Selecting a folder"<folderMgr()->getFolderByURL( folderPath ); if ( !folder && folderPath.startsWith( localPrefix ) ) diff --git a/kmkernel.h b/kmkernel.h index 1d831d55f..bc74b59ea 100644 --- a/kmkernel.h +++ b/kmkernel.h @@ -141,6 +141,7 @@ public Q_SLOTS: Q_SCRIPTABLE void selectFolder( const QString & folder ); Q_SCRIPTABLE QString getFolder( const QString & vpath ); + Q_SCRIPTABLE void showImportArchiveDialog(); Q_SCRIPTABLE bool canQueryClose(); diff --git a/kmmainwidget.cpp b/kmmainwidget.cpp index 3496f6695..22f894739 100644 --- a/kmmainwidget.cpp +++ b/kmmainwidget.cpp @@ -135,7 +135,6 @@ using KMail::HeaderListQuickSearch; using KMail::TemplateParser; #include "statusbarlabel.h" #include "archivefolderdialog.h" -#include "importarchivedialog.h" #include "folderutil.h" #if !defined(NDEBUG) @@ -168,7 +167,6 @@ KMMainWidget::KMMainWidget( QWidget *parent, KXMLGUIClient *aGUIClient, mSplitter2( 0 ), mFolderViewSplitter( 0 ), mArchiveFolderAction( 0 ), - mImportArchiveAction( 0 ), mShowBusySplashTimer( 0 ), mShowingOfflineScreen( false ), mMsgActions( 0 ), @@ -1314,14 +1312,6 @@ void KMMainWidget::slotEmptyFolder() mEmptyFolderAction->setEnabled( false ); } -//----------------------------------------------------------------------------- -void KMMainWidget::slotImportArchive() -{ - KMail::ImportArchiveDialog importDialog; - importDialog.setFolder( mFolder ); - importDialog.exec(); -} - //----------------------------------------------------------------------------- void KMMainWidget::slotArchiveFolder() { @@ -2877,10 +2867,6 @@ void KMMainWidget::setupActions() actionCollection()->addAction( "archive_folder", mArchiveFolderAction ); connect( mArchiveFolderAction, SIGNAL(triggered(bool)), SLOT(slotArchiveFolder()) ); - mImportArchiveAction = new KAction( i18n( "Import Archive..." ), this ); - actionCollection()->addAction( "import_archive", mImportArchiveAction ); - connect( mImportArchiveAction, SIGNAL(triggered(bool)), SLOT(slotImportArchive()) ); - mPreferHtmlAction = new KToggleAction(i18n("Prefer &HTML to Plain Text"), this); actionCollection()->addAction("prefer_html", mPreferHtmlAction ); connect(mPreferHtmlAction, SIGNAL(triggered(bool) ), SLOT(slotOverrideHtml())); diff --git a/kmmainwidget.h b/kmmainwidget.h index d7d90a223..637eed716 100644 --- a/kmmainwidget.h +++ b/kmmainwidget.h @@ -318,7 +318,6 @@ class KMAIL_EXPORT KMMainWidget : public QWidget void slotInvalidateIMAPFolders(); void slotMarkAllAsRead(); void slotArchiveFolder(); - void slotImportArchive(); void slotRemoveFolder(); void slotEmptyFolder(); void slotCompactFolder(); @@ -565,7 +564,7 @@ class KMAIL_EXPORT KMMainWidget : public QWidget *mExpireFolderAction, *mCompactFolderAction, *mRefreshFolderAction, *mEmptyFolderAction, *mMarkAllAsReadAction, *mFolderMailingListPropertiesAction, *mFolderShortCutCommandAction, *mTroubleshootFolderAction, - *mRemoveDuplicatesAction, *mArchiveFolderAction, *mImportArchiveAction, + *mRemoveDuplicatesAction, *mArchiveFolderAction, *mTroubleshootMaildirAction; KToggleAction *mPreferHtmlAction, *mPreferHtmlLoadExtAction, *mThreadMessagesAction, *mThreadBySubjectAction; diff --git a/kmmainwin.rc b/kmmainwin.rc index 7ca675776..cb645ddd5 100644 --- a/kmmainwin.rc +++ b/kmmainwin.rc @@ -22,7 +22,6 @@ -