Ubuntu Pastebin

Paste from Marco Trevisan (3v1n0) at Mon, 16 Jan 2017 17:01:22 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
=== modified file 'UnityCore/GLibDBusProxy.cpp'
--- UnityCore/GLibDBusProxy.cpp	2015-11-24 16:40:03 +0000
+++ UnityCore/GLibDBusProxy.cpp	2017-01-16 17:01:00 +0000
@@ -609,7 +609,7 @@
   return nullptr;
 }
 
-void DBusProxy::GetProperty(std::string const& name, ReplyCallback const& callback)
+void DBusProxy::GetProperty(std::string const& name, ReplyCallback const& callback, GCancellable *cancellable)
 {
   if (!callback)
     return;
@@ -620,7 +620,7 @@
                            pimpl->name_.c_str(), pimpl->object_path_.c_str(),
                            "org.freedesktop.DBus.Properties",
                            "Get", g_variant_new ("(ss)", pimpl->interface_name_.c_str(), name.c_str()),
-                            G_VARIANT_TYPE("(v)"), G_DBUS_CALL_FLAGS_NONE, -1, pimpl->cancellable_,
+                            G_VARIANT_TYPE("(v)"), G_DBUS_CALL_FLAGS_NONE, -1, cancellable ? cancellable : pimpl->cancellable_,
                            [] (GObject *source, GAsyncResult *res, gpointer user_data) {
       glib::Error err;
       std::unique_ptr<ReplyCallback> callback(static_cast<ReplyCallback*>(user_data));

=== modified file 'UnityCore/GLibDBusProxy.h'
--- UnityCore/GLibDBusProxy.h	2014-10-10 11:35:40 +0000
+++ UnityCore/GLibDBusProxy.h	2017-01-16 16:57:06 +0000
@@ -74,7 +74,7 @@
   bool IsConnected() const;
 
   Variant GetProperty(std::string const& property_name) const;
-  void GetProperty(std::string const& property_name, ReplyCallback const&);
+  void GetProperty(std::string const& property_name, ReplyCallback const&, GCancellable *cancellable = nullptr);
   void SetProperty(std::string const& property_name, GVariant* value);
 
   void Connect(std::string const& signal_name, ReplyCallback const& callback);

=== modified file 'UnityCore/GnomeSessionManager.cpp'
--- UnityCore/GnomeSessionManager.cpp	2016-11-02 16:38:47 +0000
+++ UnityCore/GnomeSessionManager.cpp	2017-01-16 16:58:36 +0000
@@ -130,7 +130,7 @@
 
         glib::Variant tmp(g_variant_get_child_value(variant, 1), glib::StealRef());
         SetupLogin1Proxy(tmp.GetObjectPath());
-      });
+      }, cancellable_);
     }
   }
 

=== modified file 'UnityCore/GnomeSessionManagerImpl.h'
--- UnityCore/GnomeSessionManagerImpl.h	2016-11-02 16:38:47 +0000
+++ UnityCore/GnomeSessionManagerImpl.h	2017-01-16 16:58:16 +0000
@@ -84,6 +84,7 @@
   glib::DBusProxy::Ptr dm_proxy_;
   glib::DBusProxy::Ptr dm_seat_proxy_;
 
+  glib::Cancellable cancellable_;
   int open_sessions_;
 };
 
Download as text