diff --git a/plugins/messageviewerheaderplugins/CMakeLists.txt b/plugins/messageviewerheaderplugins/CMakeLists.txt index e4200c5aca06882568e1326c9e17634106618fba..1a7f09f12ec4a00628af7a185936a378fc5494c1 100644 --- a/plugins/messageviewerheaderplugins/CMakeLists.txt +++ b/plugins/messageviewerheaderplugins/CMakeLists.txt @@ -6,7 +6,6 @@ add_subdirectory(enterpriseheaderstyleplugin) add_subdirectory(fancyheaderstyleplugin) add_subdirectory(grantleeheaderstyleplugin) add_subdirectory(longheaderstyleplugin) -add_subdirectory(standardsheaderstyleplugin) add_subdirectory(defaultgrantleeheaderstyleplugin) if(BUILD_TESTING) add_subdirectory(autotests) diff --git a/plugins/messageviewerheaderplugins/autotests/CMakeLists.txt b/plugins/messageviewerheaderplugins/autotests/CMakeLists.txt index dd637aa12fd01bc4ac0c719ab3f6ec09a7ac77ce..464e4714183bd34424b98abb5c10fa2d8dc89406 100644 --- a/plugins/messageviewerheaderplugins/autotests/CMakeLists.txt +++ b/plugins/messageviewerheaderplugins/autotests/CMakeLists.txt @@ -34,6 +34,4 @@ add_messageviewer_header_unittest( grantleeheaderstyleplugintest.cpp "../grantle add_messageviewer_header_unittest( longheaderstyleplugintest.cpp "../longheaderstyleplugin/longheaderstyleplugin.cpp;../longheaderstyleplugin/longheaderstyleinterface.cpp") -add_messageviewer_header_unittest( standardsheaderstyleplugintest.cpp "../standardsheaderstyleplugin/standardheaderstrategy.cpp;../standardsheaderstyleplugin/standardsheaderstyleplugin.cpp;../standardsheaderstyleplugin/standardsheaderstyleinterface.cpp") - add_messageviewer_header_class_unittest( headerstylepluginmanagertest.cpp) diff --git a/plugins/messageviewerheaderplugins/autotests/standardsheaderstyleplugintest.cpp b/plugins/messageviewerheaderplugins/autotests/standardsheaderstyleplugintest.cpp deleted file mode 100644 index 490ef48fce1109eac6b0bd908c11693f74714553..0000000000000000000000000000000000000000 --- a/plugins/messageviewerheaderplugins/autotests/standardsheaderstyleplugintest.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright (c) 2015-2016 Montel Laurent - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "standardsheaderstyleplugintest.h" -#include "../standardsheaderstyleplugin/standardsheaderstyleplugin.h" -#include "../standardsheaderstyleplugin/standardsheaderstyleinterface.h" -#include -#include -#include -#include - -StandardsHeaderStylePluginTest::StandardsHeaderStylePluginTest(QObject *parent) - : QObject(parent) -{ - -} - -StandardsHeaderStylePluginTest::~StandardsHeaderStylePluginTest() -{ - -} - -void StandardsHeaderStylePluginTest::shouldHaveDefaultValue() -{ - MessageViewer::StandardsHeaderStylePlugin plugin; - QVERIFY(plugin.headerStyle()); - QVERIFY(plugin.headerStrategy()); -} - -void StandardsHeaderStylePluginTest::shouldCreateInterface() -{ - MessageViewer::StandardsHeaderStylePlugin plugin; - KActionMenu *menu = new KActionMenu(this); - QActionGroup *act = new QActionGroup(this); - - MessageViewer::HeaderStyleInterface *interface = plugin.createView(menu, act, new KActionCollection(this)); - QVERIFY(interface); - QVERIFY(!interface->action().isEmpty()); -} - -QTEST_MAIN(StandardsHeaderStylePluginTest) diff --git a/plugins/messageviewerheaderplugins/autotests/standardsheaderstyleplugintest.h b/plugins/messageviewerheaderplugins/autotests/standardsheaderstyleplugintest.h deleted file mode 100644 index 373f364455845d084f735a862ab082581ae4093d..0000000000000000000000000000000000000000 --- a/plugins/messageviewerheaderplugins/autotests/standardsheaderstyleplugintest.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - Copyright (c) 2015-2016 Montel Laurent - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef STANDARDSHEADERSTYLEPLUGINTEST_H -#define STANDARDSHEADERSTYLEPLUGINTEST_H - -#include - -class StandardsHeaderStylePluginTest : public QObject -{ - Q_OBJECT -public: - explicit StandardsHeaderStylePluginTest(QObject *parent = Q_NULLPTR); - ~StandardsHeaderStylePluginTest(); - -private Q_SLOTS: - void shouldHaveDefaultValue(); - void shouldCreateInterface(); -}; - -#endif // STANDARDSHEADERSTYLEPLUGINTEST_H diff --git a/plugins/messageviewerheaderplugins/standardsheaderstyleplugin/CMakeLists.txt b/plugins/messageviewerheaderplugins/standardsheaderstyleplugin/CMakeLists.txt deleted file mode 100644 index 39dd2b270f4a9d992501ba38a13ac7cf230730f7..0000000000000000000000000000000000000000 --- a/plugins/messageviewerheaderplugins/standardsheaderstyleplugin/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -set(messageviewer_standardsheaderstyleplugin_SRCS - standardsheaderstyleplugin.cpp - standardsheaderstyleinterface.cpp - standardheaderstrategy.cpp -) - -add_library(messageviewer_standardsheaderstyleplugin MODULE ${messageviewer_standardsheaderstyleplugin_SRCS}) - -target_link_libraries(messageviewer_standardsheaderstyleplugin - KF5::MessageViewer - KF5::XmlGui - KF5::GrantleeTheme - KF5::I18n -) - -install(TARGETS messageviewer_standardsheaderstyleplugin DESTINATION ${PLUGIN_INSTALL_DIR}/messageviewer) diff --git a/plugins/messageviewerheaderplugins/standardsheaderstyleplugin/messageviewer_standardsheaderstyleplugin.json b/plugins/messageviewerheaderplugins/standardsheaderstyleplugin/messageviewer_standardsheaderstyleplugin.json deleted file mode 100644 index f25be94eec72e10e0071eee8ec717d147fa99392..0000000000000000000000000000000000000000 --- a/plugins/messageviewerheaderplugins/standardsheaderstyleplugin/messageviewer_standardsheaderstyleplugin.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "KPlugin": { - "Name": "Standards Header Style", - "Name[ca@valencia]": "Estil de capçalera estàndard", - "Name[ca]": "Estil de capçalera estàndard", - "Name[de]": "Vorspann-Design „Standard“", - "Name[es]": "Estilo de encabezado estándar", - "Name[fi]": "Vakio-otsaketyyli", - "Name[gl]": "Estilo de cabeceira estándar", - "Name[it]": "Stile con intestazioni standard", - "Name[nl]": "Stijl met standaard headers", - "Name[pl]": "Standardowe nagłówki", - "Name[pt]": "Estilo de Cabeçalho-Padrão", - "Name[pt_BR]": "Estilo de cabeçalho Padrão", - "Name[ru]": "Стандартный стиль заголовков", - "Name[sk]": "Štandardný štýl hlavičiek", - "Name[sl]": "Slog z običajnimi glavami", - "Name[sr@ijekavian]": "стандардни стил заглавља", - "Name[sr@ijekavianlatin]": "standardni stil zaglavlja", - "Name[sr@latin]": "standardni stil zaglavlja", - "Name[sr]": "стандардни стил заглавља", - "Name[sv]": "Vanlig rubrikstil", - "Name[uk]": "Стандартний стиль заголовків", - "Name[x-test]": "xxStandards Header Stylexx", - "Name[zh_CN]": "标准信头风格", - "ServiceTypes": [ - "MessageViewerHeaderStyle/Plugin" - ], - "Version": "1.0" - }, - "X-KDE-MessageViewer-Header-Order": "4" -} \ No newline at end of file diff --git a/plugins/messageviewerheaderplugins/standardsheaderstyleplugin/standardheaderstrategy.cpp b/plugins/messageviewerheaderplugins/standardsheaderstyleplugin/standardheaderstrategy.cpp deleted file mode 100644 index 211f123fc037591f03a9830b7c471256572fe489..0000000000000000000000000000000000000000 --- a/plugins/messageviewerheaderplugins/standardsheaderstyleplugin/standardheaderstrategy.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright (c) 2015-2016 Montel Laurent - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "standardheaderstrategy.h" - -using namespace MessageViewer; -static const char *const standardHeaders[] = { - "subject", "from", "cc", "bcc", "to" -}; -static const int numStandardHeaders = sizeof standardHeaders / sizeof * standardHeaders; - -StandardHeaderStrategy::StandardHeaderStrategy() - : HeaderStrategy(), - mHeadersToDisplay(stringList(standardHeaders, numStandardHeaders)) -{ - -} - -StandardHeaderStrategy::~StandardHeaderStrategy() -{ - -} diff --git a/plugins/messageviewerheaderplugins/standardsheaderstyleplugin/standardheaderstrategy.h b/plugins/messageviewerheaderplugins/standardsheaderstyleplugin/standardheaderstrategy.h deleted file mode 100644 index 84b9cffb338ae0d9989803b63538f55e873b43ea..0000000000000000000000000000000000000000 --- a/plugins/messageviewerheaderplugins/standardsheaderstyleplugin/standardheaderstrategy.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright (c) 2015-2016 Montel Laurent - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef STANDARDHEADERSTRATEGY_H -#define STANDARDHEADERSTRATEGY_H - -#include -#include - -namespace MessageViewer -{ -// -// StandardHeaderStrategy: -// BCC, CC, Date, From, Subject, To -// - -class StandardHeaderStrategy : public HeaderStrategy -{ -public: - StandardHeaderStrategy(); - ~StandardHeaderStrategy(); - -public: - const char *name() const Q_DECL_OVERRIDE - { - return "standard"; - } - - QStringList headersToDisplay() const Q_DECL_OVERRIDE - { - return mHeadersToDisplay; - } - DefaultPolicy defaultPolicy() const Q_DECL_OVERRIDE - { - return Hide; - } - -private: - const QStringList mHeadersToDisplay; -}; - -} -#endif // STANDARDHEADERSTRATEGY_H diff --git a/plugins/messageviewerheaderplugins/standardsheaderstyleplugin/standardsheaderstyleinterface.cpp b/plugins/messageviewerheaderplugins/standardsheaderstyleplugin/standardsheaderstyleinterface.cpp deleted file mode 100644 index be42a9e9c3bbdc50b475e9fff2128c8fe643bb05..0000000000000000000000000000000000000000 --- a/plugins/messageviewerheaderplugins/standardsheaderstyleplugin/standardsheaderstyleinterface.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright (c) 2015-2016 Montel Laurent - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "standardsheaderstyleinterface.h" -#include -#include -#include - -using namespace MessageViewer; -StandardsHeaderStyleInterface::StandardsHeaderStyleInterface(MessageViewer::HeaderStylePlugin *plugin, QObject *parent) - : MessageViewer::HeaderStyleInterface(plugin, parent) -{ - -} - -StandardsHeaderStyleInterface::~StandardsHeaderStyleInterface() -{ - -} - -void StandardsHeaderStyleInterface::createAction(KActionMenu *menu, QActionGroup *actionGroup, KActionCollection *ac) -{ - KToggleAction *act = new KToggleAction(i18nc("View->headers->", "&Standard Headers"), this); - ac->addAction(QStringLiteral("view_headers_standard"), act); - connect(act, &KToggleAction::triggered, this, &StandardsHeaderStyleInterface::slotStyleChanged); - addHelpTextAction(act, i18n("Show standard list of message headers")); - mAction.append(act); - addActionToMenu(menu, actionGroup); -} - -void StandardsHeaderStyleInterface::activateAction() -{ - mAction.at(0)->setChecked(true); -} - diff --git a/plugins/messageviewerheaderplugins/standardsheaderstyleplugin/standardsheaderstyleinterface.h b/plugins/messageviewerheaderplugins/standardsheaderstyleplugin/standardsheaderstyleinterface.h deleted file mode 100644 index a875f8fdea2e8ac870ed5f9341579f1ab522ecb2..0000000000000000000000000000000000000000 --- a/plugins/messageviewerheaderplugins/standardsheaderstyleplugin/standardsheaderstyleinterface.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright (c) 2015-2016 Montel Laurent - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef STANDARDSHEADERSTYLEINTERFACE_H -#define STANDARDSHEADERSTYLEINTERFACE_H - -#include - -namespace MessageViewer -{ - -class StandardsHeaderStyleInterface : public MessageViewer::HeaderStyleInterface -{ - Q_OBJECT -public: - explicit StandardsHeaderStyleInterface(HeaderStylePlugin *plugin, QObject *parent = Q_NULLPTR); - ~StandardsHeaderStyleInterface(); - - void createAction(KActionMenu *menu, QActionGroup *actionGroup, KActionCollection *ac) Q_DECL_OVERRIDE; - void activateAction() Q_DECL_OVERRIDE; -}; - -} - -#endif // STANDARDSHEADERSTYLEINTERFACE_H diff --git a/plugins/messageviewerheaderplugins/standardsheaderstyleplugin/standardsheaderstyleplugin.cpp b/plugins/messageviewerheaderplugins/standardsheaderstyleplugin/standardsheaderstyleplugin.cpp deleted file mode 100644 index 9edb9f7091d8b05e51952eb2c74112b2b2a2f539..0000000000000000000000000000000000000000 --- a/plugins/messageviewerheaderplugins/standardsheaderstyleplugin/standardsheaderstyleplugin.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright (c) 2015-2016 Montel Laurent - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "standardsheaderstyleplugin.h" -#include "standardsheaderstyleinterface.h" -#include "standardheaderstrategy.h" -#include "messageviewer/plainheaderstyle.h" -#include -using namespace MessageViewer; - -K_PLUGIN_FACTORY_WITH_JSON(MessageViewerStandardsHeaderStylePluginFactory, "messageviewer_standardsheaderstyleplugin.json", registerPlugin();) - -StandardsHeaderStylePlugin::StandardsHeaderStylePlugin(QObject *parent, const QList &) - : MessageViewer::HeaderStylePlugin(parent), - mHeaderStyle(new PlainHeaderStyle), - mHeaderStrategy(new StandardHeaderStrategy) -{ -} - -StandardsHeaderStylePlugin::~StandardsHeaderStylePlugin() -{ - -} - -HeaderStyle *StandardsHeaderStylePlugin::headerStyle() const -{ - return mHeaderStyle; -} - -HeaderStrategy *StandardsHeaderStylePlugin::headerStrategy() const -{ - return mHeaderStrategy; -} - -HeaderStyleInterface *StandardsHeaderStylePlugin::createView(KActionMenu *menu, QActionGroup *actionGroup, KActionCollection *ac, QObject *parent) -{ - MessageViewer::HeaderStyleInterface *view = new MessageViewer::StandardsHeaderStyleInterface(this, parent); - if (ac) { - view->createAction(menu, actionGroup, ac); - } - return view; -} - -QString StandardsHeaderStylePlugin::name() const -{ - return QStringLiteral("standards-header"); -} - -#include "standardsheaderstyleplugin.moc" diff --git a/plugins/messageviewerheaderplugins/standardsheaderstyleplugin/standardsheaderstyleplugin.h b/plugins/messageviewerheaderplugins/standardsheaderstyleplugin/standardsheaderstyleplugin.h deleted file mode 100644 index f81a1b9ecc2d17aa6f3703f7869dcd4a6915a4bb..0000000000000000000000000000000000000000 --- a/plugins/messageviewerheaderplugins/standardsheaderstyleplugin/standardsheaderstyleplugin.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright (c) 2015-2016 Montel Laurent - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef STANDARDSHEADERSTYLEPLUGIN_H -#define STANDARDSHEADERSTYLEPLUGIN_H - -#include "messageviewer/headerstyleplugin.h" - -#include - -namespace MessageViewer -{ -class StandardsHeaderStylePlugin : public MessageViewer::HeaderStylePlugin -{ - Q_OBJECT -public: - explicit StandardsHeaderStylePlugin(QObject *parent = Q_NULLPTR, const QList & = QList()); - ~StandardsHeaderStylePlugin(); - - HeaderStyle *headerStyle() const Q_DECL_OVERRIDE; - HeaderStrategy *headerStrategy() const Q_DECL_OVERRIDE; - HeaderStyleInterface *createView(KActionMenu *menu, QActionGroup *actionGroup, KActionCollection *ac, QObject *parent = Q_NULLPTR) Q_DECL_OVERRIDE; - QString name() const Q_DECL_OVERRIDE; -private: - HeaderStyle *mHeaderStyle; - HeaderStrategy *mHeaderStrategy; -}; -} -#endif // STANDARDSHEADERSTYLEPLUGIN_H