From d41a05898585899c698a4b9c9cab1ef9948569e6 Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Sun, 29 May 2016 07:49:25 +0200 Subject: [PATCH] Allow to hide/show action in headerstyle --- .../defaultgrantleeheaderstyleplugin.cpp | 7 +++++++ .../defaultgrantleeheaderstyleplugin.h | 1 + .../settings/defaultgrantleeheaderstyleplugin.kcfg | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/messageviewerheaderplugins/defaultgrantleeheaderstyleplugin/defaultgrantleeheaderstyleplugin.cpp b/plugins/messageviewerheaderplugins/defaultgrantleeheaderstyleplugin/defaultgrantleeheaderstyleplugin.cpp index 4b4e26b7..a8ddd3fb 100644 --- a/plugins/messageviewerheaderplugins/defaultgrantleeheaderstyleplugin/defaultgrantleeheaderstyleplugin.cpp +++ b/plugins/messageviewerheaderplugins/defaultgrantleeheaderstyleplugin/defaultgrantleeheaderstyleplugin.cpp @@ -17,6 +17,7 @@ #include "defaultgrantleeheaderstyleinterface.h" #include "defaultgrantleeheaderstyleplugin.h" +#include "globalsettings_base.h" #include #include "defaultgrantleeheaderstrategy.h" #include @@ -29,6 +30,7 @@ DefaultGrantleeHeaderStylePlugin::DefaultGrantleeHeaderStylePlugin(QObject *pare mHeaderStyle(new GrantleeHeaderStyle), mHeaderStrategy(new DefaultGrantleeHeaderStrategy) { + initializePlugin(); } DefaultGrantleeHeaderStylePlugin::~DefaultGrantleeHeaderStylePlugin() @@ -36,6 +38,11 @@ DefaultGrantleeHeaderStylePlugin::~DefaultGrantleeHeaderStylePlugin() } +void DefaultGrantleeHeaderStylePlugin::initializePlugin() +{ + mHeaderStyle->setShowMailAction(DefaultGrantleeHeaderStylePluginSettings::self()->showActionMail()); +} + HeaderStyle *DefaultGrantleeHeaderStylePlugin::headerStyle() const { return mHeaderStyle; diff --git a/plugins/messageviewerheaderplugins/defaultgrantleeheaderstyleplugin/defaultgrantleeheaderstyleplugin.h b/plugins/messageviewerheaderplugins/defaultgrantleeheaderstyleplugin/defaultgrantleeheaderstyleplugin.h index e7f2bf31..3b072d2c 100644 --- a/plugins/messageviewerheaderplugins/defaultgrantleeheaderstyleplugin/defaultgrantleeheaderstyleplugin.h +++ b/plugins/messageviewerheaderplugins/defaultgrantleeheaderstyleplugin/defaultgrantleeheaderstyleplugin.h @@ -37,6 +37,7 @@ public: HeaderStyleInterface *createView(KActionMenu *menu, QActionGroup *actionGroup, KActionCollection *ac, QObject *parent = Q_NULLPTR) Q_DECL_OVERRIDE; QString name() const Q_DECL_OVERRIDE; private: + void initializePlugin(); GrantleeHeaderStyle *mHeaderStyle; HeaderStrategy *mHeaderStrategy; }; diff --git a/plugins/messageviewerheaderplugins/defaultgrantleeheaderstyleplugin/settings/defaultgrantleeheaderstyleplugin.kcfg b/plugins/messageviewerheaderplugins/defaultgrantleeheaderstyleplugin/settings/defaultgrantleeheaderstyleplugin.kcfg index dcc1dcef..64b0c215 100644 --- a/plugins/messageviewerheaderplugins/defaultgrantleeheaderstyleplugin/settings/defaultgrantleeheaderstyleplugin.kcfg +++ b/plugins/messageviewerheaderplugins/defaultgrantleeheaderstyleplugin/settings/defaultgrantleeheaderstyleplugin.kcfg @@ -8,7 +8,7 @@ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/sta 5.2 - true + false -- GitLab