[totem] zeitgeist-dp: Use file-has-played signal



commit 5b704efc59fe833f2273d72ea373b3f730ae4324
Author: Bastien Nocera <hadess hadess net>
Date:   Sat Jul 14 23:10:21 2012 +0100

    zeitgeist-dp: Use file-has-played signal
    
    Instead of the file-opened one, so that only files that are really
    opened and played get added.

 .../zeitgeist-dp/totem-zeitgeist-dp-plugin.vala    |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/plugins/zeitgeist-dp/totem-zeitgeist-dp-plugin.vala b/src/plugins/zeitgeist-dp/totem-zeitgeist-dp-plugin.vala
index 086259d..043dab6 100644
--- a/src/plugins/zeitgeist-dp/totem-zeitgeist-dp-plugin.vala
+++ b/src/plugins/zeitgeist-dp/totem-zeitgeist-dp-plugin.vala
@@ -32,8 +32,8 @@ class ZeitgeistDpPlugin: GLib.Object, Peas.Activatable {
 
     current_media = MediaInfo ();
 
-    signals += Signal.connect_swapped (totem, "file-opened",
-                                       (Callback) file_opened, this);
+    signals += Signal.connect_swapped (totem, "file-has-played",
+                                       (Callback) file_has_played, this);
     signals += Signal.connect_swapped (totem, "file-closed",
                                        (Callback)file_closed, this);
     signals += Signal.connect_swapped (totem, "metadata-updated",
@@ -84,11 +84,9 @@ class ZeitgeistDpPlugin: GLib.Object, Peas.Activatable {
     timeout_id = Timeout.add (interval, timeout_cb);
   }
 
-  private void file_opened (string mrl, Totem.Object totem) {
-    if (current_media.mrl != null) {
-      /* we don't always get file-closed, so lets simulate it */
+  private void file_has_played (string mrl, Totem.Object totem) {
+    if (current_media.mrl != null)
       file_closed (totem);
-    }
 
     current_media = MediaInfo ();
     current_media.mrl = mrl;



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