diff --git a/kmgroupware.cpp b/kmgroupware.cpp index c4e04ecc9..ef773fc36 100644 --- a/kmgroupware.cpp +++ b/kmgroupware.cpp @@ -150,33 +150,6 @@ bool KMGroupware::vPartFoundAndDecoded( KMMessage* msg, QString& s ) } -void KMGroupware::slotInvalidateIMAPFolders() -{ - QString str = i18n("Are you sure you want to refresh the IMAP cache?\n" - "This will remove all changes you have done locally to your folders"); - QString s1 = i18n("Refresh IMAP Cache"); - QString s2 = i18n("&Refresh"); - if( KMessageBox::warningContinueCancel(kmkernel->mainWin(), str, s1, s2 ) == KMessageBox::Continue) - kmkernel->acctMgr()->invalidateIMAPFolders(); -} - -//----------------------------------------------------------------------------- -void KMGroupware::setupActions() -{ - static bool actionsSetup = false; - - if( !actionsSetup && kmkernel->mainWin() ) { - actionsSetup = true; - - // file menu: some entries - new KAction( i18n("refresh local imap cache", "Refresh Local IMAP Cache"), 0, - this, SLOT(slotInvalidateIMAPFolders()), kmkernel->mainWin()->actionCollection(), - "invalidate_imap_cache" ); - } - - emit signalMenusChanged(); -} - //----------------------------------------------------------------------------- // Special Contacts methods called by KMKernel's DCOP functions //----------------------------------------------------------------------------- diff --git a/kmgroupware.h b/kmgroupware.h index 33ab18a6e..77ab1bc77 100644 --- a/kmgroupware.h +++ b/kmgroupware.h @@ -45,7 +45,6 @@ public: public: - void setupActions(); // Not const since it emits a signal void processVCalRequest( const QCString& receiver, const QString& vCalIn, QString& choice ); void processVCalReply( const QCString& sender, const QString& vCalIn, @@ -96,14 +95,6 @@ public: void setMainWidget( KMMainWidget* mw ) { mMainWidget = mw; } -signals: - /** The menus were changed */ - void signalMenusChanged(); - -public slots: - /** Delete and sync the local IMAP cache */ - void slotInvalidateIMAPFolders(); - protected: // Figure out if a vCal is a todo, event or neither enum VCalType { vCalEvent, vCalTodo, vCalUnknown }; diff --git a/kmmainwidget.cpp b/kmmainwidget.cpp index f4dbd40c8..80f0527e5 100644 --- a/kmmainwidget.cpp +++ b/kmmainwidget.cpp @@ -1012,6 +1012,14 @@ void KMMainWidget::slotRefreshFolder() } } +void KMMainWidget::slotInvalidateIMAPFolders() { + if ( KMessageBox::warningContinueCancel( this, + i18n("Are you sure you want to refresh the IMAP cache?\n" + "This will remove all changes that you have done " + "locally to your IMAP folders."), + i18n("Refresh IMAP Cache"), i18n("&Refresh") ) == KMessageBox::Continue ) + kmkernel->acctMgr()->invalidateIMAPFolders(); +} //----------------------------------------------------------------------------- void KMMainWidget::slotExpireAll() { @@ -2022,6 +2030,10 @@ void KMMainWidget::setupActions() this, SLOT(slotExpireAll()), actionCollection(), "expire_all_folders" ); + (void) new KAction( i18n("&Refresh Local IMAP Cache"), "refresh", + this, SLOT(slotInvalidateIMAPFolders()), + actionCollection(), "file_invalidate_imap_cache" ); + (void) new KAction( i18n("Empty T&rash"), 0, KMKernel::self(), SLOT(slotEmptyTrash()), actionCollection(), "empty_trash" ); diff --git a/kmmainwidget.h b/kmmainwidget.h index 7a46556a4..2aa9363b8 100644 --- a/kmmainwidget.h +++ b/kmmainwidget.h @@ -211,6 +211,7 @@ protected slots: void slotModifyFolder(); void slotExpireFolder(); void slotExpireAll(); + void slotInvalidateIMAPFolders(); void slotMarkAllAsRead(); void slotRemoveFolder(); void slotEmptyFolder(); diff --git a/kmmainwin.rc b/kmmainwin.rc index 4969d293b..cd45825e0 100644 --- a/kmmainwin.rc +++ b/kmmainwin.rc @@ -1,5 +1,5 @@ - + &File @@ -10,6 +10,7 @@ +