[glibmm] Application: Add create_*() overloads.



commit 92720f01467ae1fdf0cced40451042decdfb75b4
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Jul 30 19:29:44 2010 +0200

    Application: Add create_*() overloads.
    
    * gio/src/application.[hg|ccg]: Add create_*() methods without argc and
    argv parameters, because these can be NULL.

 ChangeLog               |    7 +++++++
 gio/src/application.ccg |   34 +++++++++++++++++++++-------------
 gio/src/application.hg  |   10 ++++++++++
 3 files changed, 38 insertions(+), 13 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ba15199..42c385d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2010-07-30  Murray Cumming  <murrayc murrayc com>
 
+	Application: Add create_*() overloads.
+	
+	* gio/src/application.[hg|ccg]: Add create_*() methods without argc and 
+	argv parameters, because these can be NULL.
+
+2010-07-30  Murray Cumming  <murrayc murrayc com>
+
 	Added Gio::Application, wrapping GApplication.
 
 	* gio/src/filelist.am: 
diff --git a/gio/src/application.ccg b/gio/src/application.ccg
index 7848b3a..365f8d3 100644
--- a/gio/src/application.ccg
+++ b/gio/src/application.ccg
@@ -23,26 +23,34 @@
 namespace Gio
 {
 
-/*
-Glib::RefPtr<AppInfo>
-Application::create_from_commandline(const std::string& commandline,
-                                 const std::string& application_name,
-                                 AppInfoCreateFlags flags)
+Glib::RefPtr<Application> Application::create(const Glib::ustring& appid)
+{
+  return Glib::wrap(g_application_new(appid.c_str(), 0, 0));
+}
+
+
+Glib::RefPtr<Application> Application::create_try(const Glib::ustring& appid)
 {
-  GAppInfo* capp_info = 0;
   GError* gerror = 0;
+  Glib::RefPtr<Application> retvalue = Glib::wrap(g_application_try_new(appid.c_str(), 0, 0, &(gerror)));
+
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
 
-  capp_info = g_app_info_create_from_commandline(commandline.c_str(),
-                                                 application_name.c_str(),
-                                                 static_cast<GAppInfoCreateFlags>(flags),
-                                                 &gerror);
+  return retvalue;
+}
+
+
+Glib::RefPtr<Application> Application::create_unregistered_try(const Glib::ustring& appid)
+{
+  GError* gerror = 0;
+  Glib::RefPtr<Application> retvalue = Glib::wrap(g_application_unregistered_try_new(appid.c_str(), 0, 0, &(gerror)));
 
-  if (gerror)
+  if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
-  return Glib::wrap(capp_info);
+  return retvalue;
 }
-*/
 
 
 } // namespace Gio
diff --git a/gio/src/application.hg b/gio/src/application.hg
index 11d0a37..4c8160b 100644
--- a/gio/src/application.hg
+++ b/gio/src/application.hg
@@ -41,10 +41,20 @@ public:
   //_WRAP_CREATE()
 
   _WRAP_METHOD(static Glib::RefPtr<Application> create(const Glib::ustring& appid, int argc, char** argv), g_application_new)
+  
+  //TODO: Documentation
+  static Glib::RefPtr<Application> create(const Glib::ustring& appid);
 
   _WRAP_METHOD(static Glib::RefPtr<Application> create_try(const Glib::ustring& appid,  int argc, char** argv), g_application_try_new, errthrow)
+  
+   //TODO: Documentation
+   static Glib::RefPtr<Application> create_try(const Glib::ustring& appid);
 
   _WRAP_METHOD(static Glib::RefPtr<Application> create_unregistered_try(const Glib::ustring& appid, int argc, char** argv), g_application_unregistered_try_new, errthrow)
+  
+   //TODO: Documentation
+   static Glib::RefPtr<Application> create_unregistered_try(const Glib::ustring& appid);
+
 
   //Renamed from register() because that is a C++ keyword.
   _WRAP_METHOD(bool register_application(), g_application_register)



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