From 0e0ba44419f2cd5a95370869ef4b3c727013ab7b Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Mon, 26 Oct 2009 10:24:43 +0000 Subject: [PATCH] KMFolder-- svn path=/branches/work/akonadi-ports/kdepim/; revision=1040452 --- kmfilter.cpp | 2 +- kmfilter.h | 6 +++--- kmfilteraction.cpp | 4 ++-- kmfilteraction.h | 8 ++++---- kmfiltermgr.cpp | 14 +++++++------- kmfiltermgr.h | 5 +++-- kmkernel.cpp | 10 +++++----- kmkernel.h | 2 +- 8 files changed, 26 insertions(+), 25 deletions(-) diff --git a/kmfilter.cpp b/kmfilter.cpp index d825a1ba5..0d1aa02f0 100644 --- a/kmfilter.cpp +++ b/kmfilter.cpp @@ -185,7 +185,7 @@ KMPopFilterAction KMFilter::action() } // only for !bPopFilter -bool KMFilter::folderRemoved( KMFolder* aFolder, KMFolder* aNewFolder ) +bool KMFilter::folderRemoved( const Akonadi::Collection & aFolder, const Akonadi::Collection& aNewFolder ) { bool rem = false; diff --git a/kmfilter.h b/kmfilter.h index 97b39207a..a0d25a6e3 100644 --- a/kmfilter.h +++ b/kmfilter.h @@ -24,7 +24,7 @@ #include "kmpopheaders.h" #include - +#include class QString; class KConfigGroup; namespace KMime { @@ -252,7 +252,7 @@ public: /** This sets the toolbar name for this filter. * The toolbar name is the text to be displayed underneath the toolbar icon - * for this filter. This is usually the same as name(), expect when + * for this filter. This is usually the same as name(), expect when * explicitly set by this function. * This is useful if the normal filter mame is too long for the toolbar. * @see toolbarName, name @@ -290,7 +290,7 @@ public: * @return true if a change in some action occurred, * false if no action was affected. */ - bool folderRemoved( KMFolder* aFolder, KMFolder* aNewFolder ); + bool folderRemoved( const Akonadi::Collection& aFolder, const Akonadi::Collection& aNewFolder ); /** Returns the filter in a human-readable form. useful for debugging but not much else. Don't use, as it may well go away diff --git a/kmfilteraction.cpp b/kmfilteraction.cpp index 7db62e591..588591562 100644 --- a/kmfilteraction.cpp +++ b/kmfilteraction.cpp @@ -113,7 +113,7 @@ void KMFilterAction::clearParamWidget( QWidget * ) const { } -bool KMFilterAction::folderRemoved(KMFolder*, KMFolder*) +bool KMFilterAction::folderRemoved(const Akonadi::Collection&, const Akonadi::Collection&) { return false; } @@ -388,7 +388,7 @@ const QString KMFilterActionWithFolder::displayString() const #endif } -bool KMFilterActionWithFolder::folderRemoved( KMFolder* aFolder, KMFolder* aNewFolder ) +bool KMFilterActionWithFolder::folderRemoved( const Akonadi::Collection& aFolder, const Akonadi::Collection& aNewFolder ) { #if 0 if ( aFolder == mFolder ) { diff --git a/kmfilteraction.h b/kmfilteraction.h index 1faaf58db..60c56e802 100644 --- a/kmfilteraction.h +++ b/kmfilteraction.h @@ -27,9 +27,9 @@ #include #include #include -class KMFolder; -class KTemporaryFile; +class KTemporaryFile; +class KMFolder; namespace KMime { class Message; class Content; @@ -140,7 +140,7 @@ public: /** Called from the filter when a folder is removed. Tests if the folder @p aFolder is used and changes to @p aNewFolder in this case. Returns true if a change was made. */ - virtual bool folderRemoved(KMFolder* aFolder, KMFolder* aNewFolder); + virtual bool folderRemoved(const Akonadi::Collection & aFolder, const Akonadi::Collection & aNewFolder); /** Static function that creates a filter action of this type. */ static KMFilterAction* newAction(); @@ -433,7 +433,7 @@ public: /** Called from the filter when a folder is removed. Tests if the folder @p aFolder is used and changes to @p aNewFolder in this case. Returns true if a change was made. */ - virtual bool folderRemoved(KMFolder* aFolder, KMFolder* aNewFolder); + virtual bool folderRemoved(const Akonadi::Collection& aFolder, const Akonadi::Collection& aNewFolder); protected: Akonadi::Collection mFolder; diff --git a/kmfiltermgr.cpp b/kmfiltermgr.cpp index a67064c29..21e8af65d 100644 --- a/kmfiltermgr.cpp +++ b/kmfiltermgr.cpp @@ -43,8 +43,8 @@ KMFilterMgr::KMFilterMgr( bool popFilter ) if ( bPopFilter ) { kDebug() << "pPopFilter set"; } - connect( kmkernel, SIGNAL( folderRemoved( KMFolder* ) ), - this, SLOT( slotFolderRemoved( KMFolder* ) ) ); + connect( kmkernel, SIGNAL( folderRemoved( const Akonadi::Collection& ) ), + this, SLOT( slotFolderRemoved( const Akonadi::Collection & ) ) ); } @@ -72,7 +72,7 @@ void KMFilterMgr::readConfig(void) if ( bPopFilter ) { KConfigGroup group = config->group( "General" ); mShowLater = group.readEntry( "popshowDLmsgs", false ); - } + } mFilters = FilterImporterExporter::readFiltersFromConfig( config, bPopFilter ); } @@ -81,7 +81,7 @@ void KMFilterMgr::writeConfig(bool withSync) { KSharedConfig::Ptr config = KMKernel::config(); - // Now, write out the new stuff: + // Now, write out the new stuff: FilterImporterExporter::writeFiltersToConfig( mFilters, config, bPopFilter ); KConfigGroup group = config->group( "General" ); if ( bPopFilter ) @@ -510,13 +510,13 @@ void KMFilterMgr::setFilters( const QList &filters ) endUpdate(); } -void KMFilterMgr::slotFolderRemoved( KMFolder * aFolder ) +void KMFilterMgr::slotFolderRemoved( const Akonadi::Collection & aFolder ) { - folderRemoved( aFolder, 0 ); + folderRemoved( aFolder, Akonadi::Collection() ); } //----------------------------------------------------------------------------- -bool KMFilterMgr::folderRemoved(KMFolder* aFolder, KMFolder* aNewFolder) +bool KMFilterMgr::folderRemoved(const Akonadi::Collection & aFolder, const Akonadi::Collection & aNewFolder) { mDirtyBufferedFolderTarget = true; bool rem = false; diff --git a/kmfiltermgr.h b/kmfiltermgr.h index 629c890ec..f31c560d6 100644 --- a/kmfiltermgr.h +++ b/kmfiltermgr.h @@ -22,6 +22,7 @@ #include "kmfilteraction.h" // for KMFilterAction::ReturnCode #include "kmfolder.h" +#include namespace KMime { class Message; @@ -161,7 +162,7 @@ public: Tests if the folder aFolder is used in any action. Changes to aNewFolder folder in this case. Returns true if a change occurred. */ - bool folderRemoved(KMFolder* aFolder, KMFolder* aNewFolder); + bool folderRemoved(const Akonadi::Collection& aFolder, const Akonadi::Collection& aNewFolder); /** Called from the folder manager when a new folder has been created. Forwards this to the filter dialog if that is open. */ @@ -177,7 +178,7 @@ public: return mShowLater; } public slots: - void slotFolderRemoved( KMFolder *aFolder ); + void slotFolderRemoved( const Akonadi::Collection &aFolder ); signals: void filterListUpdated(); diff --git a/kmkernel.cpp b/kmkernel.cpp index 3deb6750f..3f262f257 100644 --- a/kmkernel.cpp +++ b/kmkernel.cpp @@ -1604,18 +1604,18 @@ void KMKernel::init() the_weaver = new ThreadWeaver::Weaver( this ); - connect( the_folderMgr, SIGNAL( folderRemoved(KMFolder*) ), - this, SIGNAL( folderRemoved(KMFolder*) ) ); + connect( the_folderMgr, SIGNAL( folderRemoved(const Akonadi::Collection &) ), + this, SIGNAL( folderRemoved(const Akonadi::Collection&) ) ); #if 0 //TODO port to akonadi connect( the_dimapFolderMgr, SIGNAL( folderRemoved(KMFolder*) ), this, SIGNAL( folderRemoved(KMFolder*) ) ); connect( the_imapFolderMgr, SIGNAL( folderRemoved(KMFolder*) ), this, SIGNAL( folderRemoved(KMFolder*) ) ); #else - kDebug() << "AKONADI PORT: Disabled code in " << Q_FUNC_INFO; + kDebug() << "AKONADI PORT: Disabled code in " << Q_FUNC_INFO; #endif - connect( the_searchFolderMgr, SIGNAL( folderRemoved(KMFolder*) ), - this, SIGNAL( folderRemoved(KMFolder*) ) ); + connect( the_searchFolderMgr, SIGNAL( folderRemoved(const Akonadi::Collection&) ), + this, SIGNAL( folderRemoved(const Akonadi::Collection&) ) ); mBackgroundTasksTimer = new QTimer( this ); mBackgroundTasksTimer->setSingleShot( true ); diff --git a/kmkernel.h b/kmkernel.h index a76db7a1f..fe0ffb7a2 100644 --- a/kmkernel.h +++ b/kmkernel.h @@ -445,7 +445,7 @@ protected slots: signals: void configChanged(); - void folderRemoved( KMFolder* aFolder ); + void folderRemoved( const Akonadi::Collection &aFolder ); void onlineStatusChanged( GlobalSettings::EnumNetworkState::type ); void customTemplatesChanged();