Catch GConf errors, fixes compilation warnings
[cinaest] / src / poster / movie-poster-factory.vala
index 095af92..41001d2 100644 (file)
@@ -42,9 +42,13 @@ namespace MoviePoster {
                        }
                        gc = GConf.Client.get_default ();
 
-                       download_posters = gc.get_bool ("/apps/cinaest/download_posters");
-                       gc.add_dir ("/apps/cinaest", GConf.ClientPreloadType.ONELEVEL);
-                       cxnid = gc.notify_add ("/apps/cinaest/download_posters", on_download_posters_changed);
+                       try {
+                               download_posters = gc.get_bool ("/apps/cinaest/download_posters");
+                               gc.add_dir ("/apps/cinaest", GConf.ClientPreloadType.ONELEVEL);
+                               cxnid = gc.notify_add ("/apps/cinaest/download_posters", on_download_posters_changed);
+                       } catch (Error e) {
+                               stdout.printf ("Error installing GConf notification: %s\n", e.message);
+                       }
                }
 
                private static void on_download_posters_changed (GConf.Client gc, uint cxnid, GConf.Entry entry) {