[Gpg4win-commits] [git] Gpg4win - branch, master, updated. gpg4win-2.3.1-140-g4775fc5

by Andre Heinecke cvs at cvs.gnupg.org
Wed Apr 27 18:30:00 CEST 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG for Windows".

The branch, master has been updated
       via  4775fc5148a4fe0d1a40e3e30ef6e90c2dd3bcb6 (commit)
      from  4127017afeb97272435e0cbc4080118007e89b03 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4775fc5148a4fe0d1a40e3e30ef6e90c2dd3bcb6
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Wed Apr 27 18:28:45 2016 +0200

    Update Kleopatra and remove applied patches
    
    * Makefile.am (EXTRA_DIST): Remove patches.
    * packages/packages.current (kleopatra): Update.
    * patches/kleopatra: Remove all but one very ugly patch.
    
    --
    I finally got around to cleaning the patches up enough to commit them
    properly.

diff --git a/Makefile.am b/Makefile.am
index 2824eac..9a2e80a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -51,10 +51,6 @@ EXTRA_DIST = autogen.sh README.GIT ONEWS \
         patches/kiconthemes/0001-Make-DBus-optional.patch \
         patches/qtsvg/qtsvg-link-zlib.patch \
         patches/extra-cmake-modules/0001-Add-convert-utility-support-for-Windows-icons.patch \
-        patches/kleopatra/0001-Implement-KDBusService-alternative-for-Windows.patch \
-        patches/kleopatra/0002-Add-alternative-configuredialog-wihout-KCMUtils.patch \
-        patches/kleopatra/0003-Add-option-to-disable-KWatchGnuPG.patch \
-        patches/kleopatra/0004-Make-DBus-integration-of-the-smime-conf-optional.patch \
         patches/kleopatra/0005-Hack-generated-conf-files-for-Crosscompiling.patch \
 	patches/libgpg-error-1.21/0001-Add-FD_ISSET-replacement-for-Windows.patch
 
diff --git a/packages/packages.current b/packages/packages.current
index cb01cf1..ace5ddc 100644
--- a/packages/packages.current
+++ b/packages/packages.current
@@ -541,5 +541,5 @@ chk d07988acf4398583580f0f55aae73c3082687fba19d2aa8048979d53a82cf592
 # last changed: see package date.
 # by: ah
 # verified: Tarball created by ah.
-file kleopatra/kleopatra-201604191441.tar.gz
-chk 861cea4d59117a1fb8f98338c050dc50e9e940f12093aa2f86149eabc07e7d80
+file kleopatra/kleopatra-201604271827.tar.gz
+chk 131d6baece998ea22f64c1492e98f0c32eaf23592dfc47e7eecd7026f4f1d66d
diff --git a/patches/kleopatra/0001-Implement-KDBusService-alternative-for-Windows.patch b/patches/kleopatra/0001-Implement-KDBusService-alternative-for-Windows.patch
deleted file mode 100755
index 7cff6ed..0000000
--- a/patches/kleopatra/0001-Implement-KDBusService-alternative-for-Windows.patch
+++ /dev/null
@@ -1,750 +0,0 @@
-#! /bin/sh
-patch -p1 -l -f $* < $0
-exit $?
-
-From 243a5fccc82d7b398ec3cc8509e0900eac5d35af Mon Sep 17 00:00:00 2001
-From: Andre Heinecke <aheinecke at intevation.de>
-Date: Fri, 29 Jan 2016 17:00:54 +0100
-Subject: [PATCH 1/5] Implement KDBusService alternative for Windows
-
-Instead of using KDBusService we can just use Window
-Messages to communicate with other processes on Windows.
----
- CMakeLists.txt                    |  15 ++-
- autotests/CMakeLists.txt          |  13 +++
- autotests/kuniqueservicetest.cpp  | 177 ++++++++++++++++++++++++++++++
- src/kleopatraapplication.cpp      |   2 +
- src/kwatchgnupg/CMakeLists.txt    |   6 ++
- src/kwatchgnupg/main.cpp          |   4 +-
- src/main.cpp                      |   7 +-
- src/utils/kuniqueservice.h        |  91 ++++++++++++++++
- src/utils/kuniqueservice_dbus.cpp |  64 +++++++++++
- src/utils/kuniqueservice_win.cpp  | 219 ++++++++++++++++++++++++++++++++++++++
- 10 files changed, 591 insertions(+), 7 deletions(-)
- create mode 100644 autotests/CMakeLists.txt
- create mode 100644 autotests/kuniqueservicetest.cpp
- create mode 100644 src/utils/kuniqueservice.h
- create mode 100644 src/utils/kuniqueservice_dbus.cpp
- create mode 100644 src/utils/kuniqueservice_win.cpp
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 2fddf22..7970ffe 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -32,7 +32,6 @@ include(ECMQtDeclareLoggingCategory)
-
- # Find KF5 packages
- find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
--find_package(KF5DBusAddons ${KF5_VERSION} CONFIG REQUIRED)
- find_package(KF5KCMUtils ${KF5_VERSION} CONFIG REQUIRED)
- find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
- find_package(KF5I18n ${KF5_VERSION} CONFIG REQUIRED)
-@@ -45,6 +44,19 @@ find_package(KF5DocTools REQUIRED)
-
- set_package_properties(KF5DocTools PROPERTIES DESCRIPTION "Documentation tools" TYPE OPTIONAL PURPOSE "Required to generate Kleopatra documentation.")
-
-+# Optional packages
-+if (WIN32)
-+  # Only a replacement available for Windows so this
-+  # is required on other platforms.
-+  find_package(KF5DBusAddons ${KF5_VERSION} CONFIG)
-+  set_package_properties(KF5DBusAddons PROPERTIES DESCRIPTION "Support library to work with DBus"
-+                         PURPOSE "DBus session integration"
-+                         URL "http://inqlude.org/libraries/kdbusaddons.html"
-+                         TYPE OPTIONAL)
-+else()
-+  find_package(KF5DBusAddons ${KF5_VERSION} CONFIG REQUIRED)
-+endif()
-+
- # Kdepimlibs packages
- find_package(KF5Libkleo ${LIBKLEO_VERSION} CONFIG REQUIRED)
- find_package(KF5Mime ${KMIME_VERSION} CONFIG REQUIRED)
-@@ -116,6 +128,7 @@ add_subdirectory(src)
-
- if(BUILD_TESTING)
-     add_subdirectory(tests)
-+    add_subdirectory(autotests)
- endif()
- install( FILES kleopatra.categories DESTINATION ${KDE_INSTALL_CONFDIR} )
-
-diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt
-new file mode 100644
-index 0000000..b987250
---- /dev/null
-+++ b/autotests/CMakeLists.txt
-@@ -0,0 +1,13 @@
-+set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
-+
-+if (KF5DBusAddons_FOUND)
-+    set(kuniqueservicetest_src kuniqueservicetest.cpp ../utils/kuniqueservice_dbus.cpp)
-+else()
-+    set(kuniqueservicetest_src kuniqueservicetest.cpp ../utils/kuniqueservice_win.cpp)
-+endif()
-+
-+ecm_qt_declare_logging_category(kuniqueservicetest_src HEADER kleopatra_debug.h IDENTIFIER KLEOPATRA_LOG CATEGORY_NAME log_kleopatra)
-+add_executable(kuniqueservicetest ${kuniqueservicetest_src})
-+add_test(kuniqueservicetest kuniqueservicetest)
-+ecm_mark_as_test(kuniqueservicetest)
-+target_link_libraries(kuniqueservicetest Qt5::Test ${_kleopatra_dbusaddons_libs})
-diff --git a/autotests/kuniqueservicetest.cpp b/autotests/kuniqueservicetest.cpp
-new file mode 100644
-index 0000000..1a83a5e
---- /dev/null
-+++ b/autotests/kuniqueservicetest.cpp
-@@ -0,0 +1,177 @@
-+/* This file is part of Kleopatra
-+
-+   Copyright (c) 2016 Intevation GmbH
-+
-+   It is based on libkdbus kdbusservicetest which is:
-+
-+   Copyright (c) 1999 Waldo Bastian <bastian at kde.org>
-+   Copyright (c) 2011 David Faure <faure at kde.org>
-+   Copyright (c) 2011 Kevin Ottens <ervin at kde.org>
-+
-+   This library is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU Library General Public
-+   License version 2 as published by the Free Software Foundation.
-+
-+   This library 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
-+   Library General Public License for more details.
-+
-+   You should have received a copy of the GNU Library General Public License
-+   along with this library; see the file COPYING.LIB.  If not, write to
-+   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-+   Boston, MA 02110-1301, USA.
-+*/
-+
-+/* The main modification in this test is that every activateRequested
-+ * call needs to set the exit code to signal the application it's done. */
-+
-+#include <QCoreApplication>
-+#include <QDebug>
-+#include <QDir>
-+#include <QFile>
-+#include <QMetaObject>
-+#include <QProcess>
-+#include <QTimer>
-+
-+#include "utils/kuniqueservice.h"
-+
-+#include <stdio.h>
-+
-+class TestObject : public QObject
-+{
-+    Q_OBJECT
-+public:
-+    TestObject(KUniqueService *service)
-+        : m_proc(Q_NULLPTR), m_callCount(0),
-+          m_service(service)
-+    {}
-+
-+    ~TestObject()
-+    {
-+        if (m_proc) {
-+            m_proc->waitForFinished();
-+        }
-+    }
-+
-+    int callCount() const
-+    {
-+        return m_callCount;
-+    }
-+
-+private Q_SLOTS:
-+    void slotActivateRequested(const QStringList &args, const QString &workingDirectory)
-+    {
-+        Q_UNUSED(workingDirectory);
-+        qDebug() << "Application executed with args" << args;
-+
-+        ++m_callCount;
-+
-+        if (m_callCount == 1) {
-+            Q_ASSERT(args.count() == 1);
-+            Q_ASSERT(args.at(0) == QLatin1String("dummy call"));
-+            m_service->setExitValue(0);
-+        } else if (m_callCount == 2) {
-+            Q_ASSERT(args.count() == 2);
-+            Q_ASSERT(args.at(1) == QLatin1String("bad call"));
-+            m_service->setExitValue(4);
-+        } else if (m_callCount == 3) {
-+            Q_ASSERT(args.count() == 3);
-+            Q_ASSERT(args.at(1) == QLatin1String("real call"));
-+            Q_ASSERT(args.at(2) == QLatin1String("second arg"));
-+            m_service->setExitValue(0);
-+            // OK, all done, quit
-+            QCoreApplication::instance()->quit();
-+        }
-+    }
-+
-+    void slotProcessFinished(int exitCode, QProcess::ExitStatus exitStatus)
-+    {
-+        Q_UNUSED(exitStatus)
-+        qDebug() << "Process exited with code" << exitCode;
-+        m_proc = 0;
-+        if (m_callCount == 2) {
-+            Q_ASSERT(exitCode == 4);
-+            secondCall();
-+        }
-+    }
-+
-+    void firstCall()
-+    {
-+        QStringList args;
-+        args << QStringLiteral("bad call");
-+        executeNewChild(args);
-+    }
-+
-+    void secondCall()
-+    {
-+        QStringList args;
-+        args << QStringLiteral("real call") << QStringLiteral("second arg");
-+        executeNewChild(args);
-+    }
-+
-+private:
-+    void executeNewChild(const QStringList &args)
-+    {
-+        // Duplicated from kglobalsettingstest.cpp - make a shared helper method?
-+        m_proc = new QProcess(this);
-+        connect(m_proc, SIGNAL(finished(int,QProcess::ExitStatus)),
-+                this, SLOT(slotProcessFinished(int,QProcess::ExitStatus)));
-+        QString appName = QStringLiteral("kuniqueservicetest");
-+#ifdef Q_OS_WIN
-+        appName += QStringLiteral(".exe");
-+#else
-+        if (QFile::exists(appName + QStringLiteral(".shell"))) {
-+            appName = QStringLiteral("./") + appName + QStringLiteral(".shell");
-+        } else {
-+            Q_ASSERT(QFile::exists(appName));
-+            appName = QStringLiteral("./") + appName;
-+        }
-+#endif
-+        qDebug() << "about to run" << appName << args;
-+        m_proc->start(appName, args);
-+    }
-+
-+    QProcess *m_proc;
-+    int m_callCount;
-+    KUniqueService *m_service;
-+};
-+
-+int main(int argc, char *argv[])
-+{
-+    QCoreApplication a(argc, argv);
-+
-+    QCoreApplication::setApplicationName(QStringLiteral("kuniqueservicetest"));
-+    QCoreApplication::setOrganizationDomain(QStringLiteral("kde.org"));
-+
-+    KUniqueService service;
-+    TestObject testObject(&service);
-+    QObject::connect(&service, SIGNAL(activateRequested(QStringList, QString)),
-+                     &testObject, SLOT(slotActivateRequested(QStringList, QString)));
-+
-+    // Testcase for the problem coming from the old fork-on-startup solution:
-+    // the "Activate" D-Bus call would time out if the app took too much time
-+    // to be ready.
-+    //printf("Sleeping.\n");
-+    //sleep(200);
-+    QStringList args;
-+    args << QStringLiteral("dummy call");
-+
-+    QMetaObject::invokeMethod(&service, "activateRequested",
-+                              Qt::QueuedConnection,
-+                              Q_ARG(QStringList, args),
-+                              Q_ARG(QString, QDir::currentPath()));
-+    QTimer::singleShot(400, &testObject, SLOT(firstCall()));
-+
-+    qDebug() << "Running.";
-+    a.exec();
-+    qDebug() << "Terminating.";
-+
-+    Q_ASSERT(testObject.callCount() == 3);
-+    const bool ok = testObject.callCount() == 3;
-+
-+    return ok ? 0 : 1;
-+}
-+
-+#include "kuniqueservicetest.moc"
-+
-diff --git a/src/kleopatraapplication.cpp b/src/kleopatraapplication.cpp
-index f4b3b55..1f58c54 100644
---- a/src/kleopatraapplication.cpp
-+++ b/src/kleopatraapplication.cpp
-@@ -236,7 +236,9 @@ void KleopatraApplication::slotActivateRequested(const QStringList &arguments,
-     if (!err.isEmpty()) {
-         KMessageBox::sorry(NULL, err.toHtmlEscaped(), i18n("Failed to execute command"));
-         Q_EMIT setExitValue(1);
-+        return;
-     }
-+    Q_EMIT setExitValue(0);
- }
-
- QString KleopatraApplication::newInstance(const QCommandLineParser &parser,
-diff --git a/src/kwatchgnupg/CMakeLists.txt b/src/kwatchgnupg/CMakeLists.txt
-index beda545..338cad5 100644
---- a/src/kwatchgnupg/CMakeLists.txt
-+++ b/src/kwatchgnupg/CMakeLists.txt
-@@ -9,6 +9,12 @@ set(kwatchgnupg_SRCS
-   tray.cpp
-   main.cpp
- )
-+if (KF5DBusAddons_FOUND)
-+  set(kwatchgnupg_SRCS ${kwatchgnupg_SRCS} ${kleopatra_SOURCE_DIR}/utils/kuniqueservice_dbus.cpp)
-+else()
-+  set(kwatchgnupg_SRCS ${kwatchgnupg_SRCS} ${kleopatra_SOURCE_DIR}/utils/kuniqueservice_win.cpp)
-+endif()
-+
- ecm_qt_declare_logging_category(kwatchgnupg_SRCS HEADER kwatchgnupg_debug.h IDENTIFIER KWATCHGNUPG_LOG CATEGORY_NAME log_kwatchgnupg)
- qt5_add_resources(kwatchgnupg_SRCS kwatchgnupg.qrc)
-
-diff --git a/src/kwatchgnupg/main.cpp b/src/kwatchgnupg/main.cpp
-index af7a4fd..78d2d7f 100644
---- a/src/kwatchgnupg/main.cpp
-+++ b/src/kwatchgnupg/main.cpp
-@@ -35,7 +35,7 @@
- #include "aboutdata.h"
- #include "kwatchgnupgmainwin.h"
- #include <kdelibs4configmigrator.h>
--#include <KDBusService>
-+#include "utils/kuniqueservice.h"
-
- #include <kmessagebox.h>
- #include <KLocalizedString>
-@@ -63,7 +63,7 @@ int main(int argc, char **argv)
-     parser.process(app);
-     aboutData.processCommandLine(&parser);
-
--    KDBusService service(KDBusService::Unique);
-+    KUniqueService service;
-
-     KWatchGnuPGMainWindow *mMainWin = new KWatchGnuPGMainWindow();
-     mMainWin->show();
-diff --git a/src/main.cpp b/src/main.cpp
-index 4b909d5..4a91273 100644
---- a/src/main.cpp
-+++ b/src/main.cpp
-@@ -43,6 +43,7 @@
-
- #include <utils/gnupg-helper.h>
- #include <utils/archivedefinition.h>
-+#include "utils/kuniqueservice.h"
-
- #ifdef HAVE_USABLE_ASSUAN
- # include <uiserver/uiserver.h>
-@@ -74,8 +75,6 @@ class UiServer;
- #include "kleopatra_debug.h"
- #include "kleopatra_options.h"
-
--#include <KDBusService>
--
- #include <KLocalizedString>
- #include <kiconloader.h>
- #include <QSplashScreen>
-@@ -213,8 +212,8 @@ int main(int argc, char **argv)
-
-     KLocalizedString::setApplicationDomain("kleopatra");
-
--    KDBusService service(KDBusService::Unique);
--    QObject::connect(&service, &KDBusService::activateRequested,
-+    KUniqueService service;
-+    QObject::connect(&service, &KUniqueService::activateRequested,
-                      &app, &KleopatraApplication::slotActivateRequested);
-     QObject::connect(&app, &KleopatraApplication::setExitValue,
-     &service, [&service](int i) {
-diff --git a/src/utils/kuniqueservice.h b/src/utils/kuniqueservice.h
-new file mode 100644
-index 0000000..074cf01
---- /dev/null
-+++ b/src/utils/kuniqueservice.h
-@@ -0,0 +1,91 @@
-+#ifndef KUNIQUESERVICE_H
-+#define KUNIQUESERVICE_H
-+/*
-+    kuniqueservice.h
-+
-+    This file is part of Kleopatra, the KDE keymanager
-+    Copyright (c) 2016 Intevation GmbH
-+
-+    Kleopatra is free software; you can redistribute it and/or modify
-+    it under the terms of the GNU General Public License as published by
-+    the Free Software Foundation; either version 2 of the License, or
-+    (at your option) any later version.
-+
-+    Kleopatra 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
-+
-+    In addition, as a special exception, the copyright holders give
-+    permission to link the code of this program with any edition of
-+    the Qt library by Trolltech AS, Norway (or with modified versions
-+    of Qt that use the same license as Qt), and distribute linked
-+    combinations including the two.  You must obey the GNU General
-+    Public License in all respects for all of the code used other than
-+    Qt.  If you modify this file, you may extend this exception to
-+    your version of the file, but you are not obligated to do so.  If
-+    you do not wish to do so, delete this exception statement from
-+    your version.
-+*/
-+#include <QObject>
-+#include <QString>
-+#include <QStringList>
-+
-+/**
-+ * This class can be used to create a unique service and redirect calls
-+ * to this service similarly to KDBusService(KDBusService::Unique).
-+ * @code
-+ *   YourApplication app(argc, argv);
-+ *
-+ *   KUniqueService service;
-+ *   QObject::connect(&service, &KUniqueService::activateRequested,
-+ *                    &app, &YourApplication::slotActivateRequested);
-+ *   QObject::connect(&app, &YourApplication::setExitValue,
-+ *   &service, [&service](int i) {
-+ *       service.setExitValue(i);
-+ *   });
-+ * @endcode
-+ * This will redirect calls to running instances over the
-+ * the slotActivateRequested. When you set the exit
-+ * value the calling process will afterwards exit with the
-+ * code provided.
-+ * If you do not set the exit value the application will not
-+ * be terminated.
-+ * @author Andre Heinecke (aheinecke at intevation.org)
-+ */
-+class KUniqueService : public QObject
-+{
-+    Q_OBJECT
-+public:
-+    /**
-+     * Default constructor
-+     */
-+    KUniqueService();
-+
-+public Q_SLOTS:
-+    /**
-+     * Set the exit @p code the second app should use to terminate.
-+     * If unset it exits with 0.
-+     * @param code The exit code.
-+     */
-+    void setExitValue(int code);
-+
-+Q_SIGNALS:
-+    void activateRequested(const QStringList &arguments,
-+                           const QString &workingDirectory);
-+
-+private:
-+    void emitActivateRequested(const QStringList &arguments,
-+                               const QString &workingDirectory)
-+    {
-+        Q_EMIT activateRequested(arguments, workingDirectory);
-+    }
-+    class KUniqueServicePrivate;
-+    Q_DECLARE_PRIVATE(KUniqueService)
-+    KUniqueServicePrivate *d_ptr;
-+};
-+#endif // KUNIQUESERVICE_H
-diff --git a/src/utils/kuniqueservice_dbus.cpp b/src/utils/kuniqueservice_dbus.cpp
-new file mode 100644
-index 0000000..cf4ef96
---- /dev/null
-+++ b/src/utils/kuniqueservice_dbus.cpp
-@@ -0,0 +1,64 @@
-+/*
-+    kuniqueservice_dbus.cpp
-+
-+    This file is part of Kleopatra, the KDE keymanager
-+    Copyright (c) 2016 Intevation GmbH
-+
-+    Kleopatra is free software; you can redistribute it and/or modify
-+    it under the terms of the GNU General Public License as published by
-+    the Free Software Foundation; either version 2 of the License, or
-+    (at your option) any later version.
-+
-+    Kleopatra 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
-+
-+    In addition, as a special exception, the copyright holders give
-+    permission to link the code of this program with any edition of
-+    the Qt library by Trolltech AS, Norway (or with modified versions
-+    of Qt that use the same license as Qt), and distribute linked
-+    combinations including the two.  You must obey the GNU General
-+    Public License in all respects for all of the code used other than
-+    Qt.  If you modify this file, you may extend this exception to
-+    your version of the file, but you are not obligated to do so.  If
-+    you do not wish to do so, delete this exception statement from
-+    your version.
-+*/
-+
-+#include "kuniqueservice.h"
-+#include <KDBusService>
-+
-+class KUniqueService::KUniqueServicePrivate
-+{
-+    Q_DISABLE_COPY(KUniqueServicePrivate)
-+
-+public:
-+    KUniqueServicePrivate(KUniqueService *q) : mService(KDBusService::Unique)
-+    {
-+        QObject::connect(&mService, &KDBusService::activateRequested,
-+                         q, &KUniqueService::activateRequested);
-+    }
-+
-+    void setExitValue(int code)
-+    {
-+        mService.setExitValue(code);
-+    }
-+
-+private:
-+    KDBusService mService;
-+};
-+
-+KUniqueService::KUniqueService() : d_ptr(new KUniqueServicePrivate(this)) {}
-+
-+void KUniqueService::setExitValue(int code)
-+{
-+    Q_D(KUniqueService);
-+    d->setExitValue(code);
-+}
-+
-+#include "moc_kuniqueservice.cpp"
-diff --git a/src/utils/kuniqueservice_win.cpp b/src/utils/kuniqueservice_win.cpp
-new file mode 100644
-index 0000000..2ea830e
---- /dev/null
-+++ b/src/utils/kuniqueservice_win.cpp
-@@ -0,0 +1,219 @@
-+/*
-+    kuniqueservice_win.cpp
-+
-+    This file is part of Kleopatra, the KDE keymanager
-+    Copyright (c) 2016 Intevation GmbH
-+
-+    Kleopatra is free software; you can redistribute it and/or modify
-+    it under the terms of the GNU General Public License as published by
-+    the Free Software Foundation; either version 2 of the License, or
-+    (at your option) any later version.
-+
-+    Kleopatra 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
-+
-+    In addition, as a special exception, the copyright holders give
-+    permission to link the code of this program with any edition of
-+    the Qt library by Trolltech AS, Norway (or with modified versions
-+    of Qt that use the same license as Qt), and distribute linked
-+    combinations including the two.  You must obey the GNU General
-+    Public License in all respects for all of the code used other than
-+    Qt.  If you modify this file, you may extend this exception to
-+    your version of the file, but you are not obligated to do so.  If
-+    you do not wish to do so, delete this exception statement from
-+    your version.
-+*/
-+
-+#include "kuniqueservice.h"
-+
-+#include <QCoreApplication>
-+#include <QDataStream>
-+#include <QDir>
-+
-+#include "kleopatra_debug.h"
-+#include <windows.h>
-+
-+#define MY_DATA_TYPE 12
-+
-+class KUniqueService::KUniqueServicePrivate
-+{
-+    Q_DECLARE_PUBLIC(KUniqueService)
-+    Q_DISABLE_COPY(KUniqueServicePrivate)
-+
-+private:
-+    KUniqueService *q_ptr;
-+    HWND mResponder;
-+    HANDLE mCurrentProcess;
-+
-+    const QString getWindowName() const
-+    {
-+        return QCoreApplication::applicationName() + QStringLiteral("Responder");
-+    }
-+
-+    HWND getForeignResponder() const
-+    {
-+        const QString qWndName = getWindowName();
-+        wchar_t *wndName = (wchar_t *)qWndName.utf16();
-+        HWND ret = FindWindow(wndName, wndName);
-+        qCDebug(KLEOPATRA_LOG) << "Responder handle:" << ret;
-+        return ret;
-+    }
-+
-+    void createResponder()
-+    {
-+        WNDCLASS windowClass;
-+        const QString qWndName = getWindowName();
-+        wchar_t *wndName = (wchar_t*)qWndName.utf16();
-+        windowClass.style = CS_GLOBALCLASS | CS_DBLCLKS;
-+        windowClass.lpfnWndProc = windowProc;
-+        windowClass.hInstance   = (HINSTANCE) GetModuleHandle(NULL);
-+        windowClass.lpszClassName = wndName;
-+        windowClass.hIcon = Q_NULLPTR;
-+        windowClass.hCursor = Q_NULLPTR;
-+        windowClass.hbrBackground = Q_NULLPTR;
-+        windowClass.lpszMenuName = Q_NULLPTR;
-+        windowClass.cbClsExtra = 0;
-+        windowClass.cbWndExtra = 0;
-+        RegisterClass(&windowClass);
-+        mResponder = CreateWindow(wndName, wndName,
-+                                  0, 0, 0, 10, 10, Q_NULLPTR, Q_NULLPTR,
-+                                  (HINSTANCE)GetModuleHandle(NULL), Q_NULLPTR);
-+        qCDebug(KLEOPATRA_LOG) << "Created responder: " << qWndName
-+                               << " with handle: " << mResponder;
-+    }
-+
-+    void handleRequest(const COPYDATASTRUCT *cds)
-+    {
-+        Q_Q(KUniqueService);
-+        if (cds->dwData != MY_DATA_TYPE) {
-+            qCDebug(KLEOPATRA_LOG) << "Responder called with invalid data type:"
-+                                   << cds->dwData;
-+            return;
-+        }
-+        if (mCurrentProcess) {
-+            qCDebug(KLEOPATRA_LOG) << "Already serving. Terminating process: "
-+                                   << mCurrentProcess;
-+            setExitValue(42);
-+        }
-+        const QByteArray serialized(static_cast<const char*>(cds->lpData),
-+                                    cds->cbData);
-+        QDataStream ds(serialized);
-+        quint32 curProc;
-+        ds >> curProc;
-+        mCurrentProcess = (HANDLE) curProc;
-+        QString workDir;
-+        ds >> workDir;
-+        QStringList args;
-+        ds >> args;
-+        qCDebug(KLEOPATRA_LOG) << "Proccess handle: " << mCurrentProcess
-+                               << " requests activate with args "
-+                               << args;
-+        q->emitActivateRequested(args, workDir);
-+        return;
-+    }
-+
-+    KUniqueServicePrivate(KUniqueService *q) : q_ptr(q), mResponder(Q_NULLPTR),
-+                                               mCurrentProcess(Q_NULLPTR)
-+    {
-+        HWND responder = getForeignResponder();
-+        if (!responder) {
-+            // We are the responder
-+            createResponder();
-+            return;
-+        }
-+        // We are the client
-+
-+        QByteArray serialized;
-+        QDataStream ds(&serialized, QIODevice::WriteOnly);
-+        DWORD targetId = 0;
-+        GetWindowThreadProcessId(responder, &targetId);
-+        if (!targetId) {
-+            qCDebug(KLEOPATRA_LOG) << "No process id of responder window";
-+            return;
-+        }
-+        HANDLE targetHandle = OpenProcess(PROCESS_DUP_HANDLE, FALSE, targetId);
-+        if (!targetHandle) {
-+            qCDebug(KLEOPATRA_LOG) << "No target handle. Err: " << GetLastError();
-+        }
-+
-+        // To allow the other process to terminate the process
-+        // needs a handle to us with the required access.
-+        if (!DuplicateHandle(GetCurrentProcess(),
-+                             GetCurrentProcess(),
-+                             targetHandle,
-+                             &mCurrentProcess,
-+                             0,
-+                             FALSE,
-+                             DUPLICATE_SAME_ACCESS)) {
-+            qCDebug(KLEOPATRA_LOG) << "Failed to duplicate handle";
-+        }
-+        CloseHandle(targetHandle);
-+
-+        ds << (qint32) mCurrentProcess
-+           << QDir::currentPath()
-+           << QCoreApplication::arguments();
-+        COPYDATASTRUCT cds;
-+        cds.dwData = MY_DATA_TYPE;
-+        cds.cbData = serialized.size();
-+        cds.lpData = serialized.data();
-+
-+        qCDebug(KLEOPATRA_LOG) << "Sending message to existing Window.";
-+        SendMessage(responder, WM_COPYDATA, 0, (LPARAM) &cds);
-+        // Usually we should be terminated while sending the message.
-+        qCDebug(KLEOPATRA_LOG) << "Send message returned.";
-+    }
-+
-+    static KUniqueServicePrivate *instance(KUniqueService *q) {
-+        static KUniqueServicePrivate *self;
-+        if (self) {
-+            return self;
-+        }
-+
-+        self = new KUniqueServicePrivate(q);
-+        return self;
-+    }
-+
-+    static LRESULT CALLBACK windowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
-+    {
-+        if (message == WM_COPYDATA)
-+        {
-+            const COPYDATASTRUCT *cds = (COPYDATASTRUCT*)lParam;
-+            // windowProc must be static so the singleton pattern although
-+            // it doesn't make much sense in here.
-+            instance(Q_NULLPTR)->handleRequest(cds);
-+            return 0;
-+        }
-+        return DefWindowProc(hWnd, message, wParam, lParam);
-+    }
-+
-+    ~KUniqueServicePrivate()
-+    {
-+        if (mResponder) {
-+            DestroyWindow(mResponder);
-+        }
-+    }
-+
-+    void setExitValue(int code)
-+    {
-+        TerminateProcess(mCurrentProcess, (unsigned int) code);
-+        mCurrentProcess = Q_NULLPTR;
-+    }
-+};
-+
-+
-+KUniqueService::KUniqueService() : d_ptr(KUniqueServicePrivate::instance(this))
-+{
-+}
-+
-+void KUniqueService::setExitValue(int code)
-+{
-+    Q_D(KUniqueService);
-+    d->setExitValue(code);
-+}
-+#include "moc_kuniqueservice.cpp"
---
-2.1.4
diff --git a/patches/kleopatra/0002-Add-alternative-configuredialog-wihout-KCMUtils.patch b/patches/kleopatra/0002-Add-alternative-configuredialog-wihout-KCMUtils.patch
deleted file mode 100755
index 806b8b7..0000000
--- a/patches/kleopatra/0002-Add-alternative-configuredialog-wihout-KCMUtils.patch
+++ /dev/null
@@ -1,640 +0,0 @@
-#! /bin/sh
-patch -p1 -l -f $* < $0
-exit $?
-
-From 91fdfe448e3dbe3cae5d2ae8a7b81dabfbc4e3d3 Mon Sep 17 00:00:00 2001
-From: Andre Heinecke <aheinecke at intevation.de>
-Date: Tue, 16 Feb 2016 17:48:44 +0100
-Subject: [PATCH 2/5] Add alternative configuredialog wihout KCMUtils
-
-KCMUtils heavily depends on QDbus and KService for
-a standalone deployment, like on Windows, we don't
-want those dependencies.
----
- CMakeLists.txt                    |  11 +-
- src/conf/CMakeLists.txt           |  12 +-
- src/conf/configuredialog.cpp      |  59 ++++----
- src/conf/configuredialog.h        |  23 ++-
- src/conf/dirservconfigpage.h      |   2 +-
- src/conf/kleopageconfigdialog.cpp | 304 ++++++++++++++++++++++++++++++++++++++
- src/conf/kleopageconfigdialog.h   |  73 +++++++++
- 7 files changed, 437 insertions(+), 47 deletions(-)
- create mode 100644 src/conf/kleopageconfigdialog.cpp
- create mode 100644 src/conf/kleopageconfigdialog.h
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 7970ffe..951fd53 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -2,6 +2,8 @@ project(kleopatra)
-
- cmake_minimum_required(VERSION 2.8.12)
-
-+option(FORCE_DISABLE_KCMUTILS "Force building Kleopatra without KCMUtils. Doing this will disable configuration KCM Plugins. [default=OFF]" OFF)
-+
- # Standalone build. Find / include everything neccessary.
- set(KF5_VERSION "5.17.0")
- set(GPGMEPP_VERSION "5.1.41")
-@@ -31,8 +33,13 @@ include(ECMAddAppIcon)
- include(ECMQtDeclareLoggingCategory)
-
- # Find KF5 packages
-+if (NOT FORCE_DISABLE_KCMUTILS)
-+  find_package(KF5KCMUtils ${KF5_VERSION} CONFIG REQUIRED)
-+endif()
-+find_package(KF5WidgetsAddons ${KF5_VERSION} CONFIG REQUIRED)
-+find_package(KF5ConfigWidgets ${KF5_VERSION} CONFIG REQUIRED)
-+find_package(KF5CoreAddons ${KF5_VERSION} CONFIG REQUIRED)
- find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
--find_package(KF5KCMUtils ${KF5_VERSION} CONFIG REQUIRED)
- find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
- find_package(KF5I18n ${KF5_VERSION} CONFIG REQUIRED)
- find_package(KF5IconThemes ${KF5_VERSION} CONFIG REQUIRED)
-@@ -65,6 +72,8 @@ find_package(KF5Gpgmepp ${GPGMEPP_VERSION} CONFIG REQUIRED)
- find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test Network)
-
-
-+set(HAVE_KCMUTILS ${KF5KCMUtils_FOUND})
-+
- find_package(Boost 1.34.0 REQUIRED)
-
- find_path(Boost_TOPOLOGICAL_SORT_DIR NAMES boost/graph/topological_sort.hpp PATHS ${Boost_INCLUDE_DIRS})
-diff --git a/src/conf/CMakeLists.txt b/src/conf/CMakeLists.txt
-index 390f112..bd46c88 100644
---- a/src/conf/CMakeLists.txt
-+++ b/src/conf/CMakeLists.txt
-@@ -54,18 +54,18 @@ kconfig_add_kcfg_files(kcm_kleopatra_PART_SRCS
-   ${kleopatra_SOURCE_DIR}/src/kcfg/fileoperationspreferences.kcfgc
- )
-
--if(KLEO_STATIC_KCMODULES)
--  add_library(kcm_kleopatra MODULE STATIC ${kcm_kleopatra_PART_SRCS})
--else()
--  add_library(kcm_kleopatra MODULE ${kcm_kleopatra_PART_SRCS})
-+add_library(kcm_kleopatra MODULE ${kcm_kleopatra_PART_SRCS})
-+
-+if(HAVE_KCMUTILS)
-+  set (_kcm_kleopatra_extra_libs KF5::KCMUtils)
- endif()
-
- target_link_libraries(kcm_kleopatra
-   KF5::Libkleo
--  KF5::KCMUtils
-   KF5::IconThemes
-   KF5::I18n
--  Qt5::DBus
-+  KF5::WidgetsAddons
-+  KF5::ConfigWidgets
-   ${_kcm_kleopatra_extra_libs}
-   ${_kcm_kleopatra_libkleopatraclient_extra_LIBS}
- )
-diff --git a/src/conf/configuredialog.cpp b/src/conf/configuredialog.cpp
-index 3cb3104..b9ef7e4 100644
---- a/src/conf/configuredialog.cpp
-+++ b/src/conf/configuredialog.cpp
-@@ -31,53 +31,43 @@
-     your version.
- */
-
--#include <config-kleopatra.h>
-+#include "config-kleopatra.h"
-
- #include "configuredialog.h"
--#include <kwindowsystem.h>
--#include <kconfig.h>
--#include <kiconloader.h>
--#include <kcmultidialog.h>
-+
-+#include <KWindowSystem>
-+#include <KConfig>
-+#include <KIconLoader>
- #include <KLocalizedString>
--#include <kconfiggroup.h>
--#include <QApplication>
-+#include <KConfigGroup>
- #include <KSharedConfig>
--#include <QIcon>
-
--#ifdef KLEO_STATIC_KCMODULES
--# include <KDesktopFile>
--# define KCM_IMPORT_PLUGIN( x ) extern "C" KCModule * create_##x( QWidget * parent = Q_NULLPTR, const QVariantList & args=QVariantList() );
--# define addMyModule( x ) addModule( KCModuleInfo( KDesktopFile( "services", QLatin1String(#x) + QLatin1String(".desktop") ) ), create_##x() )
--#else // KLEO_STATIC_KCMODULES
--# define KCM_IMPORT_PLUGIN( x )
--# define addMyModule( x ) addModule( QLatin1String(#x) )
--#endif // KLEO_STATIC_KCMODULES
-+#include <QApplication>
-+#include <QIcon>
-
--KCM_IMPORT_PLUGIN(kleopatra_config_dirserv)
--KCM_IMPORT_PLUGIN(kleopatra_config_appear)
--#ifdef HAVE_KLEOPATRACLIENT_LIBRARY
--KCM_IMPORT_PLUGIN(kleopatra_config_cryptooperations)
--KCM_IMPORT_PLUGIN(kleopatra_config_smimevalidation)
-+#if HAVE_KCMUTILS
-+# include "kcmconfiguredialog.h"
-+#else
-+# include "kleopageconfigdialog.h"
- #endif
--KCM_IMPORT_PLUGIN(kleopatra_config_gnupgsystem)
-
- ConfigureDialog::ConfigureDialog(QWidget *parent)
-+#if HAVE_KCMUTILS
-     : KCMultiDialog(parent)
-+#else
-+    : KleoPageConfigDialog(parent)
-+#endif
- {
-     setFaceType(KPageDialog::List);
-     setWindowTitle(i18n("Configure"));
-     KWindowSystem::setIcons(winId(), qApp->windowIcon().pixmap(IconSize(KIconLoader::Desktop), IconSize(KIconLoader::Desktop)),
-                             qApp->windowIcon().pixmap(IconSize(KIconLoader::Small), IconSize(KIconLoader::Small)));
--    //QT5 showButton( User1, true );
--
--    addMyModule(kleopatra_config_dirserv);
--    addMyModule(kleopatra_config_appear);
--#ifdef HAVE_KLEOPATRACLIENT_LIBRARY
--    addMyModule(kleopatra_config_cryptooperations);
--    addMyModule(kleopatra_config_smimevalidation);
--#endif
--    addMyModule(kleopatra_config_gnupgsystem);
-
-+    addModule(QStringLiteral("kleopatra_config_dirserv"));
-+    addModule(QStringLiteral("kleopatra_config_appear"));
-+    addModule(QStringLiteral("kleopatra_config_cryptooperations"));
-+    addModule(QStringLiteral("kleopatra_config_smimevalidation"));
-+    addModule(QStringLiteral("kleopatra_config_gnupgsystem"));
-     // We store the minimum size of the dialog on hide, because otherwise
-     // the KCMultiDialog starts with the size of the first kcm, not
-     // the largest one. This way at least after the first showing of
-@@ -96,13 +86,14 @@ void ConfigureDialog::hideEvent(QHideEvent *e)
-     KConfigGroup geometry(KSharedConfig::openConfig(), "Geometry");
-     geometry.writeEntry("ConfigureDialogWidth", minSize.width());
-     geometry.writeEntry("ConfigureDialogHeight", minSize.height());
-+#if HAVE_KCMUTILS
-     KCMultiDialog::hideEvent(e);
-+#else
-+    KleoPageConfigDialog::hideEvent(e);
-+#endif
- }
-
- ConfigureDialog::~ConfigureDialog()
- {
- }
-
--#undef addMyModule
--#undef KCM_IMPORT_PLUGIN
--
-diff --git a/src/conf/configuredialog.h b/src/conf/configuredialog.h
-index 8096bbe..16fa2c0 100644
---- a/src/conf/configuredialog.h
-+++ b/src/conf/configuredialog.h
-@@ -1,16 +1,17 @@
- /*
--    configuredialog.cpp
-+    configuredialog.h
-
--    This file is part of kleopatra
-+    This file is part of Kleopatra
-     Copyright (C) 2000 Espen Sand, espen at kde.org
-     Copyright (C) 2001-2002 Marc Mutz <mutz at kde.org>
-     Copyright (c) 2004 Klarälvdalens Datakonsult AB
-+    Copyright (c) 2016 Intevation GmbH
-
--    Libkleopatra is free software; you can redistribute it and/or
-+    Kleopatra 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.
-
--    Libkleopatra is distributed in the hope that it will be useful,
-+    Kleopatra 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.
-@@ -34,9 +35,21 @@
- #ifndef __KLEOPATRA_CONF_CONFIGUREDIALOG_H__
- #define __KLEOPATRA_CONF_CONFIGUREDIALOG_H__
-
--#include <kcmultidialog.h>
-+#include "config-kleopatra.h"
-
-+/**
-+ * This is a small wrapper class that holds common code between
-+ * the KCM Config dialog (which is used when KCMUtils are available)
-+ * and the KleoPageConfigDialog. Which is just a KPageView
-+ * with the neccessary bits of the KCMultiDialog behavior.
-+ */
-+#if HAVE_KCMUTILS
-+# include <KCMultiDialog>
- class ConfigureDialog : public KCMultiDialog
-+#else
-+# include "kleopageconfigdialog.h"
-+class ConfigureDialog : public KleoPageConfigDialog
-+#endif
- {
-     Q_OBJECT
- public:
-diff --git a/src/conf/dirservconfigpage.h b/src/conf/dirservconfigpage.h
-index 28bf6c4..5660208 100644
---- a/src/conf/dirservconfigpage.h
-+++ b/src/conf/dirservconfigpage.h
-@@ -33,7 +33,7 @@
- #ifndef DIRSERVCONFIGPAGE_H
- #define DIRSERVCONFIGPAGE_H
-
--#include <kcmodule.h>
-+#include <KCModule>
-
- #include "Libkleo/CryptoConfig"
-
-diff --git a/src/conf/kleopageconfigdialog.cpp b/src/conf/kleopageconfigdialog.cpp
-new file mode 100644
-index 0000000..ccc70ce
---- /dev/null
-+++ b/src/conf/kleopageconfigdialog.cpp
-@@ -0,0 +1,304 @@
-+/*
-+    kleopageconfigdialog.cpp
-+
-+    This file is part of Kleopatra
-+    Copyright (c) 2016 Intevation GmbH
-+
-+    Kleopatra 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.
-+
-+    Kleopatra 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
-+
-+    In addition, as a special exception, the copyright holders give
-+    permission to link the code of this program with any edition of
-+    the Qt library by Trolltech AS, Norway (or with modified versions
-+    of Qt that use the same license as Qt), and distribute linked
-+    combinations including the two.  You must obey the GNU General
-+    Public License in all respects for all of the code used other than
-+    Qt.  If you modify this file, you may extend this exception to
-+    your version of the file, but you are not obligated to do so.  If
-+    you do not wish to do so, delete this exception statement from
-+    your version.
-+
-+    It is derived from KCMultidialog which is:
-+
-+    Copyright (c) 2000 Matthias Elter <elter at kde.org>
-+    Copyright (c) 2003 Daniel Molkentin <molkentin at kde.org>
-+    Copyright (c) 2003,2006 Matthias Kretz <kretz at kde.org>
-+    Copyright (c) 2004 Frans Englich <frans.englich at telia.com>
-+    Copyright (c) 2006 Tobias Koenig <tokoe at kde.org>
-+
-+    This library is free software; you can redistribute it and/or
-+    modify it under the terms of the GNU Library General Public
-+    License as published by the Free Software Foundation; either
-+    version 2 of the License, or (at your option) any later version.
-+
-+    This library 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
-+    Library General Public License for more details.
-+
-+    You should have received a copy of the GNU Library General Public License
-+    along with this library; see the file COPYING.LIB.  If not, write to
-+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-+    Boston, MA 02110-1301, USA.
-+*/
-+
-+
-+#include "kleopageconfigdialog.h"
-+
-+#include <QDialogButtonBox>
-+#include <QPushButton>
-+#include <QLibrary>
-+#include <QCoreApplication>
-+#include <QUrl>
-+#include <QDesktopServices>
-+#include <QProcess>
-+
-+#include <KCModule>
-+#include <KDesktopFile>
-+#include <KPluginLoader>
-+#include <KStandardGuiItem>
-+#include <KMessageBox>
-+#include <KLocalizedString>
-+
-+#include "kleopatra_debug.h"
-+
-+#define KCM_LIBRARY_NAME "kcm_kleopatra"
-+
-+KleoPageConfigDialog::KleoPageConfigDialog(QWidget *parent)
-+    : KPageDialog(parent)
-+{
-+    setModal(false);
-+
-+    QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
-+    buttonBox->setStandardButtons(QDialogButtonBox::Help
-+                                  | QDialogButtonBox::RestoreDefaults
-+                                  | QDialogButtonBox::Cancel
-+                                  | QDialogButtonBox::Apply
-+                                  | QDialogButtonBox::Ok
-+                                  | QDialogButtonBox::Reset);
-+    KGuiItem::assign(buttonBox->button(QDialogButtonBox::Ok), KStandardGuiItem::ok());
-+    KGuiItem::assign(buttonBox->button(QDialogButtonBox::Cancel), KStandardGuiItem::cancel());
-+    KGuiItem::assign(buttonBox->button(QDialogButtonBox::RestoreDefaults),
-+                                       KStandardGuiItem::defaults());
-+    KGuiItem::assign(buttonBox->button(QDialogButtonBox::Apply), KStandardGuiItem::apply());
-+    KGuiItem::assign(buttonBox->button(QDialogButtonBox::Reset), KStandardGuiItem::reset());
-+    KGuiItem::assign(buttonBox->button(QDialogButtonBox::Help), KStandardGuiItem::help());
-+    buttonBox->button(QDialogButtonBox::Reset)->setEnabled(false);
-+    buttonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
-+
-+    connect(buttonBox->button(QDialogButtonBox::Apply), &QAbstractButton::clicked,
-+            this, &KleoPageConfigDialog::slotApplyClicked);
-+    connect(buttonBox->button(QDialogButtonBox::Ok), &QAbstractButton::clicked,
-+            this, &KleoPageConfigDialog::slotOkClicked);
-+    connect(buttonBox->button(QDialogButtonBox::RestoreDefaults), &QAbstractButton::clicked,
-+            this, &KleoPageConfigDialog::slotDefaultClicked);
-+    connect(buttonBox->button(QDialogButtonBox::Help), &QAbstractButton::clicked,
-+            this, &KleoPageConfigDialog::slotHelpClicked);
-+    connect(buttonBox->button(QDialogButtonBox::Reset), &QAbstractButton::clicked,
-+            this, &KleoPageConfigDialog::slotUser1Clicked);
-+
-+    setButtonBox(buttonBox);
-+
-+    connect(this, &KPageDialog::currentPageChanged,
-+            this, &KleoPageConfigDialog::slotCurrentPageChanged);
-+}
-+
-+void KleoPageConfigDialog::slotCurrentPageChanged(KPageWidgetItem *current, KPageWidgetItem *previous)
-+{
-+    if (!previous) {
-+        return;
-+    }
-+    blockSignals(true);
-+    setCurrentPage(previous);
-+
-+    KCModule *previousModule = qobject_cast<KCModule*>(previous->widget());
-+    bool canceled = false;
-+    if (previousModule && mChangedModules.contains(previousModule)) {
-+        const int queryUser = KMessageBox::warningYesNoCancel(
-+                          this,
-+                          i18n("The settings of the current module have changed.\n"
-+                               "Do you want to apply the changes or discard them?"),
-+                          i18n("Apply Settings"),
-+                          KStandardGuiItem::apply(),
-+                          KStandardGuiItem::discard(),
-+                          KStandardGuiItem::cancel());
-+        if (queryUser == KMessageBox::Yes) {
-+            previousModule->save();
-+        } else if (queryUser == KMessageBox::No) {
-+            previousModule->load();
-+        }
-+        canceled = queryUser == KMessageBox::Cancel;
-+    }
-+    if (!canceled) {
-+        mChangedModules.removeAll(previousModule);
-+        setCurrentPage(current);
-+    }
-+    blockSignals(false);
-+
-+    clientChanged();
-+}
-+
-+void KleoPageConfigDialog::apply()
-+{
-+    QPushButton *applyButton = buttonBox()->button(QDialogButtonBox::Apply);
-+    applyButton->setFocus();
-+    foreach (KCModule *module, mChangedModules) {
-+        module->save();
-+    }
-+    mChangedModules.clear();
-+    Q_EMIT configCommitted();
-+    clientChanged();
-+}
-+
-+void KleoPageConfigDialog::slotDefaultClicked()
-+{
-+    const KPageWidgetItem *item = currentPage();
-+    if (!item) {
-+        return;
-+    }
-+
-+    KCModule *module = qobject_cast<KCModule*>(item->widget());
-+    if (!module) {
-+        return;
-+    }
-+    module->defaults();
-+    clientChanged();
-+}
-+
-+void KleoPageConfigDialog::slotUser1Clicked()
-+{
-+    const KPageWidgetItem *item = currentPage();
-+    if (!item) {
-+        return;
-+    }
-+
-+    KCModule *module = qobject_cast<KCModule*>(item->widget());
-+    if (!module) {
-+        return;
-+    }
-+    module->load();
-+    mChangedModules.removeAll(module);
-+    clientChanged();
-+}
-+
-+void KleoPageConfigDialog::slotApplyClicked()
-+{
-+    apply();
-+}
-+
-+void KleoPageConfigDialog::slotOkClicked()
-+{
-+    apply();
-+    accept();
-+}
-+
-+void KleoPageConfigDialog::slotHelpClicked()
-+{
-+    const KPageWidgetItem *item = currentPage();
-+    if (!item) {
-+        return;
-+    }
-+
-+    const QString docPath = mHelpUrls.value(item->name());
-+
-+    QUrl docUrl = QUrl(QStringLiteral("help:/")).resolved(QUrl(docPath)); // same code as in KHelpClient::invokeHelp
-+    if (docUrl.scheme() == QLatin1String("help") || docUrl.scheme() == QLatin1String("man") || docUrl.scheme() == QLatin1String("info")) {
-+        QProcess::startDetached(QStringLiteral("khelpcenter"), QStringList() << docUrl.toString());
-+    } else {
-+        QDesktopServices::openUrl(docUrl);
-+    }
-+}
-+
-+static KCModule *loadModule(const QString &name)
-+{
-+    QLibrary lib(KPluginLoader::findPlugin(KCM_LIBRARY_NAME));
-+    if (lib.load()) {
-+        KCModule *(*create)(QWidget *, const char *);
-+        QByteArray factorymethod("create_");
-+        factorymethod += name.toLatin1();
-+        create = reinterpret_cast<KCModule *(*)(QWidget *, const char *)>(lib.resolve(factorymethod.constData()));
-+        if (create) {
-+            return create(Q_NULLPTR, name.toLatin1().constData());
-+        } else {
-+            qCWarning(KLEOPATRA_LOG) << "Failed to load config module: " << name;
-+            return Q_NULLPTR;
-+        }
-+    }
-+    qCWarning(KLEOPATRA_LOG) << "Failed to load library: " << KCM_LIBRARY_NAME;
-+    return Q_NULLPTR;
-+}
-+
-+void KleoPageConfigDialog::addModule(const QString &name)
-+{
-+    // We use a path relative to our installation location
-+    const QString path = qApp->applicationDirPath() +
-+                         QLatin1String("/../share/kservices5/") +
-+                         name + QLatin1String(".desktop");
-+    KDesktopFile desktopModule(path);
-+
-+    KCModule *mod = loadModule(name);
-+    mModules << mod;
-+
-+    const QString dName = desktopModule.readName();
-+
-+    KPageWidgetItem *item = addPage(mod, dName);
-+    item->setIcon(QIcon::fromTheme(desktopModule.readIcon()));
-+    item->setHeader(desktopModule.readComment());
-+
-+    connect(mod, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool)));
-+
-+    mHelpUrls.insert(dName, desktopModule.readDocPath());
-+}
-+
-+void KleoPageConfigDialog::moduleChanged(bool state)
-+{
-+    KCModule *module = qobject_cast<KCModule*>(sender());
-+    qCDebug(KLEOPATRA_LOG) << "Module changed: " << state << " mod " << module;
-+    if (mChangedModules.contains(module)) {
-+        if (!state) {
-+            mChangedModules.removeAll(module);
-+        }
-+        return;
-+    }
-+    if (state) {
-+        mChangedModules << module;
-+    }
-+    clientChanged();
-+}
-+
-+void KleoPageConfigDialog::clientChanged()
-+{
-+    const KPageWidgetItem *item = currentPage();
-+    if (!item) {
-+        return;
-+    }
-+    KCModule *module = qobject_cast<KCModule*>(item->widget());
-+
-+    if (!module) {
-+        return;
-+    }
-+    qCDebug(KLEOPATRA_LOG) << "Client changed: " << " mod " << module;
-+
-+    bool change = false;
-+    change = mChangedModules.contains(module);
-+
-+    QPushButton *resetButton = buttonBox()->button(QDialogButtonBox::Reset);
-+    if (resetButton) {
-+        resetButton->setEnabled(change);
-+    }
-+
-+    QPushButton *applyButton = buttonBox()->button(QDialogButtonBox::Apply);
-+    if (applyButton) {
-+        applyButton->setEnabled(change);
-+    }
-+}
-diff --git a/src/conf/kleopageconfigdialog.h b/src/conf/kleopageconfigdialog.h
-new file mode 100644
-index 0000000..809c930
---- /dev/null
-+++ b/src/conf/kleopageconfigdialog.h
-@@ -0,0 +1,73 @@
-+/*
-+    kleopageconfigdialog.h.h
-+
-+    This file is part of Kleopatra
-+    Copyright (c) 2016 Intevation GmbH
-+
-+    Kleopatra 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.
-+
-+    Kleopatra 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
-+
-+    In addition, as a special exception, the copyright holders give
-+    permission to link the code of this program with any edition of
-+    the Qt library by Trolltech AS, Norway (or with modified versions
-+    of Qt that use the same license as Qt), and distribute linked
-+    combinations including the two.  You must obey the GNU General
-+    Public License in all respects for all of the code used other than
-+    Qt.  If you modify this file, you may extend this exception to
-+    your version of the file, but you are not obligated to do so.  If
-+    you do not wish to do so, delete this exception statement from
-+    your version.
-+*/
-+
-+#ifndef __KLEOPATRA_CONF_KLEOPAGECONFIGDIALOG_H__
-+#define __KLEOPATRA_CONF_KLEOPAGECONFIGDIALOG_H__
-+
-+#include <KPageDialog>
-+#include <QList>
-+
-+class KCModule;
-+class KPageWidgetItem;
-+
-+/**
-+ * KPageDialog based config dialog to be used when
-+ * KCMUtils are not available. */
-+class KleoPageConfigDialog : public KPageDialog
-+{
-+    Q_OBJECT
-+public:
-+    explicit KleoPageConfigDialog(QWidget *parent = Q_NULLPTR);
-+
-+    void addModule(const QString &module);
-+
-+Q_SIGNALS:
-+    void configCommitted();
-+
-+protected Q_SLOTS:
-+    void slotDefaultClicked();
-+    void slotUser1Clicked();
-+    void slotApplyClicked();
-+    void slotOkClicked();
-+    void slotHelpClicked();
-+    void slotCurrentPageChanged(KPageWidgetItem *current, KPageWidgetItem *previous);
-+    void moduleChanged(bool value);
-+
-+private:
-+    void clientChanged();
-+    void apply();
-+
-+    QList<KCModule *> mModules;
-+    QList<KCModule *> mChangedModules;
-+    QMap<QString, QString> mHelpUrls;
-+};
-+
-+#endif /* __KLEOPATRA_CONF_KLEOPAGECONFIGDIALOG_H__ */
---
-2.1.4
diff --git a/patches/kleopatra/0003-Add-option-to-disable-KWatchGnuPG.patch b/patches/kleopatra/0003-Add-option-to-disable-KWatchGnuPG.patch
deleted file mode 100755
index 34e1944..0000000
--- a/patches/kleopatra/0003-Add-option-to-disable-KWatchGnuPG.patch
+++ /dev/null
@@ -1,109 +0,0 @@
-#! /bin/sh
-patch -p1 -l -f $* < $0
-exit $?
-
-From b2d4cf198d9b703f6769ccd42e044b2a552ead98 Mon Sep 17 00:00:00 2001
-From: Andre Heinecke <aheinecke at intevation.de>
-Date: Tue, 16 Feb 2016 18:15:47 +0100
-Subject: [PATCH 3/5] Add option to disable KWatchGnuPG
-
-KWatchGnuPG currently pulls in KTextWidgets and KNotifications
-which are heavy dependencies for Kleopatra. So this can be disabled.
-A better solution would probably be to make the features optional.
----
- CMakeLists.txt                 |  6 ++++++
- src/CMakeLists.txt             | 23 ++++++++++++++++++++---
- src/kwatchgnupg/CMakeLists.txt |  4 ++++
- 3 files changed, 30 insertions(+), 3 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 951fd53..441e2fe 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -3,6 +3,7 @@ project(kleopatra)
- cmake_minimum_required(VERSION 2.8.12)
-
- option(FORCE_DISABLE_KCMUTILS "Force building Kleopatra without KCMUtils. Doing this will disable configuration KCM Plugins. [default=OFF]" OFF)
-+option(DISABLE_KWATCHGNUPG "Don't build the kwatchgnupg tool [default=OFF]" OFF)
-
- # Standalone build. Find / include everything neccessary.
- set(KF5_VERSION "5.17.0")
-@@ -43,10 +44,8 @@ find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
- find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
- find_package(KF5I18n ${KF5_VERSION} CONFIG REQUIRED)
- find_package(KF5IconThemes ${KF5_VERSION} CONFIG REQUIRED)
--find_package(KF5Notifications ${KF5_VERSION} CONFIG REQUIRED)
- find_package(KF5XmlGui ${KF5_VERSION} CONFIG REQUIRED)
- find_package(KF5WindowSystem ${KF5_VERSION} CONFIG REQUIRED)
--find_package(KF5TextWidgets ${KF5_VERSION} CONFIG REQUIRED)
- find_package(KF5DocTools ${KF5_VERSION} CONFIG)
-
- set_package_properties(KF5DocTools PROPERTIES DESCRIPTION "Documentation tools" TYPE OPTIONAL PURPOSE "Required to generate Kleopatra documentation.")
-diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
-index 1abaa6b..6799187 100644
---- a/src/CMakeLists.txt
-+++ b/src/CMakeLists.txt
-@@ -3,7 +3,9 @@ add_subdirectory(icons)
- include_directories(${CMAKE_CURRENT_BINARY_DIR})
- include_directories(${CMAKE_CURRENT_SOURCE_DIR})
-
--add_subdirectory(kwatchgnupg)
-+if (NOT DISABLE_KWATCHGNUPG)
-+    add_subdirectory(kwatchgnupg)
-+endif()
- add_subdirectory(libkleopatraclient)
- add_subdirectory(conf)
- add_subdirectory(kconf_update)
-@@ -215,6 +217,21 @@ set(_kleopatra_SRCS
-   main.cpp
- )
-
-+if (KF5DBusAddons_FOUND)
-+  set(_kleopatra_SRCS ${_kleopatra_SRCS} utils/kuniqueservice_dbus.cpp)
-+  set(_kleopatra_dbusaddons_libs KF5::DBusAddons)
-+else()
-+  # Alternative currently only implemented for windows
-+  set(_kleopatra_SRCS ${_kleopatra_SRCS} utils/kuniqueservice_win.cpp)
-+endif()
-+
-+if (KF5KCMUtils_FOUND)
-+  set(_kleopatra_SRCS ${_kleopatra_SRCS} conf/kcmconfiguredialog.cpp)
-+  set(_kleopatra_extra_libs ${_kleopatra_extra_libs} KF5::KCMUtils)
-+else()
-+  set(_kleopatra_SRCS ${_kleopatra_SRCS} conf/kleopageconfigdialog.cpp)
-+endif()
-+
- ecm_qt_declare_logging_category(_kleopatra_SRCS HEADER kleopatra_debug.h IDENTIFIER KLEOPATRA_LOG CATEGORY_NAME log_kleopatra)
-
- if(KLEO_MODEL_TEST)
-@@ -261,14 +278,14 @@ target_link_libraries(kleopatra_bin
-   ${_kleopatra_extra_libs}
-   KF5::Libkleo
-   KF5::Mime
--  KF5::KCMUtils
-   KF5::I18n
-   KF5::XmlGui
-   KF5::IconThemes
-   KF5::WindowSystem
--  KF5::DBusAddons
-+  ${_kleopatra_dbusaddons_libs}
-   Qt5::Network
-   Qt5::PrintSupport # Printing secret keys
-+  KF5::CoreAddons
-   ${_kleopatra_uiserver_extra_libs}
-   kleopatraclientcore
- )
-diff --git a/src/kwatchgnupg/CMakeLists.txt b/src/kwatchgnupg/CMakeLists.txt
-index 338cad5..5f9e370 100644
---- a/src/kwatchgnupg/CMakeLists.txt
-+++ b/src/kwatchgnupg/CMakeLists.txt
-@@ -1,3 +1,7 @@
-+
-+find_package(KF5Notifications ${KF5_VERSION} CONFIG REQUIRED)
-+find_package(KF5TextWidgets ${KF5_VERSION} CONFIG REQUIRED)
-+
- set(kwatchgnupg_SRCS
-   ../utils/kdlogtextwidget.cpp
-   ../utils/gnupg-helper.cpp
---
-2.1.4
diff --git a/patches/kleopatra/0004-Make-DBus-integration-of-the-smime-conf-optional.patch b/patches/kleopatra/0004-Make-DBus-integration-of-the-smime-conf-optional.patch
deleted file mode 100755
index 573bb5e..0000000
--- a/patches/kleopatra/0004-Make-DBus-integration-of-the-smime-conf-optional.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-#! /bin/sh
-patch -p1 -l -f $* < $0
-exit $?
-
-From a88a947afb03cf1d12d9758fd8009ef3d4008c3b Mon Sep 17 00:00:00 2001
-From: Andre Heinecke <aheinecke at intevation.de>
-Date: Tue, 16 Feb 2016 18:17:17 +0100
-Subject: [PATCH 4/5] Make DBus integration of the smime conf optional
-
-This is indirect because if you have KCMUtils you already
-have DBus and so you want to integrate with DBus in the
-S/MIME Config widget.
----
- config-kleopatra.h.cmake                        | 7 +++++--
- src/conf/smimevalidationconfigurationwidget.cpp | 6 +++++-
- 2 files changed, 10 insertions(+), 3 deletions(-)
-
-diff --git a/config-kleopatra.h.cmake b/config-kleopatra.h.cmake
-index 4fb4a8f..4842cca 100644
---- a/config-kleopatra.h.cmake
-+++ b/config-kleopatra.h.cmake
-@@ -21,5 +21,8 @@
- /* Define to 1 if you build libkleopatraclient */
- #cmakedefine HAVE_KLEOPATRACLIENT_LIBRARY 1
-
--/* Mirrored from cmake option */
--#cmakedefine KLEO_STATIC_KCMODULES 1
-+/* KF5KCMUtils available */
-+#cmakedefine01 HAVE_KCMUTILS
-+
-+/* DBus available */
-+#cmakedefine01 HAVE_QDBUS
-diff --git a/src/conf/smimevalidationconfigurationwidget.cpp b/src/conf/smimevalidationconfigurationwidget.cpp
-index aab1e98..e3ba39f 100644
---- a/src/conf/smimevalidationconfigurationwidget.cpp
-+++ b/src/conf/smimevalidationconfigurationwidget.cpp
-@@ -44,7 +44,9 @@
- #include <KLocalizedString>
- #include "kleopatra_debug.h"
-
--#include <QDBusConnection>
-+#if HAVE_QDBUS
-+# include <QDBusConnection>
-+#endif
-
- using namespace Kleo;
- using namespace Kleo::Config;
-@@ -59,7 +61,9 @@ public:
-           customHTTPProxyWritable(false),
-           ui(q)
-     {
-+#if HAVE_QDBUS
-         QDBusConnection::sessionBus().connect(QString(), QString(), QStringLiteral("org.kde.kleo.CryptoConfig"), QStringLiteral("changed"), q, SLOT(load()));
-+#endif
-     }
-
-     bool customHTTPProxyWritable;
---
-2.1.4

-----------------------------------------------------------------------

Summary of changes:
 Makefile.am                                        |   4 -
 packages/packages.current                          |   4 +-
 ...ment-KDBusService-alternative-for-Windows.patch | 750 ---------------------
 ...ternative-configuredialog-wihout-KCMUtils.patch | 640 ------------------
 .../0003-Add-option-to-disable-KWatchGnuPG.patch   | 109 ---
 ...us-integration-of-the-smime-conf-optional.patch |  59 --
 6 files changed, 2 insertions(+), 1564 deletions(-)
 delete mode 100755 patches/kleopatra/0001-Implement-KDBusService-alternative-for-Windows.patch
 delete mode 100755 patches/kleopatra/0002-Add-alternative-configuredialog-wihout-KCMUtils.patch
 delete mode 100755 patches/kleopatra/0003-Add-option-to-disable-KWatchGnuPG.patch
 delete mode 100755 patches/kleopatra/0004-Make-DBus-integration-of-the-smime-conf-optional.patch


hooks/post-receive
-- 
GnuPG for Windows
http://git.gnupg.org



More information about the Gpg4win-commits mailing list