[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:24:17 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=c45dbad

The following commit has been merged in the master branch:
commit c45dbad469d4686819391c5f910617baa40fd41a
Author: Leon Handreke <leonh at ndreke.de>
Date:   Sat Oct 12 11:53:36 2013 +0100

    Fix adiumxtra-protocol-handler to show UI to confirm installation again
    
    Don't install the Adium extra automatically but show a notification to
    confirm the installation (as was probably originally intended by the
    authors of the code).
    
    Disable the KIO progress notification that results in a non-informative
    "Copying [Finished]" notification for the temporary file being created.
    
    REVIEW: 113214
    BUG: 325903
---
 .../adiumxtra-protocol-handler.cpp                 | 73 +++++++++++-----------
 .../chat-style-installer.cpp                       | 22 ++++---
 .../emoticon-set-installer.cpp                     | 19 ++++--
 3 files changed, 65 insertions(+), 49 deletions(-)

diff --git a/adiumxtra-protocol-handler/adiumxtra-protocol-handler.cpp b/adiumxtra-protocol-handler/adiumxtra-protocol-handler.cpp
index b80e99a..02c3289 100644
--- a/adiumxtra-protocol-handler/adiumxtra-protocol-handler.cpp
+++ b/adiumxtra-protocol-handler/adiumxtra-protocol-handler.cpp
@@ -30,6 +30,16 @@
 #include <KNotification>
 #include <KIcon>
 #include <KMimeType>
+#include <KAboutData>
+#include <KComponentData>
+
+// FIXME: Part of a hack to let adiumxtra-protocol-handler use the main ktelepathy.notifyrc because
+// the string freeze does not permit adding a new notifyrc only for adiumxtra-protocol-handler.
+// Remove this after 0.7 is released.
+static KComponentData ktelepathyComponentData() {
+    KAboutData telepathySharedAboutData("ktelepathy",0,KLocalizedString(),0);
+    return KComponentData(telepathySharedAboutData);
+}
 
 AdiumxtraProtocolHandler::AdiumxtraProtocolHandler()
     : QObject()
@@ -58,7 +68,8 @@ void AdiumxtraProtocolHandler::install()
 
     KTemporaryFile *tmpFile = new KTemporaryFile();
     if (tmpFile->open()) {
-        KIO::Job* getJob = KIO::file_copy(url.prettyUrl(), KUrl(tmpFile->fileName()), -1, KIO::Overwrite);
+        KIO::Job* getJob = KIO::file_copy(url.prettyUrl(), KUrl(tmpFile->fileName()), -1,
+                                          KIO::Overwrite | KIO::HideProgressInfo);
         if (!KIO::NetAccess::synchronousRun(getJob, 0)) {
             kDebug() << "Download failed";
             Q_EMIT finished();
@@ -81,11 +92,9 @@ void AdiumxtraProtocolHandler::install()
         KNotification *notification = new KNotification(QLatin1String("packagenotrecognized"), NULL, KNotification::Persistent);
         notification->setText( i18n("Package type not recognized or not supported") );
         notification->setActions( QStringList() << i18n("OK") );
-        QObject::connect(notification, SIGNAL(action1Activated()), this, SLOT(install()));
         QObject::connect(notification, SIGNAL(action1Activated()), notification, SLOT(close()));
-
-        QObject::connect(notification, SIGNAL(ignored()), this, SLOT(ignoreRequest()));
         QObject::connect(notification, SIGNAL(ignored()), notification, SLOT(close()));
+        notification->setComponentData(ktelepathyComponentData());
         notification->sendEvent();
         kDebug() << "Unsupported file type" << currentBundleMimeType;
         kDebug() << tmpFile->fileName();
@@ -100,56 +109,50 @@ void AdiumxtraProtocolHandler::install()
         return;// BundleInstaller::BundleCannotOpen;
     }
 
-    ChatStyleInstaller chatStyleInstaller(archive, tmpFile);
-    if (chatStyleInstaller.validate() == BundleInstaller::BundleValid) {
-        chatStyleInstaller.showRequest();
+    ChatStyleInstaller *chatStyleInstaller = new ChatStyleInstaller(archive, tmpFile);
+    if (chatStyleInstaller->validate() == BundleInstaller::BundleValid) {
+        chatStyleInstaller->showRequest();
         kDebug() << "Sent messagestyle request";
 
-        QObject::connect(&chatStyleInstaller, SIGNAL(finished(BundleInstaller::BundleStatus)),
-                         &chatStyleInstaller, SLOT(showResult()));
-        QObject::connect(&chatStyleInstaller, SIGNAL(showedResult()), this, SIGNAL(finished()));
-        QObject::connect(&chatStyleInstaller, SIGNAL(showedResult()),
-                         &chatStyleInstaller, SLOT(deleteLater()));
-        QObject::connect(&chatStyleInstaller, SIGNAL(ignoredRequest()), this, SIGNAL(finished()));
-        QObject::connect(&chatStyleInstaller, SIGNAL(ignoredRequest()),
-                         &chatStyleInstaller, SLOT(deleteLater()));
-
-        kDebug() << "Starting installation";
-        chatStyleInstaller.install();
+        QObject::connect(chatStyleInstaller, SIGNAL(finished(BundleInstaller::BundleStatus)),
+                         chatStyleInstaller, SLOT(showResult()));
+        QObject::connect(chatStyleInstaller, SIGNAL(showedResult()), this, SIGNAL(finished()));
+        QObject::connect(chatStyleInstaller, SIGNAL(showedResult()),
+                         chatStyleInstaller, SLOT(deleteLater()));
+        QObject::connect(chatStyleInstaller, SIGNAL(ignoredRequest()), this, SIGNAL(finished()));
+        QObject::connect(chatStyleInstaller, SIGNAL(ignoredRequest()),
+                         chatStyleInstaller, SLOT(deleteLater()));
 
         return;// BundleInstaller::BundleValid;
     }
+    delete chatStyleInstaller;
 
-    EmoticonSetInstaller emoticonSetInstaller(archive, tmpFile);
-    if(emoticonSetInstaller.validate() == BundleInstaller::BundleValid) {
-        emoticonSetInstaller.showRequest();
+    EmoticonSetInstaller *emoticonSetInstaller = new EmoticonSetInstaller(archive, tmpFile);
+    if(emoticonSetInstaller->validate() == BundleInstaller::BundleValid) {
+        emoticonSetInstaller->showRequest();
         kDebug() << "Sent emoticonset request";
 
-        QObject::connect(&emoticonSetInstaller, SIGNAL(finished(BundleInstaller::BundleStatus)),
-                         &emoticonSetInstaller, SLOT(showResult()));
-        QObject::connect(&emoticonSetInstaller, SIGNAL(showedResult()), this, SIGNAL(finished()));
-        QObject::connect(&emoticonSetInstaller, SIGNAL(showedResult()),
-                         &emoticonSetInstaller, SLOT(deleteLater()));
-        QObject::connect(&emoticonSetInstaller, SIGNAL(ignoredRequest()), this, SIGNAL(finished()));
-        QObject::connect(&emoticonSetInstaller, SIGNAL(ignoredRequest()),
-                         &emoticonSetInstaller, SLOT(deleteLater()));
-
-        kDebug() << "Starting installation";
-        emoticonSetInstaller.install();
+        QObject::connect(emoticonSetInstaller, SIGNAL(finished(BundleInstaller::BundleStatus)),
+                         emoticonSetInstaller, SLOT(showResult()));
+        QObject::connect(emoticonSetInstaller, SIGNAL(showedResult()), this, SIGNAL(finished()));
+        QObject::connect(emoticonSetInstaller, SIGNAL(showedResult()),
+                         emoticonSetInstaller, SLOT(deleteLater()));
+        QObject::connect(emoticonSetInstaller, SIGNAL(ignoredRequest()), this, SIGNAL(finished()));
+        QObject::connect(emoticonSetInstaller, SIGNAL(ignoredRequest()),
+                         emoticonSetInstaller, SLOT(deleteLater()));
 
         return;// BundleInstaller::BundleValid;
     }
+    delete emoticonSetInstaller;
 
     KNotification *notification = new KNotification(QLatin1String("packagenotrecognized"),
                                                     NULL,
                                                     KNotification::Persistent);
     notification->setText( i18n("Package type not recognized or not supported") );
-    QObject::connect(notification, SIGNAL(action1Activated()), this, SLOT(install()));
     QObject::connect(notification, SIGNAL(action1Activated()), notification, SLOT(close()));
-
-    QObject::connect(notification, SIGNAL(ignored()), this, SLOT(ignoreRequest()));
     QObject::connect(notification, SIGNAL(ignored()), notification, SLOT(close()));
     notification->setActions( QStringList() << i18n("OK") );
+    notification->setComponentData(ktelepathyComponentData());
     notification->sendEvent();
     kDebug() << "Sent error";
 
diff --git a/adiumxtra-protocol-handler/chat-style-installer.cpp b/adiumxtra-protocol-handler/chat-style-installer.cpp
index 9676c96..20d0fed 100644
--- a/adiumxtra-protocol-handler/chat-style-installer.cpp
+++ b/adiumxtra-protocol-handler/chat-style-installer.cpp
@@ -28,7 +28,16 @@
 #include <KNotification>
 #include <KApplication>
 #include <QTimer>
-
+#include <KAboutData>
+#include <KComponentData>
+
+// FIXME: Part of a hack to let adiumxtra-protocol-handler use the main ktelepathy.notifyrc because
+// the string freeze does not permit adding a new notifyrc only for adiumxtra-protocol-handler.
+// Remove this after 0.7 is released.
+static KComponentData ktelepathyComponentData() {
+    KAboutData telepathySharedAboutData("ktelepathy",0,KLocalizedString(),0);
+    return KComponentData(telepathySharedAboutData);
+}
 
 ChatStyleInstaller::ChatStyleInstaller(KArchive *archive, KTemporaryFile *tmpFile)
 {
@@ -132,6 +141,7 @@ void ChatStyleInstaller::showRequest()
     QObject::connect(notification, SIGNAL(action2Activated()), this, SLOT(ignoreRequest()));
     QObject::connect(notification, SIGNAL(action2Activated()), notification, SLOT(close()));
 
+    notification->setComponentData(ktelepathyComponentData());
     notification->sendEvent();
 }
 
@@ -142,18 +152,14 @@ void ChatStyleInstaller::showResult()
     KNotification *notification;
     if(m_status == BundleInstaller::BundleInstallOk) {
         kDebug() << "Installed Chatstyle" << this->bundleName() << "successfully";
-        notification = new KNotification(QLatin1String("chatstyleSuccess"), NULL, KNotification::Persistent);
+        notification = new KNotification(QLatin1String("chatstyleSuccess"));
         notification->setText( i18n("Installed Chatstyle %1 successfully.", this->bundleName()) );
     } else {
         kDebug() << "Installation of Chatstyle" << this->bundleName() << "failed";
-        notification = new KNotification(QLatin1String("chatstyleFailure"), NULL, KNotification::Persistent);
+        notification = new KNotification(QLatin1String("chatstyleFailure"));
         notification->setText( i18n("Installation of Chatstyle %1 failed.", this->bundleName()) );
     }
-
-    notification->setActions( QStringList() << i18n("OK") );
-    QObject::connect(notification, SIGNAL(action1Activated()), notification, SLOT(close()));
-    QObject::connect(notification, SIGNAL(ignored()), notification, SLOT(close()));
-
+    notification->setComponentData(ktelepathyComponentData());
     notification->sendEvent();
 
     Q_EMIT showedResult();
diff --git a/adiumxtra-protocol-handler/emoticon-set-installer.cpp b/adiumxtra-protocol-handler/emoticon-set-installer.cpp
index a2011a3..690d60c 100644
--- a/adiumxtra-protocol-handler/emoticon-set-installer.cpp
+++ b/adiumxtra-protocol-handler/emoticon-set-installer.cpp
@@ -27,6 +27,16 @@
 #include <KArchiveDirectory>
 #include <KNotification>
 #include <KLocale>
+#include <KAboutData>
+#include <KComponentData>
+
+// FIXME: Part of a hack to let adiumxtra-protocol-handler use the main ktelepathy.notifyrc because
+// the string freeze does not permit adding a new notifyrc only for adiumxtra-protocol-handler.
+// Remove this after 0.7 is released.
+static KComponentData ktelepathyComponentData() {
+    KAboutData telepathySharedAboutData("ktelepathy",0,KLocalizedString(),0);
+    return KComponentData(telepathySharedAboutData);
+}
 
 EmoticonSetInstaller::EmoticonSetInstaller(KArchive *archive, KTemporaryFile *tmpFile)
 {
@@ -113,6 +123,7 @@ void EmoticonSetInstaller::showRequest()
     QObject::connect(notification, SIGNAL(action2Activated()), this, SLOT(ignoreRequest()));
     QObject::connect(notification, SIGNAL(action2Activated()), notification, SLOT(close()));
 
+    notification->setComponentData(ktelepathyComponentData());
     notification->sendEvent();
 }
 
@@ -120,13 +131,9 @@ void EmoticonSetInstaller::showResult()
 {
     kDebug();
 
-    KNotification *notification = new KNotification(QLatin1String("emoticonsSuccess"), NULL, KNotification::Persistent);
+    KNotification *notification = new KNotification(QLatin1String("emoticonsSuccess"));
     notification->setText( i18n("Installed Emoticonset %1 successfully.", this->bundleName()) );
-
-    notification->setActions( QStringList() << i18n("OK") );
-    QObject::connect(notification, SIGNAL(action1Activated()), notification, SLOT(close()));
-    QObject::connect(notification, SIGNAL(ignored()), notification, SLOT(close()));
-
+    notification->setComponentData(ktelepathyComponentData());
     notification->sendEvent();
 
     Q_EMIT showedResult();

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list