[totem] zeitgeist-dp: Fix some Vala warnings



commit 5bcea1ce13a3d7c37cad8a163f16cb2129e49025
Author: Philip Withnall <philip tecnocode co uk>
Date:   Mon Sep 30 13:12:48 2013 +0100

    zeitgeist-dp: Fix some Vala warnings
    
    Use explicit .begin()/.end() for an async call, and handle a GError
    which wasn’t previously handled.

 .../zeitgeist-dp/totem-zeitgeist-dp-plugin.vala    |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/zeitgeist-dp/totem-zeitgeist-dp-plugin.vala 
b/src/plugins/zeitgeist-dp/totem-zeitgeist-dp-plugin.vala
index f5b8649..dfa1afe 100644
--- a/src/plugins/zeitgeist-dp/totem-zeitgeist-dp-plugin.vala
+++ b/src/plugins/zeitgeist-dp/totem-zeitgeist-dp-plugin.vala
@@ -178,7 +178,9 @@ class ZeitgeistDpPlugin: GLib.Object, Peas.Activatable {
       current_media.interpretation = val.get_boolean () ?
         Zeitgeist.NFO.VIDEO : Zeitgeist.NFO.AUDIO;
 
-      query_media_mimetype (current_media.mrl);
+      query_media_mimetype.begin (current_media.mrl, (o, r) => {
+        query_media_mimetype.end (r);
+      });
 
       /* cleanup timers */
       if (timeout_id != 0) Source.remove (timeout_id);
@@ -228,7 +230,12 @@ class ZeitgeistDpPlugin: GLib.Object, Peas.Activatable {
       event.add_subject (subject);
       events.add (event);
       event.timestamp = current_media.timestamp;
-      zg_log.insert_events_no_reply (events);
+
+      try {
+        zg_log.insert_events_no_reply (events);
+      } catch (GLib.Error e1) {
+        warning ("Error sending event to Zeitgeist: %s", e1.message);
+      }
     }
   }
 }


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