summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2011-02-23 12:01:47 +0100
committerMurray Cumming <murrayc@murrayc.com>2011-02-23 12:01:47 +0100
commit9670cf533be1ad717df6974e800cc3b3a419b780 (patch)
tree2b92c3681a619577e6da7070b71f07b243ad89f2
parent7d7d42f0b16518c160380e7121ffb99bc43dbb11 (diff)
downloadglibmm-9670cf533be1ad717df6974e800cc3b3a419b780.tar.gz
Bring back Gio::Error registration.
* gio/src/error.[hg|ccg]: Move Gio::DBus::Error to * gio/src/dbuserror.[hg|ccg]: and temporarily rename it to Gio::DBusError because generate_wrap_init.pl.in is wrapping only on of Gio::Error and Gio::DBus::Error. Unfortunately, we need to fix the generation to handle this properly even when it is called Gio::DBus::DBusError.
-rw-r--r--ChangeLog10
-rw-r--r--examples/dbus/busserver.cc6
-rw-r--r--gio/giomm.h1
-rw-r--r--gio/src/dbusconnection.ccg2
-rw-r--r--gio/src/dbusconnection.hg1
-rw-r--r--gio/src/dbuserror.ccg25
-rw-r--r--gio/src/dbuserror.hg44
-rw-r--r--gio/src/error.hg5
-rw-r--r--gio/src/filelist.am1
9 files changed, 85 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 98575d3d..2de970e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-02-23 Murray Cumming <murrayc@murrayc.com>
+
+ Bring back Gio::Error registration.
+
+ * gio/src/error.[hg|ccg]: Move Gio::DBus::Error to
+ * gio/src/dbuserror.[hg|ccg]: and temporarily rename it to Gio::DBusError
+ because generate_wrap_init.pl.in is wrapping only on of Gio::Error and
+ Gio::DBus::Error. Unfortunately, we need to fix the generation to handle
+ this properly even when it is called Gio::DBus::DBusError.
+
2011-02-21 Murray Cumming <murrayc@murrayc.com>
Mark some new API.
diff --git a/examples/dbus/busserver.cc b/examples/dbus/busserver.cc
index 3beeca2d..534a70b8 100644
--- a/examples/dbus/busserver.cc
+++ b/examples/dbus/busserver.cc
@@ -100,7 +100,7 @@ static void on_method_call(const Glib::RefPtr<Gio::DBus::Connection>& connection
if(!curr_alarm.assign_from_iso8601(time_str))
{
// If setting alarm was not successful, return an error.
- Gio::DBus::Error error(Gio::DBus::Error::INVALID_ARGS,
+ Gio::DBusError error(Gio::DBusError::INVALID_ARGS,
"Alarm string is not in ISO8601 format.");
invocation->return_gerror(error);
}
@@ -144,7 +144,7 @@ static void on_method_call(const Glib::RefPtr<Gio::DBus::Connection>& connection
else
{
// Non-existent method on the interface.
- Gio::DBus::Error error(Gio::DBus::Error::UNKNOWN_METHOD,
+ Gio::DBusError error(Gio::DBusError::UNKNOWN_METHOD,
"Method does not exist.");
invocation->return_gerror(error);
}
@@ -174,7 +174,7 @@ void on_get_property(Glib::VariantBase& property,
}
else
{
- throw Gio::DBus::Error(Gio::DBus::Error::FAILED, "Unknown property name.");
+ throw Gio::DBusError(Gio::DBusError::FAILED, "Unknown property name.");
}
}
diff --git a/gio/giomm.h b/gio/giomm.h
index 12f71c3d..28a0a866 100644
--- a/gio/giomm.h
+++ b/gio/giomm.h
@@ -34,6 +34,7 @@
#include <giomm/dbusaddress.h>
#include <giomm/dbusauthobserver.h>
#include <giomm/dbusconnection.h>
+#include <giomm/dbuserror.h>
#include <giomm/dbuserrorutils.h>
#include <giomm/dbusintrospection.h>
#include <giomm/dbusmessage.h>
diff --git a/gio/src/dbusconnection.ccg b/gio/src/dbusconnection.ccg
index eae69e0a..17c5e765 100644
--- a/gio/src/dbusconnection.ccg
+++ b/gio/src/dbusconnection.ccg
@@ -21,7 +21,7 @@
#include <giomm/dbusauthobserver.h>
#include <giomm/dbusintrospection.h>
#include <giomm/dbusmethodinvocation.h>
-#include <giomm/error.h>
+#include <giomm/dbuserror.h>
#include "slot_async.h"
namespace
diff --git a/gio/src/dbusconnection.hg b/gio/src/dbusconnection.hg
index 9a84d32b..8c323d9d 100644
--- a/gio/src/dbusconnection.hg
+++ b/gio/src/dbusconnection.hg
@@ -32,7 +32,6 @@
_DEFS(giomm,gio)
_PINCLUDE(glibmm/private/object_p.h)
-//TODO: Use a GDbus namespace, and remove the DBus prefixes.
namespace Gio
{
diff --git a/gio/src/dbuserror.ccg b/gio/src/dbuserror.ccg
new file mode 100644
index 00000000..555a34bc
--- /dev/null
+++ b/gio/src/dbuserror.ccg
@@ -0,0 +1,25 @@
+// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+
+/* Copyright (C) 2010 The giomm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <gio/gio.h>
+
+namespace Gio
+{
+
+} // namespace Gio
diff --git a/gio/src/dbuserror.hg b/gio/src/dbuserror.hg
new file mode 100644
index 00000000..95f1aa68
--- /dev/null
+++ b/gio/src/dbuserror.hg
@@ -0,0 +1,44 @@
+// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+
+/* Copyright (C) 2010 The giomm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+_DEFS(giomm,gio)
+_PINCLUDE(glibmm/private/interface_p.h)
+
+namespace Gio
+{
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+//Let the generated friend declaration know what wrap_init() it should refer to.
+//TODO: But the generated friend declaration needs to specify the full namespace too.
+void wrap_init();
+#endif // DOXYGEN_SHOULD_SKIP_THIS
+
+//TODO: Put this in the DBus namespace and remove the DBus prefix,
+//when we can get the generate friend declaration to be generated correctly.
+//namespace DBus
+//{
+
+//This will be necessary when putting it in the DBus namespace:
+//Add the underscore so this is recognized: GMMPROC_EXTRA_NAMESPACE(DBus)
+_WRAP_GERROR(DBusError, GDBusError, G_DBUS_ERROR, NO_GTYPE)
+
+//} //namespace DBus
+
+} // namespace Gio
+
diff --git a/gio/src/error.hg b/gio/src/error.hg
index f22b153e..65bb1c8f 100644
--- a/gio/src/error.hg
+++ b/gio/src/error.hg
@@ -43,11 +43,6 @@ namespace Gio
_WRAP_GERROR(Error, GIOErrorEnum, G_IO_ERROR, NO_GTYPE)
_WRAP_GERROR(ResolverError, GResolverError, G_RESOLVER_ERROR, NO_GTYPE)
-namespace DBus
-{
-_WRAP_GERROR(Error, GDBusError, G_DBUS_ERROR, NO_GTYPE)
-} //namespace DBus
-
} // namespace Gio
#ifdef GIOMM_SAVED_HOST_NOT_FOUND
diff --git a/gio/src/filelist.am b/gio/src/filelist.am
index cf5f7b1b..604ec48a 100644
--- a/gio/src/filelist.am
+++ b/gio/src/filelist.am
@@ -28,6 +28,7 @@ giomm_files_any_hg = \
dbusaddress.hg \
dbusauthobserver.hg \
dbusconnection.hg \
+ dbuserror.hg \
dbuserrorutils.hg \
dbusintrospection.hg \
dbusmessage.hg \