zeitgeist team mailing list archive
-
zeitgeist team
-
Mailing list archive
-
Message #05674
lp:~zeitgeist/unity-lens-video/fix-1196878-port-to-libzeitgeist2 into lp:unity-lens-video
Manish Sinha (मनीष सिन्हा) has proposed merging lp:~zeitgeist/unity-lens-video/fix-1196878-port-to-libzeitgeist2 into lp:unity-lens-video.
Requested reviews:
Unity Videos lens (unity-lens-videos)
Related bugs:
Bug #1196878 in Unity Videos Lens: "Port Unity Lens Video to libzeitgeist2"
https://bugs.launchpad.net/unity-lens-video/+bug/1196878
For more details, see:
https://code.launchpad.net/~zeitgeist/unity-lens-video/fix-1196878-port-to-libzeitgeist2/+merge/172511
Fixes LP #1196878 where the lens is ported to libzeitgeist2
(PS: Already signed contributor's agreement)
--
https://code.launchpad.net/~zeitgeist/unity-lens-video/fix-1196878-port-to-libzeitgeist2/+merge/172511
Your team Zeitgeist Framework Team is subscribed to branch lp:~zeitgeist/unity-lens-video/fix-1196878-port-to-libzeitgeist2.
=== modified file 'configure.ac'
--- configure.ac 2013-05-16 11:33:59 +0000
+++ configure.ac 2013-07-02 09:35:32 +0000
@@ -75,7 +75,7 @@
gee-1.0
libsoup-gnome-2.4
json-glib-1.0
- zeitgeist-1.0 >= 0.3.8
+ zeitgeist-2.0 >= 0.9.12
unity >= 7.0.0
unity-extras >= 6.91.11
)
=== modified file 'debian/control'
--- debian/control 2013-06-20 16:13:54 +0000
+++ debian/control 2013-07-02 09:35:32 +0000
@@ -12,7 +12,7 @@
libjson-glib-dev,
libsoup-gnome2.4-dev,
libunity-dev (>= 7.0.0),
- libzeitgeist-dev (>= 0.3.8),
+ libzeitgeist-2.0-dev (>= 0.9.12),
valac-0.18,
xvfb,
Standards-Version: 3.9.4
=== modified file 'src/Makefile.am'
--- src/Makefile.am 2013-06-20 16:13:59 +0000
+++ src/Makefile.am 2013-07-02 09:35:32 +0000
@@ -43,7 +43,7 @@
--pkg gio-unix-2.0 \
--pkg glib-2.0 \
--pkg gee-1.0 \
- --pkg zeitgeist-1.0 \
+ --pkg zeitgeist-2.0 \
--vapidir $(srcdir) \
--vapidir $(top_srcdir)/vapi \
--target-glib=2.26 \
@@ -59,7 +59,7 @@
--pkg gio-unix-2.0 \
--pkg glib-2.0 \
--pkg gee-1.0 \
- --pkg zeitgeist-1.0 \
+ --pkg zeitgeist-2.0 \
--pkg libsoup-gnome-2.4 \
--pkg libsoup-2.4 \
--pkg json-glib-1.0 \
=== modified file 'src/blacklist-tracker.vala'
--- src/blacklist-tracker.vala 2012-11-19 11:00:54 +0000
+++ src/blacklist-tracker.vala 2013-07-02 09:35:32 +0000
@@ -101,8 +101,8 @@
{
if (e.num_subjects () > 0)
{
- unowned Subject s = e.get_subject (0);
- unowned string uri = s.get_uri ();
+ Subject s = e.get_subject (0);
+ unowned string uri = s.uri;
if (uri == null || uri == "") continue;
if (uri.has_suffix ("*"))
=== modified file 'src/remote-scope.vala'
--- src/remote-scope.vala 2013-06-20 16:13:59 +0000
+++ src/remote-scope.vala 2013-07-02 09:35:32 +0000
@@ -19,6 +19,7 @@
*/
using Config;
+using Zeitgeist;
namespace Unity.VideoLens
{
@@ -497,22 +498,22 @@
private void zeitgeist_init () throws Error
{
zg_sources = new Zeitgeist.DataSourceRegistry ();
- var templates = new PtrArray.sized(1);
- var ev = new Zeitgeist.Event.full (Zeitgeist.ZG_ACCESS_EVENT, Zeitgeist.ZG_USER_ACTIVITY, "lens://unity-lens-video");
- templates.add ((ev as GLib.Object).ref());
+ var templates = new GenericArray<Event>();
+ var ev = new Zeitgeist.Event.full (Zeitgeist.ZG.ACCESS_EVENT, Zeitgeist.ZG.USER_ACTIVITY, "lens://unity-lens-video");
+ templates.add (ev);
var data_source = new Zeitgeist.DataSource.full ("98898", "Unity Video Lens", "", templates);
zg_sources.register_data_source (data_source, null);
}
private void zeitgeist_insert_event (string uri, string title, string icon)
{
- var subject = new Zeitgeist.Subject.full (uri, Zeitgeist.NFO_VIDEO, Zeitgeist.NFO_REMOTE_DATA_OBJECT, "", uri, title, icon);
- var event = new Zeitgeist.Event.full (Zeitgeist.ZG_ACCESS_EVENT, Zeitgeist.ZG_USER_ACTIVITY, "lens://unity-lens-video");
+ var subject = new Zeitgeist.Subject.full (uri, Zeitgeist.NFO.VIDEO, Zeitgeist.NFO.REMOTE_DATA_OBJECT, "", uri, title, icon);
+ var event = new Zeitgeist.Event.full (Zeitgeist.ZG.ACCESS_EVENT, Zeitgeist.ZG.USER_ACTIVITY, "lens://unity-lens-video");
event.add_subject (subject);
- var ev_array = new PtrArray.sized(1);
- ev_array.add ((event as GLib.Object).ref ());
- Zeitgeist.Log.get_default ().insert_events_from_ptrarray (ev_array, null);
+ var ev_array = new GenericArray<Event>();
+ ev_array.add (event);
+ Zeitgeist.Log.get_default ().insert_events_no_reply (ev_array);
}
}
}
=== modified file 'src/scope.vala'
--- src/scope.vala 2013-06-20 16:13:59 +0000
+++ src/scope.vala 2013-07-02 09:35:32 +0000
@@ -19,6 +19,7 @@
*/
using Config;
+using Zeitgeist;
namespace Unity.VideoLens
{
@@ -194,11 +195,11 @@
var time_range = new Zeitgeist.TimeRange.to_now ();
var event_template = new Zeitgeist.Event ();
- var subject = new Zeitgeist.Subject.full (uri, Zeitgeist.NFO_VIDEO, "", "", "", "", "");
+ var subject = new Zeitgeist.Subject.full (uri, Zeitgeist.NFO.VIDEO, "", "", "", "", "");
event_template.add_subject (subject);
- var templates = new PtrArray.sized (1);
- templates.add ((event_template as GLib.Object).ref());
+ var templates = new GenericArray<Event>();
+ templates.add (event_template);
var results = yield Zeitgeist.Log.get_default ().find_events (time_range, templates, Zeitgeist.StorageState.ANY, MAX_ZG_EVENTS, Zeitgeist.ResultType.MOST_RECENT_SUBJECTS, cancellable);
process_zg_events (results, cancellable, search_status);
}
@@ -210,7 +211,7 @@
if (Utils.is_video (path) && !Utils.is_hidden (path))
{
var file = File.new_for_path (path);
- if (!is_blacklisted(file.get_uri ()))
+ if (!is_blacklisted(file.get_uri()))
return true;
}
}
@@ -230,7 +231,7 @@
if (cancellable.is_cancelled ())
return;
- var event_uri = event.get_subject (0).get_uri ();
+ var event_uri = event.get_subject (0).uri;
if (event_uri.has_prefix ("file://"))
{
try
@@ -266,10 +267,10 @@
// this one can be any unicode string:
VideoFile video = VideoFile ()
{
- title = event.get_subject (0).get_text (),
+ title = event.get_subject (0).text,
comment = "",
uri = event_uri,
- icon = event.get_subject (0).get_storage (),
+ icon = event.get_subject (0).storage,
category = CAT_INDEX_ONLINE
};
result_list.add (video);
=== modified file 'tests/unit/Makefile.am'
--- tests/unit/Makefile.am 2013-06-20 18:12:31 +0000
+++ tests/unit/Makefile.am 2013-07-02 09:35:32 +0000
@@ -17,7 +17,7 @@
--pkg json-glib-1.0 \
--pkg glib-2.0 \
--pkg gee-1.0 \
- --pkg zeitgeist-1.0 \
+ --pkg zeitgeist-2.0 \
--pkg libsoup-gnome-2.4 \
--pkg libsoup-2.4 \
--vapidir $(srcdir) \
Follow ups