Merge lp:~zeitgeist/unity-lens-files/fix-1196800-port-to-libzeitgeist2 into lp:unity-lens-files

Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: 261
Merged at revision: 259
Proposed branch: lp:~zeitgeist/unity-lens-files/fix-1196800-port-to-libzeitgeist2
Merge into: lp:unity-lens-files
Diff against target: 345 lines (+75/-76)
6 files modified
configure.ac (+1/-1)
debian/control (+2/-2)
src/Makefile.am (+1/-1)
src/blacklist-tracker.vala (+2/-2)
src/daemon.vala (+60/-61)
src/utils.vala (+9/-9)
To merge this branch: bzr merge lp:~zeitgeist/unity-lens-files/fix-1196800-port-to-libzeitgeist2
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Marco Trevisan (Treviño) Approve
Review via email: mp+172464@code.launchpad.net

Commit message

Port unity-lens-applications to libzeitgeist2

Description of the change

Port unity-lens-files to libzeitgeist2 as the older libzeitgeist (libzeitgeist1) would be deprecated.

(PS: Have signed the contributor's agreement)

To post a comment you must log in.
261. By Manish Sinha (मनीष सिन्हा)

Fix the zeitgeist build-dep package

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Everything work as expected, thanks for the contribution.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'configure.ac'
2--- configure.ac 2013-05-16 11:42:23 +0000
3+++ configure.ac 2013-07-02 07:29:27 +0000
4@@ -62,7 +62,7 @@
5 gio-unix-2.0 >= $GLIB_REQUIRED
6 gee-1.0
7 dee-1.0 >= 0.5.16
8- zeitgeist-1.0 >= 0.3.17
9+ zeitgeist-2.0 >= 0.9.12
10 unity >= 7.0.0)
11
12
13
14=== modified file 'debian/control'
15--- debian/control 2013-05-16 16:47:22 +0000
16+++ debian/control 2013-07-02 07:29:27 +0000
17@@ -9,9 +9,9 @@
18 libglib2.0-dev (>= 2.27),
19 libgee-dev,
20 libdee-dev (>= 0.5.16),
21- libzeitgeist-dev (>= 0.3.17),
22+ libzeitgeist-2.0-dev (>= 0.9.12),
23 libunity-dev (>= 7.0.0),
24- zeitgeist-core (>= 0.5.0-0ubuntu2),
25+ zeitgeist-core (>= 0.9.12),
26 dh-autoreconf,
27 dh-translations,
28 Standards-Version: 3.9.4
29
30=== modified file 'src/Makefile.am'
31--- src/Makefile.am 2013-05-16 11:41:12 +0000
32+++ src/Makefile.am 2013-07-02 07:29:27 +0000
33@@ -23,7 +23,7 @@
34 unity_files_daemon_VALAFLAGS = \
35 -C \
36 --pkg dee-1.0 \
37- --pkg zeitgeist-1.0 \
38+ --pkg zeitgeist-2.0 \
39 --pkg unity \
40 --pkg gee-1.0 \
41 --pkg gio-2.0 \
42
43=== modified file 'src/blacklist-tracker.vala'
44--- src/blacklist-tracker.vala 2012-03-15 10:20:44 +0000
45+++ src/blacklist-tracker.vala 2013-07-02 07:29:27 +0000
46@@ -101,8 +101,8 @@
47 {
48 if (e.num_subjects () > 0)
49 {
50- unowned Subject s = e.get_subject (0);
51- unowned string uri = s.get_uri ();
52+ Subject s = e.get_subject (0);
53+ string uri = s.uri;
54 if (uri == null || uri == "") continue;
55
56 if (uri.has_suffix ("*"))
57
58=== modified file 'src/daemon.vala'
59--- src/daemon.vala 2013-06-21 20:49:58 +0000
60+++ src/daemon.vala 2013-07-02 07:29:27 +0000
61@@ -78,14 +78,14 @@
62 index = new Zeitgeist.Index ();
63
64 /* Listen for all file:// related events from Zeitgeist */
65- var templates = new PtrArray ();
66+ var templates = new GenericArray<Event>();
67 var event = new Zeitgeist.Event ();
68 var subject = new Zeitgeist.Subject ();
69- subject.set_uri ("file://*");
70+ subject.uri = "file://*";
71 event.add_subject (subject);
72- templates.add (event.ref ());
73+ templates.add (event);
74 monitor = new Zeitgeist.Monitor (new Zeitgeist.TimeRange.from_now (),
75- (owned) templates);
76+ templates);
77 monitor.events_inserted.connect (on_zeitgeist_changed);
78 monitor.events_deleted.connect (on_zeitgeist_changed);
79 log.install_monitor (monitor);
80@@ -216,76 +216,75 @@
81 string manifestation, string uri_prefix)
82 {
83 Event event;
84+ Subject sub;
85
86 /* Section.ALL_FILES */
87- event = new Event.full("", manifestation, "",
88- new Subject.full (uri_prefix,
89- "", "", "", "", "", ""));
90+ event = new Event.full("", manifestation, "", "");
91+ sub = new Subject.full(uri_prefix, "", "", "", "", "", "");
92+ event.add_subject(sub);
93 templates["all"] = event;
94
95 /* Section.DOCUMENTS */
96- event = new Event.full("", manifestation, "",
97- new Subject.full (uri_prefix,
98- NFO_DOCUMENT,
99- "", "", "", "", ""),
100- new Subject.full ("",
101- "!"+NFO_PRESENTATION,
102- "", "", "", "", ""));
103+ event = new Event.full("", manifestation, "", "");
104+ sub = new Subject.full (uri_prefix, NFO.DOCUMENT, "", "", "", "", "");
105+ event.add_subject(sub);
106+ sub = new Subject.full ("", "!"+NFO.PRESENTATION, "", "", "", "", "");
107+ event.add_subject(sub);
108 templates["documents"] = event;
109
110 /* Section.FOLDERS
111 * - we're using special ORIGIN queries here */
112- event = new Event.full("", manifestation, "",
113- new Subject.full (uri_prefix,
114- "", "", "", "", "", ""));
115+ event = new Event.full("", manifestation, "", "");
116+ sub = new Subject.full (uri_prefix, "", "", "", "", "", "");
117+ event.add_subject(sub);
118 templates["folders"] = event;
119
120 /* Section.IMAGES */
121- event = new Event.full("", manifestation, "",
122- new Subject.full (uri_prefix,
123- NFO_IMAGE, "", "", "", "", ""));
124+ event = new Event.full("", manifestation, "", "");
125+ sub = new Subject.full (uri_prefix, NFO.IMAGE, "", "", "", "", "");
126+ event.add_subject(sub);
127 templates["images"] = event;
128
129 /* Section.AUDIO */
130- event = new Event.full("", manifestation, "",
131- new Subject.full (uri_prefix,
132- NFO_AUDIO, "", "", "", "", ""));
133+ event = new Event.full("", manifestation, "", "");
134+ sub = new Subject.full (uri_prefix, NFO.AUDIO, "", "", "", "", "");
135+ event.add_subject(sub);
136 templates["audio"] = event;
137
138 /* Section.VIDEOS */
139- event = new Event.full("", manifestation, "",
140- new Subject.full (uri_prefix,
141- NFO_VIDEO, "", "", "", "", ""));
142+ event = new Event.full("", manifestation, "", "" );
143+ sub = new Subject.full (uri_prefix, NFO.VIDEO, "", "", "", "", "");
144+ event.add_subject(sub);
145 templates["videos"] = event;
146
147 /* Section.PRESENTATIONS
148 * FIXME: Zeitgeist logger needs to user finer granularity
149 * on classification as I am not sure it uses
150- * NFO_PRESENTATION yet */
151- event = new Event.full("", manifestation, "",
152- new Subject.full (uri_prefix,
153- NFO_PRESENTATION, "", "", "", "", ""));
154+ * NFO.PRESENTATION yet */
155+ event = new Event.full("", manifestation, "", "");
156+ sub = new Subject.full (uri_prefix, NFO.PRESENTATION, "", "", "", "", "");
157+ event.add_subject(sub);
158 templates["presentations"] = event;
159
160 /* Section.OTHER
161 * Note that subject templates are joined with logical AND */
162 event = new Event.full("", manifestation, "");
163 event.add_subject (new Subject.full (uri_prefix,
164- "!"+NFO_DOCUMENT, "", "", "", "", ""));
165- event.add_subject (new Subject.full ("",
166- "!"+NFO_IMAGE,
167- "",
168- "", "", "", ""));
169- event.add_subject (new Subject.full ("",
170- "!"+NFO_AUDIO,
171- "",
172- "", "", "", ""));
173- event.add_subject (new Subject.full ("",
174- "!"+NFO_VIDEO,
175- "",
176- "", "", "", ""));
177- event.add_subject (new Subject.full ("",
178- "!"+NFO_PRESENTATION,
179+ "!"+NFO.DOCUMENT, "", "", "", "", ""));
180+ event.add_subject (new Subject.full ("",
181+ "!"+NFO.IMAGE,
182+ "",
183+ "", "", "", ""));
184+ event.add_subject (new Subject.full ("",
185+ "!"+NFO.AUDIO,
186+ "",
187+ "", "", "", ""));
188+ event.add_subject (new Subject.full ("",
189+ "!"+NFO.VIDEO,
190+ "",
191+ "", "", "", ""));
192+ event.add_subject (new Subject.full ("",
193+ "!"+NFO.PRESENTATION,
194 "",
195 "", "", "", ""));
196 templates["other"] = event;
197@@ -294,7 +293,7 @@
198 private void prepare_type_templates ()
199 {
200 type_templates = new HashTable<string, Event> (str_hash, str_equal);
201- init_templates (type_templates, ZG_USER_ACTIVITY, "file:*");
202+ init_templates (type_templates, ZG.USER_ACTIVITY, "file:*");
203
204 unowned string download_path;
205 download_path = Environment.get_user_special_dir (UserDirectory.DOWNLOAD);
206@@ -675,11 +674,11 @@
207 string date = option == null ? "all" : option.id;
208
209 if (date == "last-7-days")
210- return new TimeRange (Timestamp.now() - Timestamp.WEEK, Timestamp.now ());
211+ return new TimeRange (Timestamp.from_now() - Timestamp.WEEK, Timestamp.from_now ());
212 else if (date == "last-30-days")
213- return new TimeRange (Timestamp.now() - (Timestamp.WEEK * 4), Timestamp.now());
214+ return new TimeRange (Timestamp.from_now() - (Timestamp.WEEK * 4), Timestamp.from_now());
215 else if (date == "last-year")
216- return new TimeRange (Timestamp.now() - Timestamp.YEAR, Timestamp.now ());
217+ return new TimeRange (Timestamp.from_now() - Timestamp.YEAR, Timestamp.from_now ());
218 else
219 return new TimeRange.anytime ();
220 }
221@@ -769,7 +768,7 @@
222 if (templates == null) return null;
223
224 /* Copy the templates to a PtrArray which libzg expects */
225- var ptr_arr = new PtrArray ();
226+ var ptr_arr = new GenericArray<Event>();
227 for (int i = 0; i < templates.length; i++)
228 {
229 ptr_arr.add (templates[i]);
230@@ -779,7 +778,7 @@
231 if (is_search_empty (search))
232 {
233 results = yield log.find_events (time_range,
234- (owned) ptr_arr,
235+ ptr_arr,
236 Zeitgeist.StorageState.ANY,
237 num_results,
238 result_type,
239@@ -791,7 +790,7 @@
240
241 results = yield index.search (search_string,
242 time_range,
243- (owned) ptr_arr,
244+ ptr_arr,
245 0, // offset
246 num_results,
247 result_type,
248@@ -886,7 +885,7 @@
249 // check if we match the timerange
250 uint64 mtime = info.get_attribute_uint64 (FileAttribute.TIME_MODIFIED) * 1000;
251
252- if (mtime < timerange.get_start() || mtime > timerange.get_end ())
253+ if (mtime < timerange.start || mtime > timerange.end)
254 continue;
255
256 // check if type matches
257@@ -1231,7 +1230,7 @@
258 {
259 if (ev.num_subjects () > 0)
260 {
261- string origin = ev.get_subject (0).get_origin ();
262+ string origin = ev.get_subject (0).origin;
263 if (origin == null || origin == "") continue;
264 var f = File.new_for_uri (origin);
265 origin = f.get_uri ();
266@@ -1267,7 +1266,7 @@
267 }
268 }
269 // we need this because of way ResultSet works with foreach
270- if (events.size () > 0) events.seek (0);
271+ if (events.size () > 0) events.reset ();
272 }
273 foreach (var ev in events)
274 {
275@@ -1282,17 +1281,17 @@
276
277 if (ResultFlags.USE_ORIGIN in flags)
278 {
279- uri = su.get_origin ();
280+ uri = su.origin;
281 display_name = "";
282 mimetype = "inode/directory";
283 }
284 else
285 {
286- uri = su.get_current_uri ();
287- display_name = su.get_text ();
288- mimetype = su.get_mimetype ();
289- mimetype = su.get_mimetype () != null ?
290- su.get_mimetype () : "application/octet-stream";
291+ uri = su.current_uri;
292+ display_name = su.text;
293+ mimetype = su.mimetype;
294+ mimetype = su.mimetype != null ?
295+ su.mimetype : "application/octet-stream";
296 }
297 if (uri == null) continue;
298 File file = File.new_for_uri (uri);
299
300=== modified file 'src/utils.vala'
301--- src/utils.vala 2013-05-16 11:41:12 +0000
302+++ src/utils.vala 2013-07-02 07:29:27 +0000
303@@ -350,25 +350,25 @@
304 switch (type_id)
305 {
306 case "documents":
307- return Zeitgeist.Symbol.is_a (interpretation, Zeitgeist.NFO_DOCUMENT)
308- && !Zeitgeist.Symbol.is_a (interpretation, Zeitgeist.NFO_PRESENTATION);
309+ return Zeitgeist.Symbol.is_a (interpretation, Zeitgeist.NFO.DOCUMENT)
310+ && !Zeitgeist.Symbol.is_a (interpretation, Zeitgeist.NFO.PRESENTATION);
311 case "folders":
312 return content_type == "inode/directory";
313 case "images":
314- return Zeitgeist.Symbol.is_a (interpretation, Zeitgeist.NFO_IMAGE);
315+ return Zeitgeist.Symbol.is_a (interpretation, Zeitgeist.NFO.IMAGE);
316 case "audio":
317- return Zeitgeist.Symbol.is_a (interpretation, Zeitgeist.NFO_AUDIO);
318+ return Zeitgeist.Symbol.is_a (interpretation, Zeitgeist.NFO.AUDIO);
319 case "videos":
320- return Zeitgeist.Symbol.is_a (interpretation, Zeitgeist.NFO_VIDEO);
321+ return Zeitgeist.Symbol.is_a (interpretation, Zeitgeist.NFO.VIDEO);
322 case "presentations":
323- return Zeitgeist.Symbol.is_a (interpretation, Zeitgeist.NFO_PRESENTATION);
324+ return Zeitgeist.Symbol.is_a (interpretation, Zeitgeist.NFO.PRESENTATION);
325 case "other":
326 bool is_recognized = false;
327 is_recognized |= content_type == "inode/directory";
328 // DOCUMENT includes PRESENTATION
329- is_recognized |= Zeitgeist.Symbol.is_a (interpretation, Zeitgeist.NFO_DOCUMENT);
330+ is_recognized |= Zeitgeist.Symbol.is_a (interpretation, Zeitgeist.NFO.DOCUMENT);
331 // MEDIA includes AUDIO, VIDEO, IMAGE
332- is_recognized |= Zeitgeist.Symbol.is_a (interpretation, Zeitgeist.NFO_MEDIA);
333+ is_recognized |= Zeitgeist.Symbol.is_a (interpretation, Zeitgeist.NFO.MEDIA);
334 return !is_recognized;
335 case "all":
336 return true;
337@@ -386,7 +386,7 @@
338 foreach (var ev in results)
339 {
340 for (int i = 0; i < ev.num_subjects(); i++)
341- uris.add (ev.get_subject (i).get_uri ());
342+ uris.add (ev.get_subject (i).uri);
343 }
344
345 return uris;

Subscribers

People subscribed via source and target branches