[SCM] kdeconnect packaging branch, master, updated. debian/0.9g-1-1183-g9d69498

Maximiliano Curia maxy at moszumanska.debian.org
Fri Oct 14 14:28:21 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/kdeconnect.git;a=commitdiff;h=549f4c0

The following commit has been merged in the master branch:
commit 549f4c0815061c9b2a14d8ab62b126d8678e2995
Author: Albert Vaca <albertvaka at gmail.com>
Date:   Sun Mar 8 22:17:54 2015 -0700

    KdeConnectConfig now displays initialization errors as notification
    
    NOTE: This patch requires KNotifications 5.9
---
 core/kdeconnectconfig.cpp | 39 +++++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 18 deletions(-)

diff --git a/core/kdeconnectconfig.cpp b/core/kdeconnectconfig.cpp
index b165f4d..403571e 100644
--- a/core/kdeconnectconfig.cpp
+++ b/core/kdeconnectconfig.cpp
@@ -23,6 +23,8 @@
 #include <KConfig>
 #include <KConfigGroup>
 #include <KSharedConfig>
+#include <KNotification>
+#include <KLocalizedString>
 
 #include <QtCrypto>
 #include <QFile>
@@ -57,13 +59,15 @@ KdeConnectConfig* KdeConnectConfig::instance()
 }
 
 KdeConnectConfig::KdeConnectConfig()
-    : d(new KdeConnectConfigPrivate) {
-
+    : d(new KdeConnectConfigPrivate)
+{
     //qCDebug(KDECONNECT_CORE) << "QCA supported capabilities:" << QCA::supportedFeatures().join(",");
     if(!QCA::isSupported("rsa")) {
-        //TODO: Display this in a more visible way (notification?)
-        qCCritical(KDECONNECT_CORE) << "Error: KDE Connect could not find support for RSA in your QCA installation, if your distribution provides"
-        << "separate packages for QCA-ossl and QCA-gnupg plugins, make sure you have them installed and try again";
+        KNotification::event(KNotification::Error,
+                             QLatin1String("KDE Connect failed to start"), //Should not happen, not worth i18n
+                             QLatin1String("Could not find support for RSA in your QCA installation. If your"
+                                  "distribution provides separate packages for QCA-ossl and QCA-gnupg,"
+                                  "make sure you have them installed and try again."));
         return;
     }
 
@@ -85,27 +89,26 @@ KdeConnectConfig::KdeConnectConfig()
 
     QString keyPath = privateKeyPath();
     QFile privKey(keyPath);
-    if (privKey.exists() && privKey.open(QIODevice::ReadOnly))
-    {
+    if (privKey.exists() && privKey.open(QIODevice::ReadOnly)) {
+
         d->privateKey = QCA::PrivateKey::fromPEM(privKey.readAll());
-    }
-    else
-    {
-        if (!privKey.open(QIODevice::ReadWrite | QIODevice::Truncate))  {
-            //TODO: Display this in a more visible way (notification?)
-            qCCritical(KDECONNECT_CORE) << "Error: KDE Connect could not create private key file: " << keyPath;
-            QCoreApplication::exit(-1);
-        }
-        privKey.setPermissions(strict);
+
+    } else {
 
         d->privateKey = QCA::KeyGenerator().createRSA(2048);
 
-        privKey.write(d->privateKey.toPEM().toLatin1());
+        if (!privKey.open(QIODevice::ReadWrite | QIODevice::Truncate))  {
+            KNotification::event(KNotification::StandardEvent::Error, QLatin1String("KDE Connect"),
+                                 i18n("Could not store private key file: %1", keyPath));
+        } else {
+            privKey.setPermissions(strict);
+            privKey.write(d->privateKey.toPEM().toLatin1());
+        }
     }
 
     //Extra security check
     if (QFile::permissions(keyPath) != strict) {
-        qCDebug(KDECONNECT_CORE) << "Error: KDE Connect detects wrong permissions for private key file " << keyPath;
+        qCDebug(KDECONNECT_CORE) << "Warning: KDE Connect private key file has too open permissions " << keyPath;
     }
 }
 

-- 
kdeconnect packaging



More information about the pkg-kde-commits mailing list