]> spindle.queued.net Git - midori/commitdiff
Don't connect to a monitor that wasn't created in the first place
authorAdrian Bunk <bunk@stusta.de>
Tue, 15 Sep 2009 19:04:29 +0000 (21:04 +0200)
committerChristian Dywan <christian@twotoasts.de>
Tue, 15 Sep 2009 19:04:29 +0000 (21:04 +0200)
panels/midori-addons.c

index cd2d057ab93287a5d033e94db79774d7d8fa8862..db30288c921d4a79f49253c2c3f28d1a555f6bfd 100644 (file)
@@ -917,14 +917,15 @@ midori_addons_new (MidoriAddonKind kind,
         monitor = g_file_monitor_directory (directory,
                                             G_FILE_MONITOR_NONE,
                                             NULL, &error);
-        if (!monitor)
+        if (monitor)
+            g_signal_connect (monitor, "changed",
+                G_CALLBACK (midori_addons_directory_monitor_changed), addons);
+        else
         {
-            g_warning ("could not monitor %s: %s", g_file_get_parse_name (directory),
-                       error->message);
+            g_warning (_("Can't monitor folder '%s': %s"),
+                       g_file_get_parse_name (directory), error->message);
             g_error_free (error);
         }
-        g_signal_connect (monitor, "changed",
-            G_CALLBACK (midori_addons_directory_monitor_changed), addons);
         g_object_unref (directory);
     }
     g_slist_free (list);