Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 44c2ecae authored by Laurent Montel's avatar Laurent Montel 😁

Store collection

parent 7a8a6291
......@@ -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;
......
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment