aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2002-03-15 22:05:33 +0800
committerJP Rosevear <jpr@src.gnome.org>2002-03-15 22:05:33 +0800
commitac6299d7a485294d6090835b9942ea061c5279cf (patch)
tree00ce693ce5cde7f4502a63b3ae49f04be0131b2f
parent02d39bf7b3fa10dbd8cbf21c13b842bcf69ff64a (diff)
downloadgsoc2013-evolution-ac6299d7a485294d6090835b9942ea061c5279cf.tar.gz
gsoc2013-evolution-ac6299d7a485294d6090835b9942ea061c5279cf.tar.zst
gsoc2013-evolution-ac6299d7a485294d6090835b9942ea061c5279cf.zip
use bonobo exception macros to tidy
2002-03-15 JP Rosevear <jpr@ximian.com> * gui/main.c: use bonobo exception macros to tidy * gui/itip-control-factory.c: ditto * gui/gnome-cal.c: ditto * gui/comp-editor-factory.c: ditto * gui/calendar-commands.c: ditto svn path=/trunk/; revision=16172
-rw-r--r--calendar/ChangeLog12
-rw-r--r--calendar/gui/calendar-commands.c5
-rw-r--r--calendar/gui/comp-editor-factory.c10
-rw-r--r--calendar/gui/gnome-cal.c24
-rw-r--r--calendar/gui/itip-bonobo-control.c14
-rw-r--r--calendar/gui/itip-control-factory.c14
-rw-r--r--calendar/gui/main.c5
7 files changed, 43 insertions, 41 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index ba6521c843..5d21a09727 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,15 @@
+2002-03-15 JP Rosevear <jpr@ximian.com>
+
+ * gui/main.c: use bonobo exception macros to tidy
+
+ * gui/itip-control-factory.c: ditto
+
+ * gui/gnome-cal.c: ditto
+
+ * gui/comp-editor-factory.c: ditto
+
+ * gui/calendar-commands.c: ditto
+
2002-03-14 JP Rosevear <jpr@ximian.com>
* idl/evolution-calendar.idl: add all day event editor mode
diff --git a/calendar/gui/calendar-commands.c b/calendar/gui/calendar-commands.c
index 4aa9eb7248..8eb6a540e8 100644
--- a/calendar/gui/calendar-commands.c
+++ b/calendar/gui/calendar-commands.c
@@ -45,6 +45,7 @@
#include <libgnome/gnome-util.h>
#include <libgnome/gnome-i18n.h>
#include <bonobo/bonobo-ui-util.h>
+#include <bonobo/bonobo-exception.h>
#include <cal-util/timeutil.h>
#include "shell/Evolution.h"
#include "calendar-commands.h"
@@ -339,7 +340,7 @@ get_shell_view_interface (BonoboControl *control)
shell_view = Bonobo_Unknown_queryInterface (control_frame,
"IDL:GNOME/Evolution/ShellView:1.0",
&ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
+ if (BONOBO_EX (&ev)) {
g_message ("get_shell_view_interface(): "
"Could not queryInterface() on the control frame");
shell_view = CORBA_OBJECT_NIL;
@@ -464,7 +465,7 @@ control_util_set_folder_bar_label (BonoboControl *control, char *label)
CORBA_exception_init (&ev);
GNOME_Evolution_ShellView_setFolderBarLabel (shell_view, label, &ev);
- if (ev._major != CORBA_NO_EXCEPTION)
+ if (BONOBO_EX (&ev))
g_message ("control_util_set_folder_bar_label(): Could not set the folder bar label");
CORBA_exception_free (&ev);
diff --git a/calendar/gui/comp-editor-factory.c b/calendar/gui/comp-editor-factory.c
index 54f0f00569..805e0a5c0b 100644
--- a/calendar/gui/comp-editor-factory.c
+++ b/calendar/gui/comp-editor-factory.c
@@ -22,6 +22,7 @@
#include <config.h>
#endif
+#include <bonobo/bonobo-exception.h>
#include <evolution-calendar.h>
#include <e-util/e-url.h>
#include <cal-client/cal-client.h>
@@ -589,9 +590,7 @@ lookup_open_client (CompEditorFactory *factory, const char *str_uri, CORBA_Envir
uri = e_uri_new (str_uri);
if (!uri) {
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
- ex_GNOME_Evolution_Calendar_CompEditorFactory_InvalidURI,
- NULL);
+ bonobo_exception_set (ev, ex_GNOME_Evolution_Calendar_CompEditorFactory_InvalidURI);
return NULL;
}
e_uri_free (uri);
@@ -600,10 +599,7 @@ lookup_open_client (CompEditorFactory *factory, const char *str_uri, CORBA_Envir
if (!oc) {
oc = open_client (factory, str_uri);
if (!oc) {
- CORBA_exception_set (
- ev, CORBA_USER_EXCEPTION,
- ex_GNOME_Evolution_Calendar_CompEditorFactory_BackendContactError,
- NULL);
+ bonobo_exception_set (ev, ex_GNOME_Evolution_Calendar_CompEditorFactory_BackendContactError);
return NULL;
}
}
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 0799c6a218..9ff815211e 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -35,6 +35,7 @@
#include <libgnomeui/gnome-dialog.h>
#include <libgnomeui/gnome-dialog-util.h>
#include <liboaf/liboaf.h>
+#include <bonobo/bonobo-exception.h>
#include <gal/e-paned/e-hpaned.h>
#include <gal/e-paned/e-vpaned.h>
#include "e-util/e-url.h"
@@ -1801,7 +1802,7 @@ add_alarms (const char *uri)
CORBA_exception_init (&ev);
an = oaf_activate_from_id ("OAFIID:GNOME_Evolution_Calendar_AlarmNotify", 0, NULL, &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
+ if (BONOBO_EX (&ev)) {
g_message ("add_alarms(): Could not activate the alarm notification service");
CORBA_exception_free (&ev);
return;
@@ -1813,18 +1814,13 @@ add_alarms (const char *uri)
CORBA_exception_init (&ev);
GNOME_Evolution_Calendar_AlarmNotify_addCalendar (an, uri, &ev);
- if (ev._major == CORBA_USER_EXCEPTION) {
- char *ex_id;
-
- ex_id = CORBA_exception_id (&ev);
- if (strcmp (ex_id, ex_GNOME_Evolution_Calendar_AlarmNotify_InvalidURI) == 0)
- g_message ("add_calendar(): Invalid URI reported from the "
- "alarm notification service");
- else if (strcmp (ex_id,
- ex_GNOME_Evolution_Calendar_AlarmNotify_BackendContactError) == 0)
- g_message ("add_calendar(): The alarm notification service could "
- "not contact the backend");
- } else if (ev._major != CORBA_NO_EXCEPTION)
+ if (BONOBO_USER_EX (&ev, ex_GNOME_Evolution_Calendar_AlarmNotify_InvalidURI))
+ g_message ("add_calendar(): Invalid URI reported from the "
+ "alarm notification service");
+ else if (BONOBO_USER_EX (&ev, ex_GNOME_Evolution_Calendar_AlarmNotify_BackendContactError))
+ g_message ("add_calendar(): The alarm notification service could "
+ "not contact the backend");
+ else if (BONOBO_EX (&ev))
g_message ("add_calendar(): Could not issue the addCalendar request");
CORBA_exception_free (&ev);
@@ -1833,7 +1829,7 @@ add_alarms (const char *uri)
CORBA_exception_init (&ev);
bonobo_object_release_unref (an, &ev);
- if (ev._major != CORBA_NO_EXCEPTION)
+ if (BONOBO_EX (&ev))
g_message ("add_alarms(): Could not unref the alarm notification service");
CORBA_exception_free (&ev);
diff --git a/calendar/gui/itip-bonobo-control.c b/calendar/gui/itip-bonobo-control.c
index 54681346cc..d05cee6d9a 100644
--- a/calendar/gui/itip-bonobo-control.c
+++ b/calendar/gui/itip-bonobo-control.c
@@ -30,6 +30,7 @@
#include <bonobo/bonobo-persist-stream.h>
#include <bonobo/bonobo-stream-client.h>
#include <bonobo/bonobo-context.h>
+#include <bonobo/bonobo-exception.h>
#include <ical.h>
#include "e-itip-control.h"
@@ -63,7 +64,7 @@ stream_read (Bonobo_Stream stream)
Bonobo_Stream_read (stream, READ_CHUNK_SIZE,
&buffer, &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
+ if (BONOBO_EX (&ev)) {
CORBA_exception_free (&ev);
return NULL;
}
@@ -101,15 +102,13 @@ pstream_load (BonoboPersistStream *ps, const Bonobo_Stream stream,
gchar *text;
if (type && g_strcasecmp (type, "text/calendar") != 0 &&
- g_strcasecmp (type, "text/x-calendar") != 0) {
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
- ex_Bonobo_Persist_WrongDataType, NULL);
+ g_strcasecmp (type, "text/x-calendar") != 0) {
+ bonobo_exception_set (ev, ex_Bonobo_Persist_WrongDataType);
return;
}
if ((text = stream_read (stream)) == NULL) {
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
- ex_Bonobo_Persist_FileNotFound, NULL);
+ bonobo_exception_set (ev, ex_Bonobo_Persist_FileNotFound);
return;
}
@@ -130,8 +129,7 @@ pstream_save (BonoboPersistStream *ps, const Bonobo_Stream stream,
if (type && g_strcasecmp (type, "text/calendar") != 0 &&
g_strcasecmp (type, "text/x-calendar") != 0) {
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
- ex_Bonobo_Persist_WrongDataType, NULL);
+ bonobo_exception_set (ev, ex_Bonobo_Persist_WrongDataType);
return;
}
diff --git a/calendar/gui/itip-control-factory.c b/calendar/gui/itip-control-factory.c
index 54681346cc..d05cee6d9a 100644
--- a/calendar/gui/itip-control-factory.c
+++ b/calendar/gui/itip-control-factory.c
@@ -30,6 +30,7 @@
#include <bonobo/bonobo-persist-stream.h>
#include <bonobo/bonobo-stream-client.h>
#include <bonobo/bonobo-context.h>
+#include <bonobo/bonobo-exception.h>
#include <ical.h>
#include "e-itip-control.h"
@@ -63,7 +64,7 @@ stream_read (Bonobo_Stream stream)
Bonobo_Stream_read (stream, READ_CHUNK_SIZE,
&buffer, &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
+ if (BONOBO_EX (&ev)) {
CORBA_exception_free (&ev);
return NULL;
}
@@ -101,15 +102,13 @@ pstream_load (BonoboPersistStream *ps, const Bonobo_Stream stream,
gchar *text;
if (type && g_strcasecmp (type, "text/calendar") != 0 &&
- g_strcasecmp (type, "text/x-calendar") != 0) {
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
- ex_Bonobo_Persist_WrongDataType, NULL);
+ g_strcasecmp (type, "text/x-calendar") != 0) {
+ bonobo_exception_set (ev, ex_Bonobo_Persist_WrongDataType);
return;
}
if ((text = stream_read (stream)) == NULL) {
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
- ex_Bonobo_Persist_FileNotFound, NULL);
+ bonobo_exception_set (ev, ex_Bonobo_Persist_FileNotFound);
return;
}
@@ -130,8 +129,7 @@ pstream_save (BonoboPersistStream *ps, const Bonobo_Stream stream,
if (type && g_strcasecmp (type, "text/calendar") != 0 &&
g_strcasecmp (type, "text/x-calendar") != 0) {
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
- ex_Bonobo_Persist_WrongDataType, NULL);
+ bonobo_exception_set (ev, ex_Bonobo_Persist_WrongDataType);
return;
}
diff --git a/calendar/gui/main.c b/calendar/gui/main.c
index b74b1040cd..5c7a2bc08f 100644
--- a/calendar/gui/main.c
+++ b/calendar/gui/main.c
@@ -34,6 +34,7 @@
#include <liboaf/liboaf.h>
#include <bonobo/bonobo-main.h>
#include <bonobo/bonobo-generic-factory.h>
+#include <bonobo/bonobo-exception.h>
#include <gal/widgets/e-cursors.h>
@@ -103,7 +104,7 @@ launch_alarm_daemon (void)
CORBA_exception_init (&ev);
an = oaf_activate_from_id ("OAFIID:GNOME_Evolution_Calendar_AlarmNotify", 0, NULL, &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
+ if (BONOBO_EX (&ev)) {
g_message ("add_alarms(): Could not activate the alarm notification service");
CORBA_exception_free (&ev);
return;
@@ -114,7 +115,7 @@ launch_alarm_daemon (void)
CORBA_exception_init (&ev);
bonobo_object_release_unref (an, &ev);
- if (ev._major != CORBA_NO_EXCEPTION)
+ if (BONOBO_EX (&ev))
g_message ("add_alarms(): Could not unref the alarm notification service");
CORBA_exception_free (&ev);