[glibmm] Restore the Gio::DBus::Error registration.



commit ba29ea78537d2d41c6b6f54a6180a52ac3ae2937
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Feb 24 13:04:44 2011 +0100

    Restore the Gio::DBus::Error registration.
    
    * tools/generate_wrap_init.pl.in: Use a qualified C++ name for the key in
    the associated-array of exceptions. This seems to work, though it feels very
    hacky.

 ChangeLog                      |    8 ++++++++
 tools/generate_wrap_init.pl.in |   15 +++++++++++++--
 2 files changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a85bb14..a68e119 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2011-02-24  Murray Cumming  <murrayc murrayc com>
 
+	Restore the Gio::DBus::Error registration.
+
+	* tools/generate_wrap_init.pl.in: Use a qualified C++ name for the key in 
+	the associated-array of exceptions. This seems to work, though it feels very 
+	hacky.
+
+2011-02-24  Murray Cumming  <murrayc murrayc com>
+
 	Rename Gio::DBus::DBusError to Gio::DBus::Error.
 
 	* gio/src/dbuserror.hg: Rename the class to Error.
diff --git a/tools/generate_wrap_init.pl.in b/tools/generate_wrap_init.pl.in
index 804dab2..5d62bf2 100644
--- a/tools/generate_wrap_init.pl.in
+++ b/tools/generate_wrap_init.pl.in
@@ -128,9 +128,20 @@ while ($ARGV[0])
       $line =~ s/\)//;
       ($cppname, $cname, $ccast) = split(/,/, $line);
 
-      $exceptions{$cppname} = $cname;
+      # Generate a unique ID for the GError.
+      # Otherwise we will overwrite Gio::Error with Gio::DBus::Error.
+      # TODO: Isn't this necessary for other classes (not just Errors)?
+      my $qualification = "";
+      foreach ( @tmpnamespace )
+      {
+         $qualification .= "::$_";
+      }
+      
+      my $qualified_cppname = $qualification . "::" . $cppname;
+      # print "debug: " . $qualified_cppname . "\n";
+      $exceptions{$qualified_cppname} = $cname;
       @{$namespaces{$cppname}} = ( @tmpnamespace ); #both are lists of strings
-      $basenames{$cppname} = lc($ccast);
+      $basenames{$qualified_cppname} = lc($ccast);
     }
     elsif (/_GTKMMPROC_WIN32_NO_WRAP/)
     {



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