[gnote] Use dbus connection from application



commit b2a0b824df43452ef4cc0eb576a8796a1af705e9
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Tue Mar 2 23:11:09 2021 +0200

    Use dbus connection from application

 src/gnote.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/gnote.cpp b/src/gnote.cpp
index 81b69fe4..67577e29 100644
--- a/src/gnote.cpp
+++ b/src/gnote.cpp
@@ -197,7 +197,13 @@ namespace gnote {
 
   void Gnote::register_object()
   {
-    m_remote_control.register_object(Gio::DBus::Connection::get_sync(Gio::DBus::BUS_TYPE_SESSION), *this, 
default_note_manager());
+    auto conn = get_dbus_connection();
+    if(conn) {
+      m_remote_control.register_object(conn, *this, default_note_manager());
+    }
+    else {
+      ERR_OUT(_("No D-Bus connection available, shell search and remote control will not work."));
+    }
   }
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]