summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-10-30 07:44:22 +0100
committerMontel Laurent <[email protected]>2017-10-30 07:44:22 +0100
commit44c2ecae65080a8ef9af3da41637a5f5694cdd85 (patch)
treeb0c2d568983b07ff222eff73e5ee69048ec7a567
parent7a8a6291640706588a7c57ee27567a5dc8215a0c (diff)
Store collection
-rw-r--r--src/filter/filteractions/filteractionwithfolder.cpp16
-rw-r--r--src/filter/filterimporterpathcache.h3
2 files changed, 14 insertions, 5 deletions
diff --git a/src/filter/filteractions/filteractionwithfolder.cpp b/src/filter/filteractions/filteractionwithfolder.cpp
index c37f359..a7af240 100644
--- a/src/filter/filteractions/filteractionwithfolder.cpp
+++ b/src/filter/filteractions/filteractionwithfolder.cpp
@@ -23,6 +23,7 @@
#include "kernel/mailkernel.h"
#include "util/mailutil.h"
#include "filter/dialog/filteractionmissingfolderdialog.h"
+#include "filter/filterimporterpathcache.h"
#include <QPointer>
@@ -75,12 +76,19 @@ bool FilterActionWithFolder::argsFromStringInteractive(const QString &argsStr, c
if (lst.count() == 1 && exactPath) {
mFolder = lst.at(0);
} else {
- QPointer<FilterActionMissingFolderDialog> dlg = new FilterActionMissingFolderDialog(lst, name, argsStr);
- if (dlg->exec()) {
- mFolder = dlg->selectedCollection();
+ const Akonadi::Collection newCol = MailCommon::FilterImporterPathCache::self()->convertedFilterPath(argsStr);
+ if (!newCol.isValid()) {
+ QPointer<FilterActionMissingFolderDialog> dlg = new FilterActionMissingFolderDialog(lst, name, argsStr);
+ if (dlg->exec()) {
+ mFolder = dlg->selectedCollection();
+ needUpdate = true;
+ MailCommon::FilterImporterPathCache::self()->insert(argsStr, mFolder);
+ }
+ delete dlg;
+ } else {
+ mFolder = newCol;
needUpdate = true;
}
- delete dlg;
}
}
return needUpdate;
diff --git a/src/filter/filterimporterpathcache.h b/src/filter/filterimporterpathcache.h
index d926c75..54d8dcf 100644
--- a/src/filter/filterimporterpathcache.h
+++ b/src/filter/filterimporterpathcache.h
@@ -21,9 +21,10 @@
#include <QObject>
#include <QHash>
#include <AkonadiCore/Collection>
+#include "mailcommon_private_export.h"
namespace MailCommon
{
-class FilterImporterPathCache : public QObject
+class MAILCOMMON_TESTS_EXPORT FilterImporterPathCache : public QObject
{
Q_OBJECT
public: