[gtkmm/gtkmm-2-16] GtkBuilder header is inconsistent in exception/error handling



commit 7c515facf0dae774f716176d884607fbd235dd4c
Author: Johannes Schmid <jhs gnome org>
Date:   Fri Jul 31 11:08:49 2009 +0200

    GtkBuilder header is inconsistent in exception/error handling

 ChangeLog           |    5 +++++
 gtk/src/builder.ccg |   33 +++++++++++++++++++++++++++++++++
 gtk/src/builder.hg  |   18 ++++++++++++------
 3 files changed, 50 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 29c36cb..5dbce64 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-31  Johannes Schmid <jschmid openismus com>
+
+	* gtk/src/builder.hg:
+	* gtk/src/builder.ccg:
+	#590353 - GtkBuilder header is inconsistent in exception/error handling 
 
 2009-07-23  Murray Cumming  <murrayc murrayc com>
 
diff --git a/gtk/src/builder.ccg b/gtk/src/builder.ccg
index 0e4f2c4..89817e8 100644
--- a/gtk/src/builder.ccg
+++ b/gtk/src/builder.ccg
@@ -78,7 +78,18 @@ Glib::RefPtr<Builder> Builder::create_from_file(const std::string& filename, con
   else
     return Glib::RefPtr<Builder>();
 }
+#else
+Glib::RefPtr<Builder> Builder::create_from_file(const std::string& filename, const char* object_id, std::auto_ptr<Glib::Error> error)
+{
+  Glib::RefPtr<Builder> builder = Builder::create();
+  if(builder->add_from_file(filename, object_id, error))
+    return builder;
+  else
+    return Glib::RefPtr<Builder>();
+}
+#endif
 
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
 //static
 Glib::RefPtr<Builder> Builder::create_from_file(const std::string& filename, const Glib::ustring& object_id)
 {
@@ -88,7 +99,18 @@ Glib::RefPtr<Builder> Builder::create_from_file(const std::string& filename, con
   else
     return Glib::RefPtr<Builder>();
 }
+#else
+Glib::RefPtr<Builder> Builder::create_from_file(const std::string& filename, const Glib::ustring& object_id, std::auto_ptr<Glib::Error>& error)
+{
+  Glib::RefPtr<Builder> builder = Builder::create();
+  if(builder->add_from_file(filename, object_id, error))
+    return builder;
+  else
+    return Glib::RefPtr<Builder>();
+}
+#endif
 
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
 //static
 Glib::RefPtr<Builder> Builder::create_from_file(const std::string& filename, const Glib::StringArrayHandle& object_ids)
 {
@@ -98,7 +120,18 @@ Glib::RefPtr<Builder> Builder::create_from_file(const std::string& filename, con
   else
     return Glib::RefPtr<Builder>();
 }
+#else
+Glib::RefPtr<Builder> Builder::create_from_file(const std::string& filename, const Glib::StringArrayHandle& object_ids, std::auto_ptr<Glib::Error>& error)
+{
+  Glib::RefPtr<Builder> builder = Builder::create();
+  if(builder->add_from_file(filename, object_ids, error))
+    return builder;
+  else
+    return Glib::RefPtr<Builder>();
+}
+#endif
 
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
 //static
 Glib::RefPtr<Builder> Builder::create_from_string(const Glib::ustring& buffer)
 {
diff --git a/gtk/src/builder.hg b/gtk/src/builder.hg
index 4eb0430..1533d20 100644
--- a/gtk/src/builder.hg
+++ b/gtk/src/builder.hg
@@ -80,8 +80,11 @@ public:
    *
    * @newin2p14
    */
+#ifdef GLIBMM_EXCEPTIONS_ENABLED   
   static Glib::RefPtr<Builder> create_from_file(const std::string& filename, const Glib::ustring& object_id);
-
+#else
+  static Glib::RefPtr<Builder> create_from_file(const std::string& filename, const Glib::ustring& object_id, std::auto_ptr<Glib::Error>& error);
+#endif
   //This is just to avoid the ambiguous call when using a string literal, 
   //caused by the overload that takes a StringArrayHandle.
   /** Parses a file containing a GtkBuilder UI definition, building only the requested object.
@@ -97,8 +100,11 @@ public:
    *
    * @newin2p16
    */
+#ifdef GLIBMM_EXCEPTIONS_ENABLED   
   static Glib::RefPtr<Builder> create_from_file(const std::string& filename, const char* object_id);
-
+#else  
+  static Glib::RefPtr<Builder> create_from_file(const std::string& filename, const char* object_id, std::auto_ptr<Glib::Error>& error);
+#endif
   /** Parses a file containing a GtkBuilder UI definition, building only the requested objects.
    *
    * If you are adding an object that depends on an object that is not
@@ -112,11 +118,11 @@ public:
    *
    * @newin2p14
    */
+#ifdef GLIBMM_EXCEPTIONS_ENABLED   
   static Glib::RefPtr<Builder> create_from_file(const std::string& filename, const Glib::StringArrayHandle& object_ids);
-  _IGNORE(gtk_builder_add_objects_from_file)
-
-
-
+#else
+  static Glib::RefPtr<Builder> create_from_file(const std::string& filename, const Glib::StringArrayHandle& object_ids, std::auto_ptr<Glib::Error>& error);
+#endif  
 
   /** Parses a string containing a GtkBuilder UI definition.
    *



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