~ubuntu-branches/ubuntu/wily/plasma-nm/wily-proposed

« back to all changes in this revision

Viewing changes to debian/patches/upstream-delay_the_notifications

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell, Jonathan Riddell, Harald Sitter, Scarlett Clark
  • Date: 2014-10-01 16:14:15 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20141001161415-b3q27oqg8xqumbq7
Tags: 4:5.1.0.1-0ubuntu1
[ Jonathan Riddell ]
* New upstream release

[ Harald Sitter ]
* Drop ugly workaround to make a desktop file exectuable
  + This either should be done upstream or be lintian overridden (former
    seems more suitable). Upstream has been poked on IRC.
* Add lintian overrides
  + missing manpages: we don't care
  + package name doesn't match soname: we don't care for internal libraries
  + shlib-without-versioned-soname: we don't care for internal libraries
* Fix copyright short license for LGPL-KDEeV

[ Scarlett Clark ]
* Fix copyright short licence for LGPL-2.1-KDEeV 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
commit 81839a1566d0c0209a308d71b03837f996a19c96
2
 
Author: Lukáš Tinkl <lukas@kde.org>
3
 
Date:   Sat Sep 6 17:54:00 2014 +0200
4
 
 
5
 
    delay the notifications and secret agent initializations until needed
6
 
    
7
 
    BUG:338513
8
 
    REVIEW:120082
9
 
 
10
 
Index: plasma-nm/kded/service.cpp
11
 
===================================================================
12
 
--- plasma-nm.orig/kded/service.cpp     2014-09-15 09:53:43.409980948 +0200
13
 
+++ plasma-nm/kded/service.cpp  2014-09-15 09:53:43.369982542 +0200
14
 
@@ -57,19 +57,13 @@
15
 
 {
16
 
     Q_D(NetworkManagementService);
17
 
 
18
 
-    QDBusReply<bool> notificationsReply = QDBusConnection::sessionBus().interface()->isServiceRegistered("org.freedesktop.Notifications");
19
 
-    if (notificationsReply.value()) {
20
 
-        initializeNotifications();
21
 
-    } else {
22
 
-        QDBusServiceWatcher * watcher = new QDBusServiceWatcher("org.freedesktop.Notifications", QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this);
23
 
-        connect(watcher, SIGNAL(serviceRegistered()), this, SLOT(doInitializeNotifications()));
24
 
-    }
25
 
+    d->agent = Q_NULLPTR;
26
 
+    d->notification = Q_NULLPTR;
27
 
 
28
 
 #if WITH_MODEMMANAGER_SUPPORT
29
 
-    d->modemMonitor = new ModemMonitor(this);
30
 
+    d->modemMonitor = Q_NULLPTR;
31
 
 #endif
32
 
-    d->bluetoothMonitor = new BluetoothMonitor(this);
33
 
-    d->agent = new SecretAgent(this);
34
 
+    d->bluetoothMonitor = Q_NULLPTR;
35
 
 }
36
 
 
37
 
 NetworkManagementService::~NetworkManagementService()
38
 
@@ -77,17 +71,25 @@
39
 
     delete d_ptr;
40
 
 }
41
 
 
42
 
-void NetworkManagementService::doInitializeNotifications()
43
 
+void NetworkManagementService::init()
44
 
 {
45
 
-    QDBusServiceWatcher * watcher = static_cast<QDBusServiceWatcher*>(sender());
46
 
-    watcher->deleteLater();
47
 
+    Q_D(NetworkManagementService);
48
 
 
49
 
-    initializeNotifications();
50
 
-}
51
 
+    if (!d->agent) {
52
 
+        d->agent = new SecretAgent(this);
53
 
+    }
54
 
 
55
 
-void NetworkManagementService::initializeNotifications()
56
 
-{
57
 
-    Q_D(NetworkManagementService);
58
 
+    if (!d->notification) {
59
 
+        d->notification = new Notification(this);
60
 
+    }
61
 
+
62
 
+#if WITH_MODEMMANAGER_SUPPORT
63
 
+    if (!d->modemMonitor) {
64
 
+        d->modemMonitor = new ModemMonitor(this);
65
 
+    }
66
 
+#endif
67
 
 
68
 
-    d->notification = new Notification(this);
69
 
+    if (!d->bluetoothMonitor) {
70
 
+        d->bluetoothMonitor = new BluetoothMonitor(this);
71
 
+    }
72
 
 }
73
 
Index: plasma-nm/kded/service.h
74
 
===================================================================
75
 
--- plasma-nm.orig/kded/service.h       2014-09-15 09:53:43.409980948 +0200
76
 
+++ plasma-nm/kded/service.h    2014-09-15 09:53:43.369982542 +0200
77
 
@@ -35,18 +35,18 @@
78
 
 
79
 
 class PLASMA_NM_EXPORT NetworkManagementService : public KDEDModule
80
 
 {
81
 
+    Q_CLASSINFO("D-Bus Interface", "org.kde.plasmanetworkmanagement")
82
 
     Q_OBJECT
83
 
     Q_DECLARE_PRIVATE(NetworkManagementService)
84
 
 public:
85
 
     NetworkManagementService(QObject * parent, const QVariantList&);
86
 
     virtual ~NetworkManagementService();
87
 
+
88
 
 public Q_SLOTS:
89
 
-    void doInitializeNotifications();
90
 
+    Q_SCRIPTABLE void init();
91
 
 
92
 
 private:
93
 
     NetworkManagementServicePrivate * d_ptr;
94
 
-
95
 
-    void initializeNotifications();
96
 
 };
97
 
 
98
 
 #endif // PLASMANM_KDED_SERVICE_H
99
 
Index: plasma-nm/libs/handler.cpp
100
 
===================================================================
101
 
--- plasma-nm.orig/libs/handler.cpp     2014-09-15 09:53:43.409980948 +0200
102
 
+++ plasma-nm/libs/handler.cpp  2014-09-15 09:53:43.369982542 +0200
103
 
@@ -52,7 +52,10 @@
104
 
     , m_tmpWimaxEnabled(NetworkManager::isWimaxEnabled())
105
 
     , m_tmpWirelessEnabled(NetworkManager::isWirelessEnabled())
106
 
     , m_tmpWwanEnabled(NetworkManager::isWwanEnabled())
107
 
+    , m_agentIface(QStringLiteral("org.kde.kded5"), QStringLiteral("/modules/networkmanagement"),
108
 
+                   QStringLiteral("org.kde.plasmanetworkmanagement"))
109
 
 {
110
 
+    m_agentIface.call(QStringLiteral("init"));
111
 
 }
112
 
 
113
 
 Handler::~Handler()
114
 
Index: plasma-nm/libs/handler.h
115
 
===================================================================
116
 
--- plasma-nm.orig/libs/handler.h       2014-09-15 09:53:43.409980948 +0200
117
 
+++ plasma-nm/libs/handler.h    2014-09-15 09:53:43.369982542 +0200
118
 
@@ -21,6 +21,8 @@
119
 
 #ifndef PLASMA_NM_HANDLER_H
120
 
 #define PLASMA_NM_HANDLER_H
121
 
 
122
 
+#include <QDBusInterface>
123
 
+
124
 
 #include <NetworkManagerQt/Connection>
125
 
 
126
 
 #include "plasmanm_export.h"
127
 
@@ -109,6 +111,7 @@
128
 
     QString m_tmpSpecificPath;
129
 
 
130
 
     bool isBtEnabled();
131
 
+    QDBusInterface m_agentIface;
132
 
 };
133
 
 
134
 
 #endif // PLASMA_NM_HANDLER_H