All pastes #1999908 Raw Edit

Miscellany

public diff v1 · immutable
#1999908 ·published 2010-11-23 13:39 UTC
rendered paste body
unchanged:--- ./orig/kingston-update-notifier-1.2/src/notifier.cpp	2010-07-17 00:51:39.000000000 +0300+++ ./kingston-update-notifier-1.2/src/notifier.cpp	2010-11-23 13:32:39.063631001 +0200@@ -28,6 +29,9 @@ #include <KIcon> #include <KLocale> #include <QApplication>+#include <QProcess>+#include <QtDBus>+#include <kworkspace/kworkspace.h>  #include <QTimer> #include <KNotification>@@ -85,10 +89,16 @@ void notifier_t::notify_reboot() {   note->setText(i18n("In order to complete this upgrade, you need to reboot your system"));   note->setPixmap(KIcon("system-reboot").pixmap(QSize(32,32)));   note->setComponentData(m_component_data);-  note->setActions(QStringList() << i18nc("Do the proposed action (upgrade, reboot, etc) later", "Later"));+  note->setActions(QStringList() << i18nc("Do the proposed action (upgrade, reboot, etc) later", "Later")+    << i18nc("Reboot the system", "Reboot"));   connect(note,SIGNAL(closed()),m_reboot_nagger,SLOT(start()));   connect(note,SIGNAL(action1Activated()),m_reboot_nagger,SLOT(start()));+  connect(note,SIGNAL(action2Activated()),SLOT(reboot()));   note->sendEvent(); } +void notifier_t::reboot() {+  QDBusInterface interface("org.kde.ksmserver", "/KSMServer", "org.kde.KSMServerInterface");+  interface.call("logout", KWorkSpace::ShutdownConfirmYes, KWorkSpace::ShutdownTypeReboot, KWorkSpace::ShutdownModeInteractive);+} #include <notifier.moc>unchanged:--- ./orig/kingston-update-notifier-1.2/src/notifier.h	2010-07-19 23:05:01.000000000 +0300+++ ./kingston-update-notifier-1.2/src/notifier.h	2010-11-23 03:01:56.332683687 +0200@@ -41,6 +41,7 @@ class notifier_t : public QObject{   public Q_SLOTS:     void notify_new_updates(int updates, int security_updates);     void notify_reboot();+    void reboot();   private:     void show_update_notification(const QString& title, const QString& message, const QString& iconname);     KComponentData m_component_data;only in patch2:unchanged:--- ./orig/kingston-update-notifier-1.2/debian/control	2010-07-17 00:51:39.000000000 +0300+++ ./kingston-update-notifier-1.2/debian/control	2010-11-23 13:29:56.515631000 +0200@@ -2,7 +2,7 @@ Source: kingston-update-notifier Section: kde Priority: optional Maintainer: Sune Vuorela <sune@debian.org>-Build-Depends: debhelper (>= 7), cmake, kdelibs5-dev+Build-Depends: debhelper (>= 7), cmake, kdelibs5-dev, kdebase-workspace-dev Standards-Version: 3.8.4  Package: update-notifier-kde