[gtkmm/gtkmm-2-14] GtkBuilder header is inconsistent in exception/error handling
- From: Johannes Schmid <jhs src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtkmm/gtkmm-2-14] GtkBuilder header is inconsistent in exception/error handling
- Date: Fri, 31 Jul 2009 12:47:21 +0000 (UTC)
commit a65d657be06f0e428227ce9d1f4c968bda40be44
Author: Johannes Schmid <jhs gnome org>
Date: Fri Jul 31 11:08:49 2009 +0200
GtkBuilder header is inconsistent in exception/error handling
ChangeLog | 7 +++++++
gtk/src/builder.ccg | 33 +++++++++++++++++++++++++++++++++
gtk/src/builder.hg | 18 ++++++++++++------
3 files changed, 52 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c95d0b0..063e75f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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
+ (cherry-picked from master)
+
2009-07-23 Murray Cumming <murrayc murrayc com>
Gtk::Builder: Fix a crash when the widget is not found.
diff --git a/gtk/src/builder.ccg b/gtk/src/builder.ccg
index afd258a..e08c917 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 ac3abd9..15337ba 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]