[glom] Replace a used of (removed from GTK+) gdk_spawn_*() API.



commit 921b768794bae864dae06e366c8747fc967acf8b
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Jan 5 01:41:06 2011 +0100

    Replace a used of (removed from GTK+) gdk_spawn_*() API.
    
    * glom/application.cc: This partially fixes the build.

 ChangeLog           |    6 ++++++
 glom/application.cc |   14 ++++++++------
 2 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 2fd6e0b..81997d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-01-05  Murray Cumming  <murrayc murrayc com>
+
+	Replace a used of (removed from GTK+) gdk_spawn_*() API.
+
+	* glom/application.cc: This partially fixes the build.
+
 2010-12-16  Murray Cumming  <murrayc murrayc com>
 
 	More dealing with cppcheck errors. 
diff --git a/glom/application.cc b/glom/application.cc
index 5a004da..7377145 100644
--- a/glom/application.cc
+++ b/glom/application.cc
@@ -911,19 +911,21 @@ Glib::ustring Application::get_file_uri_without_extension(const Glib::ustring& u
   }
 }
 
+//TODO: Use Gio::Application? Is this even used?
 void Application::new_instance(const Glib::ustring& uri) //Override
 {
   Glib::ustring command = "glom";
   if(!uri.empty())
     command += ' ' + uri;
 
-  GError* gerror = 0;
-  gdk_spawn_command_line_on_screen(Glib::unwrap(get_screen()),
-    command.c_str(),
-    &gerror);
-  if(gerror)
+  try
+  {
+    Glib::spawn_command_line_sync(
+      command.c_str());
+  }
+  catch(const Glib::Error& ex)
   {
-    std::cerr << G_STRFUNC << ": " << gerror->message << std::endl;
+    std::cerr << G_STRFUNC << ": " << ex.what() << std::endl;
   }
 }
 



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