[gnote] Remove code for invoking remove gnote instance, never actually called



commit d93d5073a3de5ee7a76e625106b82dfaad4b8f4d
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Mon Mar 1 23:12:50 2021 +0200

    Remove code for invoking remove gnote instance, never actually called

 src/gnote.cpp | 34 +---------------------------------
 1 file changed, 1 insertion(+), 33 deletions(-)
---
diff --git a/src/gnote.cpp b/src/gnote.cpp
index d8e9efdd..3a0483a5 100644
--- a/src/gnote.cpp
+++ b/src/gnote.cpp
@@ -48,7 +48,6 @@
 #include "utils.hpp"
 #include "tagmanager.hpp"
 #include "dbus/remotecontrol.hpp"
-#include "dbus/remotecontrolclient.hpp"
 #include "sharp/streamreader.hpp"
 #include "sharp/files.hpp"
 #include "notebooks/notebookmanager.hpp"
@@ -168,27 +167,6 @@ namespace gnote {
       if(name_acquired) {
         DBG_OUT("Gnote remote control active.");
       } 
-      else {
-        // If Gnote is already running, open the search window
-        // so the user gets some sort of feedback when they
-        // attempt to run Gnote again, except when --background is passed
-        if(!m_is_background) {
-          Glib::RefPtr<RemoteControlClient> remote;
-          try {
-            remote = m_remote_control.get_instance();
-            DBG_ASSERT(remote, "remote is NULL, something is wrong");
-            if(remote) {
-              remote->DisplaySearch();
-            }
-          } 
-          catch (...)
-          {
-          }
-        }
-
-        ERR_OUT(_("Gnote is already running.  Exiting..."));
-        ::exit(-1);
-      }
     }
 
     make_app_actions();
@@ -587,17 +565,7 @@ namespace gnote {
     if(remote_control) {
       execute(remote_control);
     }
-    else {
-      //gnote already running, execute via D-Bus and exit this instance
-      Glib::RefPtr<RemoteControlClient> remote = 
static_cast<Gnote&>(m_gnote).remote_control().get_instance();
-      if(!remote) {
-        ERR_OUT(_("Could not connect to remote instance."));
-      }
-      else {
-        execute(remote);
-      }
-      static_cast<Gnote&>(m_gnote).quit();
-    }
+
     return 0;
   }
 


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