summaryrefslogtreecommitdiff
path: root/src/nautilus-autorun-software.c
diff options
context:
space:
mode:
authorWilliam Jon McCann <jmccann@redhat.com>2012-08-14 12:46:07 -0400
committerWilliam Jon McCann <jmccann@redhat.com>2012-08-14 12:52:51 -0400
commit9e190c2877e7dc32b57e5ae6b0c0170f75c35b8b (patch)
tree8d05fbbfeadbe64d21cdc810e4171dd84a2a92a5 /src/nautilus-autorun-software.c
parentefa6746816830f1e132220d0d70db40844f6186c (diff)
downloadnautilus-9e190c2877e7dc32b57e5ae6b0c0170f75c35b8b.tar.gz
Add some warning messages
Diffstat (limited to 'src/nautilus-autorun-software.c')
-rw-r--r--src/nautilus-autorun-software.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nautilus-autorun-software.c b/src/nautilus-autorun-software.c
index 279406287..d298af014 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;