[nautilus-sendto] Make nautilus_sendto_plugin_init() fail properly
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-sendto] Make nautilus_sendto_plugin_init() fail properly
- Date: Mon, 23 Aug 2010 15:42:45 +0000 (UTC)
commit ffe1152c5c787d3460d19aef56a788a655a50c76
Author: Bastien Nocera <hadess hadess net>
Date: Fri Aug 20 17:48:44 2010 +0100
Make nautilus_sendto_plugin_init() fail properly
If we fail to load the introspection data, exit out.
src/nautilus-sendto-command.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-sendto-command.c b/src/nautilus-sendto-command.c
index e297772..cc9912e 100644
--- a/src/nautilus-sendto-command.c
+++ b/src/nautilus-sendto-command.c
@@ -380,20 +380,21 @@ nautilus_sendto_plugin_load_all (void)
g_ptr_array_free (activate, TRUE);
}
-static void
+static gboolean
nautilus_sendto_plugin_init (void)
{
GPtrArray *search_paths;
char **paths, *user_dir;
- /* FIXME error out properly */
if (g_irepository_require (g_irepository_get_default (), "Peas", "1.0", 0, NULL) == NULL) {
g_warning ("Failed to load Peas bindings");
+ return FALSE;
}
if (run_from_build_dir)
g_irepository_prepend_search_path ("plugins/");
if (g_irepository_require (g_irepository_get_default (), "NautilusSendto", "1.0", 0, NULL) == NULL) {
g_warning ("Failed to load NautilusSendto bindings");
+ return FALSE;
}
search_paths = g_ptr_array_new ();
@@ -429,6 +430,8 @@ nautilus_sendto_plugin_init (void)
/* Load all the plugins now */
nautilus_sendto_plugin_load_all ();
+
+ return TRUE;
}
static char *
@@ -581,7 +584,8 @@ int main (int argc, char **argv)
settings = g_settings_new ("org.gnome.Nautilus.Sendto");
nautilus_sendto_init ();
- nautilus_sendto_plugin_init ();
+ if (nautilus_sendto_plugin_init () == FALSE)
+ return 1;
nautilus_sendto_create_ui ();
gtk_main ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]