Manish Sinha (मनीष सिन्हा) has proposed merging 
lp:~zeitgeist/unity-lens-applications/fix-1196822-port-to-libzeitgeist2 into 
lp:unity-lens-applications.

Requested reviews:
  Unity Team (unity-team)
Related bugs:
  Bug #1196822 in unity-lens-applications: "Port unity-lens-applications to 
libzeitgeist2"
  https://bugs.launchpad.net/unity-lens-applications/+bug/1196822

For more details, see:
https://code.launchpad.net/~zeitgeist/unity-lens-applications/fix-1196822-port-to-libzeitgeist2/+merge/172475

Fixes LP #1196822 by porting unity-lens-applications to libzeitgeist2 and 
updated debian/control with proper build-dep

(PS - Signed contributor's license)
-- 
https://code.launchpad.net/~zeitgeist/unity-lens-applications/fix-1196822-port-to-libzeitgeist2/+merge/172475
Your team Zeitgeist Framework Team is subscribed to branch 
lp:~zeitgeist/unity-lens-applications/fix-1196822-port-to-libzeitgeist2.
=== modified file 'configure.ac'
--- configure.ac	2013-05-16 21:13:36 +0000
+++ configure.ac	2013-07-02 07:32:32 +0000
@@ -74,7 +74,7 @@
                   gio-unix-2.0 >= $GLIB_REQUIRED
                   gee-1.0
                   dee-1.0 >= 0.5.16
-                  zeitgeist-1.0 >= 0.3.8
+                  zeitgeist-2.0 >= 0.9.12
                   libcolumbus0 >= 0.4.0
                   unity >= 7.0.0
                   unity-protocol-private

=== modified file 'debian/control'
--- debian/control	2013-06-08 21:35:34 +0000
+++ debian/control	2013-07-02 07:32:32 +0000
@@ -10,7 +10,7 @@
                libglib2.0-dev (>= 2.27),
                libgee-dev,
                libdee-dev (>= 0.5.16),
-               libzeitgeist-dev (>= 0.3.8),
+               libzeitgeist-2.0-dev (>= 0.9.12),
                libunity-dev (>= 7.0.0),
                libgnome-menu-3-dev,
                dh-autoreconf,

=== modified file 'src/Makefile.am'
--- src/Makefile.am	2013-05-16 11:37:05 +0000
+++ src/Makefile.am	2013-07-02 07:32:32 +0000
@@ -33,7 +33,7 @@
   --pkg gio-2.0 \
   --pkg gio-unix-2.0 \
   --pkg dee-1.0 \
-  --pkg zeitgeist-1.0 \
+  --pkg zeitgeist-2.0 \
   --pkg unity \
   --pkg unity-protocol \
   --pkg gee-1.0 \

=== modified file 'src/daemon.vala'
--- src/daemon.vala	2013-07-01 12:17:01 +0000
+++ src/daemon.vala	2013-07-02 07:32:32 +0000
@@ -101,7 +101,7 @@
     private Unity.LauncherFavorites favorite_apps;
     private AppWatcher app_watcher;
 
-    private PtrArray zg_templates;
+    private GenericArray<Event> zg_templates;
 
     /* Gnome menu structure - also used to check whether apps are installed */
     private uint app_menu_changed_reindex_timeout = 0;
@@ -467,13 +467,13 @@
     private void populate_zg_templates ()
     {
       /* Create a template that activation of applications */
-      zg_templates = new PtrArray.sized(1);
-      var ev = new Zeitgeist.Event.full (ZG_ACCESS_EVENT, ZG_USER_ACTIVITY, "",
-                             new Subject.full ("application*",
-                                               "", //NFO_SOFTWARE,
-                                               "",
-                                               "", "", "", ""));
-      zg_templates.add ((ev as GLib.Object).ref());
+      zg_templates = new GenericArray<Event>();
+      var ev = new Zeitgeist.Event.full (ZG.ACCESS_EVENT, ZG.USER_ACTIVITY, "","");
+      ev.add_subject(new Subject.full ("application*",
+                                       "", //NFO.SOFTWARE,
+                                       "",
+                                       "", "", "", ""));
+      zg_templates.add (ev);
     }
 
     private void mark_dirty ()
@@ -487,7 +487,7 @@
       try
       {
         // simulate a kind of frecency
-        var end_ts = Timestamp.now ();
+        var end_ts = Timestamp.from_now ();
         var start_ts = end_ts - Timestamp.WEEK * 3;
         var rs = yield log.find_events (new TimeRange (start_ts, end_ts),
                                         zg_templates,
@@ -499,11 +499,11 @@
         // most popular apps must have high value, so unknown apps (where
         // popularity_map[app] == 0 aren't considered super popular
         int relevancy = 256;
-        foreach (unowned Event event in rs)
+        foreach (Event event in rs)
         {
           for (int i = 0; i < event.num_subjects (); i++)
           {
-            unowned string uri = event.get_subject (i).get_uri ();
+            string uri = event.get_subject (i).uri;
             if (uri == null) continue;
             popularity_map[uri] = relevancy;
           }
@@ -1846,7 +1846,7 @@
       {
         string? app_uri = null;
         if (ev.num_subjects () > 0)
-          app_uri = ev.get_subject (0).get_uri ();
+          app_uri = ev.get_subject (0).uri;
 
         if (app_uri == null)
         {

_______________________________________________
Mailing list: https://launchpad.net/~zeitgeist
Post to     : zeitgeist@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zeitgeist
More help   : https://help.launchpad.net/ListHelp

Reply via email to