Commit 5a838462 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix save collection

parent 6191b6a4
Pipeline #29015 passed with stage
in 35 minutes and 43 seconds
cmake_minimum_required(VERSION 3.5)
set(PIM_VERSION "5.15.42")
set(PIM_VERSION "5.15.43")
project(mailcommon VERSION ${PIM_VERSION})
......
......@@ -224,10 +224,9 @@ CollectionExpirySettings CollectionExpiryWidget::settings() const
return settings;
}
void CollectionExpiryWidget::save(Akonadi::Collection &collection, bool saveSettings, bool expireNow)
void CollectionExpiryWidget::save(const CollectionExpirySettings &collectionExpirySettings, Akonadi::Collection &collection, bool saveSettings, bool expireNow)
{
expireNow = validateExpireFolder(expireNow);
const CollectionExpirySettings collectionExpirySettings = settings();
MailCommon::ExpireCollectionAttribute *attribute = assignFolderAttribute(collection, expireNow);
attribute->setAutoExpire(collectionExpirySettings.expiryGloballyOn);
// we always write out days now
......@@ -249,3 +248,9 @@ void CollectionExpiryWidget::save(Akonadi::Collection &collection, bool saveSett
}
Q_EMIT configChanged(false);
}
void CollectionExpiryWidget::save(Akonadi::Collection &collection, bool saveSettings, bool expireNow)
{
const CollectionExpirySettings collectionExpirySettings = settings();
save(collectionExpirySettings, collection, saveSettings, expireNow);
}
......@@ -58,13 +58,14 @@ public:
void load(const MailCommon::CollectionExpirySettings &settings);
void save(Akonadi::Collection &collection, bool saveSettings, bool expireNow);
void save(const CollectionExpirySettings &collectionExpirySettings, Akonadi::Collection &collection, bool saveSettings, bool expireNow);
Q_REQUIRED_RESULT CollectionExpirySettings settings() const;
Q_SIGNALS:
void saveAndExpireRequested();
void configChanged(bool changed = true);
private:
Q_REQUIRED_RESULT bool validateExpireFolder(bool expireNow);
Q_REQUIRED_RESULT CollectionExpirySettings settings() const;
Q_REQUIRED_RESULT MailCommon::ExpireCollectionAttribute *assignFolderAttribute(Akonadi::Collection &collection, bool &expireNow);
void slotChanged();
void slotUpdateControls();
......
......@@ -123,7 +123,7 @@ public:
Q_REQUIRED_RESULT bool readConfig(const KConfigGroup &config, bool interactive = false);
/** Remove empty rules (and actions one day). */
Q_REQUIRED_RESULT QString purify(bool removeAction = true);
QString purify(bool removeAction = true);
/** Check for empty pattern and action list. */
bool isEmpty() const;
......
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