[gnome-clocks: 1/2] general: Resolve error handling warnings



commit db68926806b39c919c104fb0940d20007957bf70
Author: Zander Brown <zbrown gnome org>
Date:   Thu Aug 8 16:30:55 2019 +0100

    general: Resolve error handling warnings
    
    Simple changes that make the build quieter

 src/search-provider.vala | 12 ++++++------
 src/world.vala           | 20 ++++++++++++--------
 2 files changed, 18 insertions(+), 14 deletions(-)
---
diff --git a/src/search-provider.vala b/src/search-provider.vala
index f9d3d83..4593743 100644
--- a/src/search-provider.vala
+++ b/src/search-provider.vala
@@ -69,7 +69,7 @@ public class SearchProvider : Object {
     }
 
     private async void search_locations_recurse (GWeather.Location location, string[] normalized_terms,
-                                                 GenericArray<GWeather.Location> matches) {
+                                                    GenericArray<GWeather.Location> matches) {
         GWeather.Location? []locations = location.get_children ();
         if (locations != null) {
             for (int i = 0; i < locations.length; i++) {
@@ -106,11 +106,11 @@ public class SearchProvider : Object {
         return result;
     }
 
-    public async string[] get_initial_result_set (string[] terms) {
+    public async string[] get_initial_result_set (string[] terms) throws GLib.DBusError, GLib.IOError {
         return yield search_locations (normalize_terms (terms));
     }
 
-    public async string[] get_subsearch_result_set (string[] previous_results, string[] terms) {
+    public async string[] get_subsearch_result_set (string[] previous_results, string[] terms) throws 
GLib.DBusError, GLib.IOError {
         var normalized_terms = normalize_terms (terms);
 
         if (previous_results.length == 0) {
@@ -129,7 +129,7 @@ public class SearchProvider : Object {
         return result;
     }
 
-    public HashTable<string, Variant>[] get_result_metas (string[] results) {
+    public HashTable<string, Variant>[] get_result_metas (string[] results) throws GLib.DBusError, 
GLib.IOError {
         var result = new GenericArray<HashTable<string, Variant>> ();
         int count = 0;
 
@@ -158,11 +158,11 @@ public class SearchProvider : Object {
         return result.data;
     }
 
-    public void activate_result (string result, string[] terms, uint32 timestamp) {
+    public void activate_result (string result, string[] terms, uint32 timestamp) throws GLib.DBusError, 
GLib.IOError {
         activate (timestamp);
     }
 
-    public void launch_search (string[] terms, uint32 timestamp) {
+    public void launch_search (string[] terms, uint32 timestamp) throws GLib.DBusError, GLib.IOError {
     }
 }
 
diff --git a/src/world.vala b/src/world.vala
index b472495..219b99a 100644
--- a/src/world.vala
+++ b/src/world.vala
@@ -51,14 +51,18 @@ public class ShellWorldClocks : Object {
             Variant v = locations;
             builder.add ("{sv}", "Locations", v);
 
-            this.connection.emit_signal (null,
-                                         this.object_path,
-                                         "org.freedesktop.DBus.Properties",
-                                         "PropertiesChanged",
-                                         new Variant ("(sa{sv}as)",
-                                                      "org.gnome.Shell.ClocksIntegration",
-                                                      builder,
-                                                      invalid_builder));
+            try {
+                this.connection.emit_signal (null,
+                                            this.object_path,
+                                            "org.freedesktop.DBus.Properties",
+                                            "PropertiesChanged",
+                                            new Variant ("(sa{sv}as)",
+                                                        "org.gnome.Shell.ClocksIntegration",
+                                                        builder,
+                                                        invalid_builder));
+            } catch (Error e) {
+                warning ("Shell Integration failed: %s", e.message);
+            }
         });
     }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]