[glibmm] Miscellaneous Gio::Application fixes



commit 93179324198684926203b20b3bb2ecc8bb4bded2
Author: Jonathon Jongsma <jonathon quotidian org>
Date:   Fri Nov 12 23:07:31 2010 -0600

    Miscellaneous Gio::Application fixes
    
    - Add non-cancellable overload of register_application()
    - return int value from run() correctly
    - Fix protected constructor signature
    - use _WRAP_CTOR and _WRAP_CREATE()

 ChangeLog               |   11 +++++++++++
 gio/src/application.ccg |   10 ++++++++++
 gio/src/application.hg  |    9 ++++-----
 3 files changed, 25 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 13d0400..98498c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2010-11-12  Jonathon Jongsma  <jjongsma gnome org>
+
+	Miscellaneous Gio::Application fixes
+
+	* gio/src/application.hg:
+	* gio/src/application.ccg:
+		- Add non-cancellable overload of register_application()
+		- return int value from run() correctly
+		- Fix protected constructor signature
+		- use _WRAP_CTOR and _WRAP_CREATE()
+
 2.27.3:
 
 2010-11-10  Murray Cumming  <murrayc murrayc com>
diff --git a/gio/src/application.ccg b/gio/src/application.ccg
index fb7a56f..196738c 100644
--- a/gio/src/application.ccg
+++ b/gio/src/application.ccg
@@ -41,4 +41,14 @@ void Application::open(const type_vec_files& files, const Glib::ustring& hint)
   delete[] files_array ;
 }
 
+bool Application::register_application()
+{
+  GError* gerror = 0;
+  bool retvalue = g_application_register(gobj(), NULL, &(gerror));
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+
+  return retvalue;
+}
+
 } // namespace Gio
diff --git a/gio/src/application.hg b/gio/src/application.hg
index 39932c4..16128bb 100644
--- a/gio/src/application.hg
+++ b/gio/src/application.hg
@@ -82,12 +82,10 @@ class Application : public Glib::Object
   _CLASS_GOBJECT(Application, GApplication, G_APPLICATION, Glib::Object, GObject)
 
 protected:
-  _CTOR_DEFAULT()
+  _WRAP_CTOR(Application(const Glib::ustring& application_id, ApplicationFlags flags=APPLICATION_FLAGS_NONE), g_application_new)
 
 public:
-  //_WRAP_CREATE()
-
-  _WRAP_METHOD(static Glib::RefPtr<Application> create(const Glib::ustring& appid, ApplicationFlags flags = APPLICATION_FLAGS_NONE), g_application_new)
+  _WRAP_CREATE(const Glib::ustring& application_id, ApplicationFlags flags=APPLICATION_FLAGS_NONE)
 
   _WRAP_METHOD(static bool id_is_valid(const Glib::ustring& application_id), g_application_id_is_valid)
 
@@ -108,6 +106,7 @@ public:
   //TODO: Add a version with no cancellable.
   //Renamed from register() because that is a C++ keyword.
   _WRAP_METHOD(bool register_application(const Glib::RefPtr<Gio::Cancellable>& cancellable), g_application_register, errthrow)
+  bool register_application();
 
   _WRAP_METHOD(void hold(), g_application_hold)
   _WRAP_METHOD(void release(), g_application_release)
@@ -134,7 +133,7 @@ public:
    */
   void open(const type_vec_files& files, const Glib::ustring& hint = Glib::ustring());
 
-  _WRAP_METHOD(void run(int argc, char** argv), g_application_run)
+  _WRAP_METHOD(int run(int argc, char** argv), g_application_run)
   //TODO: g_application_run_with_arguments)
 
   _WRAP_PROPERTY("action-group", Glib::RefPtr<ActionGroup>)



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