Merged revisions 1048250 via svnmerge from

https://svn.kde.org/home/kde/branches/kdepim/enterprise/kdepim

........
  r1048250 | tmcguire | 2009-11-12 18:53:54 -0500 (Thu, 12 Nov 2009) | 3 lines
  
  Remove the import archive action from the main menu, let
  KMailCVT do that instead, by calling a DCOP method.
........

svn path=/branches/kdepim/enterprise4/kdepim/; revision=1048297
wilder-work
Allen Winter 17 years ago
commit 2afa45a086
  1. 4
      importarchivedialog.cpp
  2. 2
      importarchivedialog.h
  3. 1
      kmail_part.rc
  4. 55
      kmkernel.cpp
  5. 1
      kmkernel.h
  6. 14
      kmmainwidget.cpp
  7. 3
      kmmainwidget.h
  8. 1
      kmmainwin.rc

@ -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" ) );

@ -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:

@ -19,7 +19,6 @@
<Action name="file_open" />
<Action name="file_save_as" />
<Action name="import"/>
<Action name="import_archive"/>
<Action name="file_print" />
<Separator/>
<Action name="expire_all_folders" />

@ -37,6 +37,7 @@ using KPIM::RecentAddresses;
#include "configuredialog.h"
#include "kmcommands.h"
#include "kmsystemtray.h"
#include "importarchivedialog.h"
#include <mailtransport/transport.h>
#include <mailtransport/transportmanager.h>
@ -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<QPointer<KMFolder> >::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"<<folderPath;
kDebug() << "Selecting a folder" << folderPath;
const QString localPrefix = "/Local";
KMFolder *folder = kmkernel->folderMgr()->getFolderByURL( folderPath );
if ( !folder && folderPath.startsWith( localPrefix ) )

@ -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();

@ -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()));

@ -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;

@ -22,7 +22,6 @@
<Action name="file_open" />
<Action name="file_save_as" />
<Action name="import"/>
<Action name="import_archive"/>
<Action name="file_print" />
<Separator/>
<Action name="expire_all_folders" />

Loading…
Cancel
Save