summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-09-30 12:11:06 (GMT)
committerMontel Laurent <montel@kde.org>2016-09-30 12:11:06 (GMT)
commit478b1d244dee8820acd625bf38e6c5da48970aa2 (patch)
tree3c15c4527852c7b1caa10b02a1b6023c726a249d
parentc9b10647e047ac1e32088000aca158ad15378af5 (diff)
Store user settings value
-rw-r--r--src/configureplugins/configurepluginslistwidget.cpp7
-rw-r--r--src/configureplugins/configurepluginslistwidget.h5
2 files changed, 11 insertions, 1 deletions
diff --git a/src/configureplugins/configurepluginslistwidget.cpp b/src/configureplugins/configurepluginslistwidget.cpp
index a04484b..a0158e5 100644
--- a/src/configureplugins/configurepluginslistwidget.cpp
+++ b/src/configureplugins/configurepluginslistwidget.cpp
@@ -131,6 +131,7 @@ void ConfigurePluginsListWidget::fillTopItems(const QVector<PimCommon::PluginUti
subItem->mEnableByDefault = data.mEnableByDefault;
subItem->mHasConfigureSupport = data.mHasConfigureDialog;
const bool isPluginActivated = PimCommon::PluginUtil::isPluginActivated(pair.first, pair.second, data.mEnableByDefault, data.mIdentifier);
+ subItem->mEnableFromUserSettings = isPluginActivated;
subItem->setCheckState(0, isPluginActivated ? Qt::Checked : Qt::Unchecked);
if (data.mHasConfigureDialog) {
QToolButton *but = new QToolButton(mListWidget);
@@ -169,3 +170,9 @@ void ConfigurePluginsListWidget::changeState(const QList<PluginItem *> &items)
}
}
+void ConfigurePluginsListWidget::resetToUserSettings(const QList<PluginItem *> &items)
+{
+ Q_FOREACH (PluginItem *item, items) {
+ item->setCheckState(0, item->mEnableFromUserSettings ? Qt::Checked : Qt::Unchecked);
+ }
+}
diff --git a/src/configureplugins/configurepluginslistwidget.h b/src/configureplugins/configurepluginslistwidget.h
index b54a5d4..b149716 100644
--- a/src/configureplugins/configurepluginslistwidget.h
+++ b/src/configureplugins/configurepluginslistwidget.h
@@ -55,7 +55,8 @@ protected:
PluginItem(QTreeWidgetItem *parent)
: QTreeWidgetItem(parent),
mEnableByDefault(false),
- mHasConfigureSupport(false)
+ mHasConfigureSupport(false),
+ mEnableFromUserSettings(false)
{
}
@@ -63,9 +64,11 @@ protected:
QString mDescription;
bool mEnableByDefault;
bool mHasConfigureSupport;
+ bool mEnableFromUserSettings;
};
void savePlugins(const QString &groupName, const QString &prefixSettingKey, const QList<PluginItem *> &listItems);
void fillTopItems(const QVector<PimCommon::PluginUtilData> &lst, const QString &topLevelItemName, const QString &groupName, const QString &prefixKey, QList<PluginItem *> &itemsList, const QString &configureGroupName = QString());
+ void resetToUserSettings(const QList<PluginItem *> &items);
void changeState(const QList<PluginItem *> &items);
QTreeWidget *mListWidget;