Added exception RollbackDataNotFound Added exception LocationNotFound

2001-08-21  Bradford Hovinen  <hovinen@ximian.com>

	* idl/ConfigArchiver.idl: Added exception RollbackDataNotFound
	Added exception LocationNotFound

	* archive.c (archive_get_current_location_id): Use
	archive_create_location rather than location_new
	(archive_get_current_location_id): Unref the location once we have
	created it

	* archiver-client.c (location_client_load_rollback_data): Don't
	try to parse the XML file if there was an exception

	* bonobo-config-archiver.c (bonobo_config_archiver_new): Make sure
	to release_unref location and archive if aborting
	(bonobo_config_archiver_new): Reinitialize exception structure
	after we have succeeded

	* location.c (location_get_rollback_filename): Recurse on parent
	location if parent_chain is set to TRUE

	* archive.c (impl_ConfigArchiver_Archive_getLocation): Set the
	LocationNotFound exception if the location returned was NULL

	* location.c (impl_ConfigArchiver_Location_getRollbackFilename): Don't try

	* archive.c (impl_ConfigArchiver_Archive_getLocation): Don't try
	to CORBA_Object_duplicate the result if it is NULL
	(archive_get_location): Don't try to cast the result of
	location_open before we know whether it is non-NULL
	(impl_ConfigArchiver_Archive_createLocation): Call
	bonobo_object_from_servant on parent_ref->servant

	* location.c (location_destroy): Remove debugging message; make
	remaining debugging message more enlightening

	* archive.c (archive_get_child_locations): Rename from
	archive_foreach_child_location; rewrite to return a GList of child
	locations
	(impl_ConfigArchiver_Archive_getChildLocations): Use
	archive_get_child_locations
	(archive_destroy): Remove debugging message

	* bonobo-moniker-archiver.c (archive_resolve): Remove debugging
	messages

	* archive.c (archive_get_location): Remove debugging messages

	* config-log.c (dump_log): Remove debugging messages

	* archive.c (archive_foreach_child_location): Build a list first
	and then traverse it to avoid screwing up the tree traversal

	* mouse-properties-capplet.c (apply_settings): Use a CORBA
	exception structure
This commit is contained in:
Bradford Hovinen 2001-08-22 13:56:23 +00:00 committed by Bradford Hovinen (Gdict maintainer)
parent 1b30f14a62
commit b37d7f6897
13 changed files with 174 additions and 94 deletions

View file

@ -2,6 +2,11 @@
* configure.in (ALL_LINGUAS): zh_TW.Big5 -> zh_TW * configure.in (ALL_LINGUAS): zh_TW.Big5 -> zh_TW
2001-08-21 Bradford Hovinen <hovinen@ximian.com>
* idl/ConfigArchiver.idl: Added exception RollbackDataNotFound
Added exception LocationNotFound
2000-08-18 Pablo Saratxaga <pablo@mandrakesoft.com> 2000-08-18 Pablo Saratxaga <pablo@mandrakesoft.com>
* configure.in (ALL_LINGUAS): Added Nynorsk (nn) and Walloon (wa) * configure.in (ALL_LINGUAS): Added Nynorsk (nn) and Walloon (wa)

View file

@ -1,3 +1,53 @@
2001-08-21 Bradford Hovinen <hovinen@ximian.com>
* archive.c (archive_get_current_location_id): Use
archive_create_location rather than location_new
(archive_get_current_location_id): Unref the location once we have
created it
* archiver-client.c (location_client_load_rollback_data): Don't
try to parse the XML file if there was an exception
* bonobo-config-archiver.c (bonobo_config_archiver_new): Make sure
to release_unref location and archive if aborting
(bonobo_config_archiver_new): Reinitialize exception structure
after we have succeeded
* location.c (location_get_rollback_filename): Recurse on parent
location if parent_chain is set to TRUE
* archive.c (impl_ConfigArchiver_Archive_getLocation): Set the
LocationNotFound exception if the location returned was NULL
* location.c (impl_ConfigArchiver_Location_getRollbackFilename): Don't try
* archive.c (impl_ConfigArchiver_Archive_getLocation): Don't try
to CORBA_Object_duplicate the result if it is NULL
(archive_get_location): Don't try to cast the result of
location_open before we know whether it is non-NULL
(impl_ConfigArchiver_Archive_createLocation): Call
bonobo_object_from_servant on parent_ref->servant
* location.c (location_destroy): Remove debugging message; make
remaining debugging message more enlightening
* archive.c (archive_get_child_locations): Rename from
archive_foreach_child_location; rewrite to return a GList of child
locations
(impl_ConfigArchiver_Archive_getChildLocations): Use
archive_get_child_locations
(archive_destroy): Remove debugging message
* bonobo-moniker-archiver.c (archive_resolve): Remove debugging
messages
* archive.c (archive_get_location): Remove debugging messages
* config-log.c (dump_log): Remove debugging messages
* archive.c (archive_foreach_child_location): Build a list first
and then traverse it to avoid screwing up the tree traversal
2001-08-20 Richard Hestilow <hestilow@ximian.com> 2001-08-20 Richard Hestilow <hestilow@ximian.com>
* Makefile.am: Add dependency on CORBA_SOURCE to archiver-client.c. * Makefile.am: Add dependency on CORBA_SOURCE to archiver-client.c.

View file

@ -35,16 +35,6 @@
#include "archive.h" #include "archive.h"
#include "util.h" #include "util.h"
typedef struct _foreach_t foreach_t;
struct _foreach_t
{
Archive *archive;
LocationCB callback;
Location *parent;
gpointer user_data;
};
static GtkObjectClass *parent_class; static GtkObjectClass *parent_class;
enum { enum {
@ -77,7 +67,16 @@ impl_ConfigArchiver_Archive_getLocation (PortableServer_Servant servant,
const CORBA_char *locid, const CORBA_char *locid,
CORBA_Environment *ev) CORBA_Environment *ev)
{ {
return CORBA_Object_duplicate (BONOBO_OBJREF (archive_get_location (ARCHIVE_FROM_SERVANT (servant), locid)), ev); Location *loc;
loc = archive_get_location (ARCHIVE_FROM_SERVANT (servant), locid);
if (loc == NULL) {
bonobo_exception_set (ev, ex_ConfigArchiver_Archive_LocationNotFound);
return CORBA_OBJECT_NIL;
} else {
return CORBA_Object_duplicate (BONOBO_OBJREF (loc), ev);
}
} }
static ConfigArchiver_Location static ConfigArchiver_Location
@ -90,17 +89,11 @@ impl_ConfigArchiver_Archive_createLocation (PortableServer_Servant serva
Location *loc; Location *loc;
loc = archive_create_location (ARCHIVE_FROM_SERVANT (servant), locid, label, loc = archive_create_location (ARCHIVE_FROM_SERVANT (servant), locid, label,
LOCATION (bonobo_object_from_servant (parent_ref))); LOCATION (bonobo_object_from_servant (parent_ref->servant)));
return bonobo_object_dup_ref (BONOBO_OBJREF (loc), ev); return bonobo_object_dup_ref (BONOBO_OBJREF (loc), ev);
} }
static void
build_list_cb (Archive *archive, Location *location, GList **list)
{
*list = g_list_prepend (*list, bonobo_object_dup_ref (BONOBO_OBJREF (location), NULL));
}
static ConfigArchiver_LocationSeq * static ConfigArchiver_LocationSeq *
impl_ConfigArchiver_Archive_getChildLocations (PortableServer_Servant servant, impl_ConfigArchiver_Archive_getChildLocations (PortableServer_Servant servant,
ConfigArchiver_Location location_ref, ConfigArchiver_Location location_ref,
@ -109,7 +102,7 @@ impl_ConfigArchiver_Archive_getChildLocations (PortableServer_Servant servant,
ConfigArchiver_LocationSeq *ret; ConfigArchiver_LocationSeq *ret;
Archive *archive; Archive *archive;
Location *location; Location *location;
GList *locs = NULL, *tmp; GList *locs, *tmp;
guint i = 0; guint i = 0;
archive = ARCHIVE_FROM_SERVANT (servant); archive = ARCHIVE_FROM_SERVANT (servant);
@ -119,14 +112,14 @@ impl_ConfigArchiver_Archive_getChildLocations (PortableServer_Servant servant,
else else
location = LOCATION (bonobo_object_from_servant (location_ref->servant)); location = LOCATION (bonobo_object_from_servant (location_ref->servant));
archive_foreach_child_location (archive, (LocationCB) build_list_cb, location, &locs); locs = archive_get_child_locations (archive, location);
ret = ConfigArchiver_LocationSeq__alloc (); ret = ConfigArchiver_LocationSeq__alloc ();
ret->_length = g_list_length (locs); ret->_length = g_list_length (locs);
ret->_buffer = CORBA_sequence_ConfigArchiver_Location_allocbuf (ret->_length); ret->_buffer = CORBA_sequence_ConfigArchiver_Location_allocbuf (ret->_length);
for (tmp = locs; tmp != NULL; tmp = tmp->next) for (tmp = locs; tmp != NULL; tmp = tmp->next)
ret->_buffer[i++] = tmp->data; ret->_buffer[i++] = CORBA_Object_duplicate (BONOBO_OBJREF (tmp->data), ev);
g_list_free (locs); g_list_free (locs);
return ret; return ret;
@ -171,7 +164,7 @@ impl_ConfigArchiver_Archive__set_currentLocation (PortableServer_Servant serva
location = LOCATION (bonobo_object_from_servant (location_ref->servant)); location = LOCATION (bonobo_object_from_servant (location_ref->servant));
if (location == NULL) if (location == NULL)
/* bonobo_exception_set (ev, ex_ConfigArchiver_Archive_LocationNotFound) */; bonobo_exception_set (ev, ex_ConfigArchiver_Archive_LocationNotFound);
else else
archive_set_current_location (archive, location); archive_set_current_location (archive, location);
} }
@ -398,8 +391,6 @@ archive_destroy (GtkObject *object)
bonobo_object_unref (BONOBO_OBJECT (archive->backend_list)); bonobo_object_unref (BONOBO_OBJECT (archive->backend_list));
GTK_OBJECT_CLASS (parent_class)->destroy (GTK_OBJECT (archive)); GTK_OBJECT_CLASS (parent_class)->destroy (GTK_OBJECT (archive));
DEBUG_MSG ("Exit");
} }
/** /**
@ -415,22 +406,20 @@ Location *
archive_get_location (Archive *archive, archive_get_location (Archive *archive,
const gchar *locid) const gchar *locid)
{ {
Location *loc_obj; BonoboObject *loc_obj;
gchar *tmp; gchar *tmp;
g_return_val_if_fail (archive != NULL, NULL); g_return_val_if_fail (archive != NULL, NULL);
g_return_val_if_fail (IS_ARCHIVE (archive), NULL); g_return_val_if_fail (IS_ARCHIVE (archive), NULL);
g_return_val_if_fail (locid != NULL, NULL); g_return_val_if_fail (locid != NULL, NULL);
DEBUG_MSG ("Enter: %s", locid);
/* Stupid borken glib... */ /* Stupid borken glib... */
tmp = g_strdup (locid); tmp = g_strdup (locid);
loc_obj = g_tree_lookup (archive->locations, tmp); loc_obj = g_tree_lookup (archive->locations, tmp);
g_free (tmp); g_free (tmp);
if (loc_obj == NULL) { if (loc_obj == NULL) {
loc_obj = LOCATION (location_open (archive, locid)); loc_obj = location_open (archive, locid);
if (loc_obj == NULL) if (loc_obj == NULL)
return NULL; return NULL;
@ -438,10 +427,10 @@ archive_get_location (Archive *archive,
g_tree_insert (archive->locations, g_tree_insert (archive->locations,
g_strdup (locid), loc_obj); g_strdup (locid), loc_obj);
} else { } else {
bonobo_object_ref (BONOBO_OBJECT (loc_obj)); bonobo_object_ref (loc_obj);
} }
return loc_obj; return LOCATION (loc_obj);
} }
/** /**
@ -621,17 +610,16 @@ archive_get_current_location_id (Archive *archive)
archive_get_location (archive, archive->current_location_id); archive_get_location (archive, archive->current_location_id);
if (current_location == NULL) { if (current_location == NULL) {
loc = LOCATION loc = archive_create_location (archive, archive->current_location_id,
(location_new (archive, _("Default location"), NULL);
archive->current_location_id,
_("Default location"),
NULL));
if (archive->is_global && if (archive->is_global &&
location_store_full_snapshot (loc) < 0) location_store_full_snapshot (loc) < 0)
{ {
location_delete (loc); location_delete (loc);
return NULL; return NULL;
} }
bonobo_object_unref (BONOBO_OBJECT (loc));
} else { } else {
bonobo_object_unref (BONOBO_OBJECT (current_location)); bonobo_object_unref (BONOBO_OBJECT (current_location));
} }
@ -695,17 +683,6 @@ archive_get_backend_list (Archive *archive)
return archive->backend_list; return archive->backend_list;
} }
static gint
foreach_cb (gchar *key, Location *value, foreach_t *data)
{
if (location_get_parent (value) == data->parent)
data->callback (data->archive, value, data->user_data);
bonobo_object_unref (BONOBO_OBJECT (value));
return 0;
}
/** /**
* archive_foreach_child_location: * archive_foreach_child_location:
* @archive: * @archive:
@ -719,26 +696,46 @@ foreach_cb (gchar *key, Location *value, foreach_t *data)
* NULL. Terminate the iteration if any child returns a nonzero value * NULL. Terminate the iteration if any child returns a nonzero value
**/ **/
void static gint
archive_foreach_child_location (Archive *archive, LocationCB callback, foreach_build_list_cb (gchar *key, Location *value, GList **node)
Location *parent, gpointer data)
{ {
foreach_t f_data; *node = g_list_prepend (*node, value);
return 0;
}
g_return_if_fail (archive != NULL); GList *
g_return_if_fail (IS_ARCHIVE (archive)); archive_get_child_locations (Archive *archive,
Location *parent)
{
GList *list = NULL, *node, *tmp;
Location *loc;
g_return_val_if_fail (archive != NULL, NULL);
g_return_val_if_fail (IS_ARCHIVE (archive), NULL);
load_all_locations (archive); load_all_locations (archive);
f_data.archive = archive;
f_data.callback = callback;
f_data.parent = parent;
f_data.user_data = data;
g_tree_traverse (archive->locations, g_tree_traverse (archive->locations,
(GTraverseFunc) foreach_cb, (GTraverseFunc) foreach_build_list_cb,
G_IN_ORDER, G_IN_ORDER,
&f_data); &list);
node = list;
while (node != NULL) {
loc = node->data;
tmp = node->next;
if (location_get_parent (loc) != parent) {
list = g_list_remove_link (list, node);
g_list_free_1 (node);
bonobo_object_unref (BONOBO_OBJECT (loc));
}
node = tmp;
}
return list;
} }
/* Load and register all the locations for this archive */ /* Load and register all the locations for this archive */

View file

@ -36,7 +36,6 @@
#define IS_ARCHIVE(obj) GTK_CHECK_TYPE (obj, archive_get_type ()) #define IS_ARCHIVE(obj) GTK_CHECK_TYPE (obj, archive_get_type ())
typedef struct _ArchiveClass ArchiveClass; typedef struct _ArchiveClass ArchiveClass;
typedef void (*LocationCB) (Archive *, Location *, gpointer);
struct _Archive struct _Archive
{ {
@ -89,9 +88,7 @@ gboolean archive_is_global (Archive *ar
BackendList *archive_get_backend_list (Archive *archive); BackendList *archive_get_backend_list (Archive *archive);
void archive_foreach_child_location (Archive *archive, GList *archive_get_child_locations (Archive *archive,
LocationCB callback, Location *parent);
Location *parent,
gpointer data);
#endif /* __ARCHIVE */ #endif /* __ARCHIVE */

View file

@ -43,7 +43,7 @@ static xmlNodePtr subtract_xml_node (xmlNodePtr node1,
static gboolean compare_xml_nodes (xmlNodePtr node1, xmlNodePtr node2); static gboolean compare_xml_nodes (xmlNodePtr node1, xmlNodePtr node2);
/** /**
* location_load_rollback_data * location_client_load_rollback_data
* @location: * @location:
* @date: * @date:
* @steps: * @steps:
@ -69,7 +69,6 @@ location_client_load_rollback_data (ConfigArchiver_Location location,
ConfigArchiver_Location parent = CORBA_OBJECT_NIL; ConfigArchiver_Location parent = CORBA_OBJECT_NIL;
CORBA_Environment my_ev; CORBA_Environment my_ev;
g_return_val_if_fail (location != CORBA_OBJECT_NIL, NULL); g_return_val_if_fail (location != CORBA_OBJECT_NIL, NULL);
if (opt_ev == NULL) { if (opt_ev == NULL) {
@ -85,7 +84,7 @@ location_client_load_rollback_data (ConfigArchiver_Location location,
filename = ConfigArchiver_Location_getRollbackFilename filename = ConfigArchiver_Location_getRollbackFilename
(location, time_g, steps, backend_id, parent_chain, opt_ev); (location, time_g, steps, backend_id, parent_chain, opt_ev);
if (filename != NULL) if (!BONOBO_EX (opt_ev) && filename != NULL)
doc = xmlParseFile (filename); doc = xmlParseFile (filename);
else if (parent_chain) else if (parent_chain)
type = ConfigArchiver_Location_contains (location, backend_id, opt_ev); type = ConfigArchiver_Location_contains (location, backend_id, opt_ev);

View file

@ -677,6 +677,7 @@ bonobo_config_archiver_new (Bonobo_Moniker parent,
archiver_db->location = ConfigArchiver_Archive_getLocation (archiver_db->archive, location_id, ev); archiver_db->location = ConfigArchiver_Archive_getLocation (archiver_db->archive, location_id, ev);
if (archiver_db->location == CORBA_OBJECT_NIL) { if (archiver_db->location == CORBA_OBJECT_NIL) {
bonobo_object_release_unref (archiver_db->archive, NULL);
bonobo_object_unref (BONOBO_OBJECT (archiver_db)); bonobo_object_unref (BONOBO_OBJECT (archiver_db));
return CORBA_OBJECT_NIL; return CORBA_OBJECT_NIL;
} }
@ -687,7 +688,7 @@ bonobo_config_archiver_new (Bonobo_Moniker parent,
archiver_db->doc = location_client_load_rollback_data archiver_db->doc = location_client_load_rollback_data
(archiver_db->location, NULL, 0, archiver_db->backend_id, TRUE, ev); (archiver_db->location, NULL, 0, archiver_db->backend_id, TRUE, ev);
if (archiver_db->doc == NULL) { if (BONOBO_EX (ev) || archiver_db->doc == NULL) {
gchar *filename; gchar *filename;
filename = g_strconcat (DEFAULTS_DIR, "/", archiver_db->backend_id, ".xml", NULL); filename = g_strconcat (DEFAULTS_DIR, "/", archiver_db->backend_id, ".xml", NULL);
@ -695,9 +696,13 @@ bonobo_config_archiver_new (Bonobo_Moniker parent,
g_free (filename); g_free (filename);
if (archiver_db->doc == NULL) { if (archiver_db->doc == NULL) {
bonobo_object_release_unref (archiver_db->location, NULL);
bonobo_object_release_unref (archiver_db->archive, NULL);
bonobo_object_unref (BONOBO_OBJECT (archiver_db)); bonobo_object_unref (BONOBO_OBJECT (archiver_db));
return CORBA_OBJECT_NIL; return CORBA_OBJECT_NIL;
} }
CORBA_exception_init (ev);
} }
if (archiver_db->doc->root == NULL) if (archiver_db->doc->root == NULL)

View file

@ -76,8 +76,6 @@ archive_resolve (BonoboMoniker *moniker,
Bonobo_Unknown ret; Bonobo_Unknown ret;
DEBUG_MSG ("Enter");
if (strcmp (requested_interface, "IDL:ConfigArchiver/Archive:1.0")) { if (strcmp (requested_interface, "IDL:ConfigArchiver/Archive:1.0")) {
EX_SET_NOT_FOUND (ev); EX_SET_NOT_FOUND (ev);
return CORBA_OBJECT_NIL; return CORBA_OBJECT_NIL;
@ -86,8 +84,6 @@ archive_resolve (BonoboMoniker *moniker,
name = bonobo_moniker_get_name (moniker); name = bonobo_moniker_get_name (moniker);
if (!strcmp (name, "global-archive")) { if (!strcmp (name, "global-archive")) {
DEBUG_MSG ("Global archive requested");
if (global_archive == NULL) { if (global_archive == NULL) {
global_archive = ARCHIVE (archive_load (TRUE)); global_archive = ARCHIVE (archive_load (TRUE));
gtk_signal_connect (GTK_OBJECT (global_archive), "destroy", GTK_SIGNAL_FUNC (archive_destroy_cb), NULL); gtk_signal_connect (GTK_OBJECT (global_archive), "destroy", GTK_SIGNAL_FUNC (archive_destroy_cb), NULL);
@ -121,8 +117,6 @@ archive_resolve (BonoboMoniker *moniker,
ret = CORBA_OBJECT_NIL; ret = CORBA_OBJECT_NIL;
} }
DEBUG_MSG ("Exit");
return ret; return ret;
} }
@ -160,11 +154,11 @@ archiverdb_resolve (BonoboMoniker *moniker,
db = bonobo_config_archiver_new (parent, options, backend_id, locid, ev); db = bonobo_config_archiver_new (parent, options, backend_id, locid, ev);
bonobo_object_release_unref (parent, NULL);
if (db == CORBA_OBJECT_NIL || BONOBO_EX (ev)) if (db == CORBA_OBJECT_NIL || BONOBO_EX (ev))
EX_SET_NOT_FOUND (ev); EX_SET_NOT_FOUND (ev);
bonobo_object_release_unref (parent, NULL);
g_free (backend_id); g_free (backend_id);
g_free (locid); g_free (locid);

View file

@ -970,8 +970,6 @@ dump_log (ConfigLog *config_log)
GList *first; GList *first;
FILE *input, *output; FILE *input, *output;
DEBUG_MSG ("Enter");
g_return_if_fail (config_log != NULL); g_return_if_fail (config_log != NULL);
g_return_if_fail (IS_CONFIG_LOG (config_log)); g_return_if_fail (IS_CONFIG_LOG (config_log));
g_return_if_fail (config_log->p->location != NULL); g_return_if_fail (config_log->p->location != NULL);
@ -1010,8 +1008,6 @@ dump_log (ConfigLog *config_log)
if (config_log->p->filename) if (config_log->p->filename)
rename (filename_out, config_log->p->filename); rename (filename_out, config_log->p->filename);
DEBUG_MSG ("Exit");
} }
/* Return TRUE if the config log has entries made by actual configuration /* Return TRUE if the config log has entries made by actual configuration

View file

@ -160,8 +160,14 @@ impl_ConfigArchiver_Location_getRollbackFilename (PortableServer_Servant servan
timeb_p = NULL; timeb_p = NULL;
filename = location_get_rollback_filename (LOCATION_FROM_SERVANT (servant), timeb_p, steps, backendId, parentChain); filename = location_get_rollback_filename (LOCATION_FROM_SERVANT (servant), timeb_p, steps, backendId, parentChain);
ret = CORBA_string_dup (filename);
g_free (filename); if (filename != NULL) {
ret = CORBA_string_dup (filename);
g_free (filename);
} else {
ret = NULL;
bonobo_exception_set (ev, ex_ConfigArchiver_Location_RollbackDataNotFound);
}
return ret; return ret;
} }
@ -580,10 +586,10 @@ location_destroy (GtkObject *object)
g_return_if_fail (object != NULL); g_return_if_fail (object != NULL);
g_return_if_fail (IS_LOCATION (object)); g_return_if_fail (IS_LOCATION (object));
DEBUG_MSG ("Enter");
location = LOCATION (object); location = LOCATION (object);
DEBUG_MSG ("Enter: %s", location->p->locid);
save_metadata (location); save_metadata (location);
if (location->p->config_log) if (location->p->config_log)
@ -597,8 +603,6 @@ location_destroy (GtkObject *object)
bonobo_object_unref (BONOBO_OBJECT (location->p->archive)); bonobo_object_unref (BONOBO_OBJECT (location->p->archive));
GTK_OBJECT_CLASS (parent_class)->destroy (object); GTK_OBJECT_CLASS (parent_class)->destroy (object);
DEBUG_MSG ("Exit");
} }
static void static void
@ -818,6 +822,9 @@ location_get_rollback_filename (Location *location,
if (id != -1) if (id != -1)
return g_strdup_printf ("%s/%08x.xml", location->p->fullpath, id); return g_strdup_printf ("%s/%08x.xml", location->p->fullpath, id);
else if (parent_chain && location->p->parent != NULL)
return location_get_rollback_filename
(location->p->parent, date, steps, backend_id, parent_chain);
else else
return NULL; return NULL;
} }

View file

@ -1,3 +1,8 @@
2001-08-21 Bradford Hovinen <hovinen@ximian.com>
* mouse-properties-capplet.c (apply_settings): Use a CORBA
exception structure
2001-07-31 Chema Celorio <chema@celorio.com> 2001-07-31 Chema Celorio <chema@celorio.com>
* Makefile.am (cappletname): add DISTDIR to install-data-local * Makefile.am (cappletname): add DISTDIR to install-data-local

View file

@ -56,8 +56,11 @@ apply_settings (Bonobo_ConfigDatabase db)
int nbuttons, num, max, den; int nbuttons, num, max, den;
ulong accel, threshold; ulong accel, threshold;
gboolean rtol; gboolean rtol;
CORBA_Environment ev;
rtol = bonobo_config_get_ulong (db, "/main/right-to-left", NULL); CORBA_exception_init (&ev);
rtol = bonobo_config_get_ulong (db, "/main/right-to-left", &ev);
nbuttons = XGetPointerMapping (GDK_DISPLAY (), buttons, MAX_BUTTONS); nbuttons = XGetPointerMapping (GDK_DISPLAY (), buttons, MAX_BUTTONS);
max = MIN (nbuttons, 3); max = MIN (nbuttons, 3);
@ -66,7 +69,9 @@ apply_settings (Bonobo_ConfigDatabase db)
XSetPointerMapping (GDK_DISPLAY (), buttons, nbuttons); XSetPointerMapping (GDK_DISPLAY (), buttons, nbuttons);
accel = bonobo_config_get_ulong (db, "/main/acceleration", NULL); CORBA_exception_init (&ev);
accel = bonobo_config_get_ulong (db, "/main/acceleration", &ev);
if (accel < MAX_ACCEL) { if (accel < MAX_ACCEL) {
num = 1; num = 1;
@ -76,10 +81,14 @@ apply_settings (Bonobo_ConfigDatabase db)
den = 1; den = 1;
} }
threshold = MAX_THRESH - bonobo_config_get_ulong (db, "/main/threshold", NULL); CORBA_exception_init (&ev);
threshold = MAX_THRESH - bonobo_config_get_ulong (db, "/main/threshold", &ev);
XChangePointerControl (GDK_DISPLAY (), True, True, XChangePointerControl (GDK_DISPLAY (), True, True,
num, den, threshold); num, den, threshold);
CORBA_exception_free (&ev);
} }
/* set_pixmap_file /* set_pixmap_file

View file

@ -56,8 +56,11 @@ apply_settings (Bonobo_ConfigDatabase db)
int nbuttons, num, max, den; int nbuttons, num, max, den;
ulong accel, threshold; ulong accel, threshold;
gboolean rtol; gboolean rtol;
CORBA_Environment ev;
rtol = bonobo_config_get_ulong (db, "/main/right-to-left", NULL); CORBA_exception_init (&ev);
rtol = bonobo_config_get_ulong (db, "/main/right-to-left", &ev);
nbuttons = XGetPointerMapping (GDK_DISPLAY (), buttons, MAX_BUTTONS); nbuttons = XGetPointerMapping (GDK_DISPLAY (), buttons, MAX_BUTTONS);
max = MIN (nbuttons, 3); max = MIN (nbuttons, 3);
@ -66,7 +69,9 @@ apply_settings (Bonobo_ConfigDatabase db)
XSetPointerMapping (GDK_DISPLAY (), buttons, nbuttons); XSetPointerMapping (GDK_DISPLAY (), buttons, nbuttons);
accel = bonobo_config_get_ulong (db, "/main/acceleration", NULL); CORBA_exception_init (&ev);
accel = bonobo_config_get_ulong (db, "/main/acceleration", &ev);
if (accel < MAX_ACCEL) { if (accel < MAX_ACCEL) {
num = 1; num = 1;
@ -76,10 +81,14 @@ apply_settings (Bonobo_ConfigDatabase db)
den = 1; den = 1;
} }
threshold = MAX_THRESH - bonobo_config_get_ulong (db, "/main/threshold", NULL); CORBA_exception_init (&ev);
threshold = MAX_THRESH - bonobo_config_get_ulong (db, "/main/threshold", &ev);
XChangePointerControl (GDK_DISPLAY (), True, True, XChangePointerControl (GDK_DISPLAY (), True, True,
num, den, threshold); num, den, threshold);
CORBA_exception_free (&ev);
} }
/* set_pixmap_file /* set_pixmap_file

View file

@ -57,6 +57,8 @@ module ConfigArchiver {
}; };
interface Location : Bonobo::Unknown { interface Location : Bonobo::Unknown {
exception RollbackDataNotFound {};
readonly attribute Location parent; readonly attribute Location parent;
readonly attribute string path; readonly attribute string path;
readonly attribute StringSeq backendList; readonly attribute StringSeq backendList;
@ -70,7 +72,8 @@ module ConfigArchiver {
string getRollbackFilename (in Time time, string getRollbackFilename (in Time time,
in long steps, in long steps,
in string backendId, in string backendId,
in boolean parentChain); in boolean parentChain)
raises (RollbackDataNotFound);
void rollbackBackends (in Time time, void rollbackBackends (in Time time,
in long steps, in long steps,
@ -95,6 +98,8 @@ module ConfigArchiver {
typedef sequence<Location> LocationSeq; typedef sequence<Location> LocationSeq;
interface Archive : Bonobo::Unknown { interface Archive : Bonobo::Unknown {
exception LocationNotFound {};
readonly attribute string prefix; readonly attribute string prefix;
readonly attribute boolean isGlobal; readonly attribute boolean isGlobal;
readonly attribute BackendList backendList; readonly attribute BackendList backendList;
@ -102,7 +107,9 @@ module ConfigArchiver {
attribute Location currentLocation; attribute Location currentLocation;
attribute string currentLocationId; attribute string currentLocationId;
Location getLocation (in string locid); Location getLocation (in string locid)
raises (LocationNotFound);
Location createLocation (in string locid, Location createLocation (in string locid,
in string label, in string label,
in Location parent); in Location parent);