aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-05-12 11:31:55 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-05-12 11:31:55 +0800
commit97a9bd320d00f4a194d6948cf9d54435b04a331e (patch)
tree6490e90bc2ebb3bd274a902de4411e26ec355bcb /addressbook/gui
parente406cdcf602c6580c7d129796a9a3a15818251f5 (diff)
downloadgsoc2013-evolution-97a9bd320d00f4a194d6948cf9d54435b04a331e.tar
gsoc2013-evolution-97a9bd320d00f4a194d6948cf9d54435b04a331e.tar.gz
gsoc2013-evolution-97a9bd320d00f4a194d6948cf9d54435b04a331e.tar.bz2
gsoc2013-evolution-97a9bd320d00f4a194d6948cf9d54435b04a331e.tar.lz
gsoc2013-evolution-97a9bd320d00f4a194d6948cf9d54435b04a331e.tar.xz
gsoc2013-evolution-97a9bd320d00f4a194d6948cf9d54435b04a331e.tar.zst
gsoc2013-evolution-97a9bd320d00f4a194d6948cf9d54435b04a331e.zip
set exception properly on failure.
2004-05-11 Not Zed <NotZed@Ximian.com> * gui/component/addressbook-component.c (impl_upgradeFromVersion): set exception properly on failure. * gui/component/addressbook-migrate.c (addressbook_migrate): take a GError error return. Doesn't do anything with it ... but ... svn path=/trunk/; revision=25864
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/component/addressbook-component.c16
-rw-r--r--addressbook/gui/component/addressbook-migrate.c2
-rw-r--r--addressbook/gui/component/addressbook-migrate.h4
3 files changed, 18 insertions, 4 deletions
diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c
index ad43ba8f27..e74b0d7dda 100644
--- a/addressbook/gui/component/addressbook-component.c
+++ b/addressbook/gui/component/addressbook-component.c
@@ -170,10 +170,22 @@ impl_requestCreateItem (PortableServer_Servant servant,
e_book_async_get_default_addressbook (book_loaded_cb, g_strdup (item_type_name));
}
-static CORBA_boolean
+static void
impl_upgradeFromVersion (PortableServer_Servant servant, short major, short minor, short revision, CORBA_Environment *ev)
{
- return addressbook_migrate (addressbook_component_peek (), major, minor, revision);
+ GError *err = NULL;
+
+ if (!addressbook_migrate (addressbook_component_peek (), major, minor, revision, &err)) {
+ GNOME_Evolution_Component_UpgradeFailed *failedex;
+
+ failedex = GNOME_Evolution_Component_UpgradeFailed__alloc();
+ failedex->what = CORBA_string_dup(_("Failed upgrading Addressbook settings or folders."));
+ failedex->why = CORBA_string_dup(err->message);
+ CORBA_exception_set(ev, CORBA_USER_EXCEPTION, ex_GNOME_Evolution_Component_UpgradeFailed, failedex);
+ }
+
+ if (err)
+ g_error_free(err);
}
static CORBA_boolean
diff --git a/addressbook/gui/component/addressbook-migrate.c b/addressbook/gui/component/addressbook-migrate.c
index 5474ba9c00..32fbf1ca3e 100644
--- a/addressbook/gui/component/addressbook-migrate.c
+++ b/addressbook/gui/component/addressbook-migrate.c
@@ -1043,7 +1043,7 @@ migration_context_free (MigrationContext *context)
}
int
-addressbook_migrate (AddressbookComponent *component, int major, int minor, int revision)
+addressbook_migrate (AddressbookComponent *component, int major, int minor, int revision, GError **err)
{
ESourceGroup *on_this_computer;
ESourceGroup *on_ldap_servers;
diff --git a/addressbook/gui/component/addressbook-migrate.h b/addressbook/gui/component/addressbook-migrate.h
index 89dce7a91b..dc7c473e12 100644
--- a/addressbook/gui/component/addressbook-migrate.h
+++ b/addressbook/gui/component/addressbook-migrate.h
@@ -24,6 +24,8 @@
#include "addressbook-component.h"
-int addressbook_migrate (AddressbookComponent *component, int major, int minor, int revision);
+struct _GError;
+
+int addressbook_migrate (AddressbookComponent *component, int major, int minor, int revision, struct _GError **err);
#endif /* _ADDRESSBOOK_MIGRATE_H_ */