Merge lp:~rainct/zeitgeist/least-popular-959615 into lp:~zeitgeist/zeitgeist/bluebird

Proposed by Siegfried Gevatter on 2012-04-10
Status: Needs review
Proposed branch: lp:~rainct/zeitgeist/least-popular-959615
Merge into: lp:~zeitgeist/zeitgeist/bluebird
Diff against target: 76 lines (+10/-11)
2 files modified
src/datamodel.vala (+7/-8)
test/dbus/engine-test.py (+3/-3)
To merge this branch: bzr merge lp:~rainct/zeitgeist/least-popular-959615
Reviewer Review Type Date Requested Status
Zeitgeist Framework Team 2012-04-10 Pending
Review via email: mp+101406@code.launchpad.net

This proposal supersedes a proposal from 2012-03-29.

To post a comment you must log in.

Unmerged revisions

458. By Siegfried Gevatter on 2012-03-29

Fix sorting of LEAST_POPULAR_* result types (LP: #959615)

They should query for least popular X but return the most
(not least) recent event for it.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/datamodel.vala'
2--- src/datamodel.vala 2012-03-27 14:30:23 +0000
3+++ src/datamodel.vala 2012-04-10 16:04:18 +0000
4@@ -243,40 +243,39 @@
5 {
6 switch (result_type)
7 {
8- // FIXME: Why are LEAST_POPULAR_* using ASC?
9 case ResultType.LEAST_RECENT_EVENTS:
10 case ResultType.LEAST_RECENT_EVENT_ORIGIN:
11- case ResultType.LEAST_POPULAR_EVENT_ORIGIN:
12 case ResultType.LEAST_RECENT_SUBJECTS:
13- case ResultType.LEAST_POPULAR_SUBJECTS:
14 case ResultType.LEAST_RECENT_CURRENT_URI:
15- case ResultType.LEAST_POPULAR_CURRENT_URI:
16 case ResultType.LEAST_RECENT_ACTOR:
17- case ResultType.LEAST_POPULAR_ACTOR:
18 case ResultType.OLDEST_ACTOR:
19 case ResultType.LEAST_RECENT_ORIGIN:
20- case ResultType.LEAST_POPULAR_ORIGIN:
21 case ResultType.LEAST_RECENT_SUBJECT_INTERPRETATION:
22- case ResultType.LEAST_POPULAR_SUBJECT_INTERPRETATION:
23 case ResultType.LEAST_RECENT_MIMETYPE:
24- case ResultType.LEAST_POPULAR_MIMETYPE:
25 return true;
26
27 case ResultType.MOST_RECENT_EVENTS:
28 case ResultType.MOST_RECENT_EVENT_ORIGIN:
29 case ResultType.MOST_POPULAR_EVENT_ORIGIN:
30+ case ResultType.LEAST_POPULAR_EVENT_ORIGIN:
31 case ResultType.MOST_RECENT_SUBJECTS:
32 case ResultType.MOST_POPULAR_SUBJECTS:
33+ case ResultType.LEAST_POPULAR_SUBJECTS:
34 case ResultType.MOST_RECENT_CURRENT_URI:
35 case ResultType.MOST_POPULAR_CURRENT_URI:
36+ case ResultType.LEAST_POPULAR_CURRENT_URI:
37 case ResultType.MOST_RECENT_ACTOR:
38 case ResultType.MOST_POPULAR_ACTOR:
39+ case ResultType.LEAST_POPULAR_ACTOR:
40 case ResultType.MOST_RECENT_ORIGIN:
41 case ResultType.MOST_POPULAR_ORIGIN:
42+ case ResultType.LEAST_POPULAR_ORIGIN:
43 case ResultType.MOST_RECENT_SUBJECT_INTERPRETATION:
44 case ResultType.MOST_POPULAR_SUBJECT_INTERPRETATION:
45+ case ResultType.LEAST_POPULAR_SUBJECT_INTERPRETATION:
46 case ResultType.MOST_RECENT_MIMETYPE:
47 case ResultType.MOST_POPULAR_MIMETYPE:
48+ case ResultType.LEAST_POPULAR_MIMETYPE:
49 return false;
50
51 default:
52
53=== modified file 'src/db-reader.vala'
54=== modified file 'test/dbus/engine-test.py'
55--- test/dbus/engine-test.py 2012-03-16 17:08:43 +0000
56+++ test/dbus/engine-test.py 2012-04-10 16:04:18 +0000
57@@ -829,7 +829,7 @@
58 events = self.getEventsAndWait(ids)
59
60 self.assertEquals([e.timestamp for e in events],
61- ["123", "153", "163", "143"])
62+ ["163", "153", "123", "143"])
63
64 def testResultTypesMostRecentCurrentUri(self):
65 import_events("test/data/five_events.js", self)
66@@ -988,8 +988,8 @@
67 events = self.getEventsAndWait(ids)
68
69 self.assertEquals([e[0][5] for e in events],
70- ["origin2", "origin3", "origin1"])
71- self.assertEquals([e.timestamp for e in events], ["100", "103", "102"])
72+ ["origin3", "origin2", "origin1"])
73+ self.assertEquals([e.timestamp for e in events], ["103", "100", "102"])
74
75 def testResultTypesMostRecentEventOrigin(self):
76 import_events("test/data/twenty_events.js", self)

Subscribers

People subscribed via source and target branches