[nautilus] Add some warning messages
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] Add some warning messages
- Date: Tue, 14 Aug 2012 16:53:02 +0000 (UTC)
commit 9e190c2877e7dc32b57e5ae6b0c0170f75c35b8b
Author: William Jon McCann <jmccann redhat com>
Date: Tue Aug 14 12:46:07 2012 -0400
Add some warning messages
src/nautilus-autorun-software.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/nautilus-autorun-software.c b/src/nautilus-autorun-software.c
index 2794062..d298af0 100644
--- a/src/nautilus-autorun-software.c
+++ b/src/nautilus-autorun-software.c
@@ -251,6 +251,7 @@ main (int argc, char *argv[])
GVolumeMonitor *monitor;
GFile *file;
GMount *mount;
+ GError *error;
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
@@ -259,23 +260,29 @@ main (int argc, char *argv[])
gtk_init (&argc, &argv);
if (argc != 2) {
+ g_print ("Usage: %s mount-uri\n", argv[0]);
goto out;
}
/* instantiate monitor so we get the "unmounted" signal properly */
monitor = g_volume_monitor_get ();
if (monitor == NULL) {
+ g_warning ("Unable to connect to the volume monitor");
goto out;
}
file = g_file_new_for_commandline_arg (argv[1]);
if (file == NULL) {
g_object_unref (monitor);
+ g_warning ("Unable to parse mount URI");
goto out;
}
- mount = g_file_find_enclosing_mount (file, NULL, NULL);
+ error = NULL;
+ mount = g_file_find_enclosing_mount (file, NULL, &error);
if (mount == NULL) {
+ g_warning ("Unable to find device for URI: %s", error->message);
+ g_clear_error (&error);
g_object_unref (file);
g_object_unref (monitor);
goto out;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]