Merge lp:~super-friends/unity-lens-friends/raring into lp:unity-lens-friends

Proposed by Ken VanDine
Status: Merged
Approved by: Ken VanDine
Approved revision: 47
Merged at revision: 47
Proposed branch: lp:~super-friends/unity-lens-friends/raring
Merge into: lp:unity-lens-friends
Diff against target: 262 lines (+99/-98)
4 files modified
debian/changelog (+8/-0)
debian/control (+3/-1)
src/daemon.vala (+81/-95)
src/schemas.vala (+7/-2)
To merge this branch: bzr merge lp:~super-friends/unity-lens-friends/raring
Reviewer Review Type Date Requested Status
Ken VanDine Approve
Review via email: mp+154375@code.launchpad.net

Description of the change

Merge queued up changes for raring to trunk now that the FFe bug 1156979 was approved

To post a comment you must log in.
Revision history for this message
Ken VanDine (ken-vandine) wrote :

This was reviewed before merging into the raring branch

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2013-02-25 15:18:38 +0000
3+++ debian/changelog 2013-03-20 13:50:55 +0000
4@@ -1,3 +1,11 @@
5+unity-lens-friends (0.1.1bzr13.03.20-0ubuntu1) UNRELEASED; urgency=low
6+
7+ * Ported to the flatter schema
8+ * debian/control
9+ - depend on friends (>= 0.1.3) for schema changes (LP: #1156941)
10+
11+ -- Ken VanDine <ken.vandine@canonical.com> Thu, 14 Mar 2013 10:12:48 -0400
12+
13 unity-lens-friends (0.1.1bzr13.02.25-0ubuntu1) raring; urgency=low
14
15 * Dropped src/stream-model-schema.vala, the schema is defined
16
17=== modified file 'debian/control'
18--- debian/control 2013-02-22 00:09:33 +0000
19+++ debian/control 2013-03-20 13:50:55 +0000
20@@ -19,7 +19,9 @@
21
22 Package: unity-lens-friends
23 Architecture: any
24-Depends: ${shlibs:Depends}, ${misc:Depends}
25+Depends: ${shlibs:Depends},
26+ ${misc:Depends},
27+ friends (>= 0.1.3),
28 Description: Friends Lens for unity
29 This package contains the "friends" lens which can be used
30 in Unity to view streams from Friends.
31
32=== modified file 'src/daemon.vala'
33--- src/daemon.vala 2013-02-14 14:13:05 +0000
34+++ src/daemon.vala 2013-03-20 13:50:55 +0000
35@@ -521,14 +521,9 @@
36
37 if (account_ids.size > 0)
38 {
39- var _message_ids = model.get_value (iter, StreamModelColumn.MESSAGE_IDS);
40- foreach (var _message_id in _message_ids)
41- {
42- var _message_id_item = (string[])_message_id;
43- var _account = _message_id_item[1];
44- if (!(_account in account_ids))
45- account_match = false;
46- }
47+ var _account = (uint)model.get_uint64 (iter, StreamModelColumn.ACCOUNT_ID);
48+ if (!(_account.to_string() in account_ids))
49+ account_match = false;
50 }
51
52 var _stream = model.get_string (iter, StreamModelColumn.STREAM);
53@@ -635,7 +630,7 @@
54 var avatar = Icon.new_for_string (icon_uri);
55
56 //var avatar = new FileIcon (File.new_for_path (get_avatar_path (icon_uri)));
57- var likes = model.get_double (iter, StreamModelColumn.LIKES);
58+ var likes = model.get_uint64 (iter, StreamModelColumn.LIKES);
59 var sender = model.get_string (iter, StreamModelColumn.SENDER);
60 var timestring = utils.create_time_string (model.get_string (iter, StreamModelColumn.TIMESTAMP));
61 var content = model.get_string (iter, StreamModelColumn.MESSAGE);
62@@ -661,96 +656,87 @@
63 iter = model.next (iter);
64 }
65
66- uint[] _seen = null;
67- var _message_ids = model.get_value (iter, StreamModelColumn.MESSAGE_IDS);
68- foreach (var _message_id in _message_ids)
69- {
70- var _message_id_item = (string[])_message_id;
71- uint _account_id = (uint)uint64.parse(_message_id_item[1]);
72- debug ("account_id: %u", _account_id);
73- if (_account_id in _seen)
74- continue;
75- _seen += _account_id;
76- var _account_service = _message_id_item[0];
77- var _status_id = _message_id_item[2];
78- var icon_str = icon_dir.get_child ("service-" + _account_service + ".svg");
79- if (icon_str.query_exists ())
80- icon = new FileIcon (icon_str);
81- else
82- icon = null;
83-
84- string[] _features = null;
85- if (featureMap.has_key(_account_service))
86- {
87- _features = featureMap[_account_service].dup_strv ();
88- }
89-
90- parse_comments (preview, _status_id);
91-
92- var view_action = new Unity.PreviewAction ("view", _("View"), icon);
93- preview.add_action (view_action);
94-
95- view_action.activated.connect ((source) => {
96- try
97- {
98- if (GLib.AppInfo.launch_default_for_uri (uri, null))
99- {
100- return new Unity.ActivationResponse (Unity.HandledType.HIDE_DASH);
101- }
102- }
103- catch (GLib.Error e)
104- {
105- warning ("Failed to launch default application for uri '%s': %s", uri, e.message);
106- }
107- return new Unity.ActivationResponse (Unity.HandledType.NOT_HANDLED);
108+ uint _account_id = (uint)model.get_uint64(iter, StreamModelColumn.ACCOUNT_ID);
109+ debug ("account_id: %u", _account_id);
110+ var _account_service = model.get_string (iter, StreamModelColumn.PROTOCOL);
111+ var _status_id = model.get_string (iter, StreamModelColumn.MESSAGE_ID);
112+ var icon_str = icon_dir.get_child ("service-" + _account_service + ".svg");
113+ if (icon_str.query_exists ())
114+ icon = new FileIcon (icon_str);
115+ else
116+ icon = null;
117+
118+ string[] _features = null;
119+ if (featureMap.has_key(_account_service))
120+ {
121+ _features = featureMap[_account_service].dup_strv ();
122+ }
123+
124+ parse_comments (preview, _status_id);
125+
126+ var view_action = new Unity.PreviewAction ("view", _("View"), icon);
127+ preview.add_action (view_action);
128+
129+ view_action.activated.connect ((source) => {
130+ try
131+ {
132+ if (GLib.AppInfo.launch_default_for_uri (uri, null))
133+ {
134+ return new Unity.ActivationResponse (Unity.HandledType.HIDE_DASH);
135+ }
136+ }
137+ catch (GLib.Error e)
138+ {
139+ warning ("Failed to launch default application for uri '%s': %s", uri, e.message);
140+ }
141+ return new Unity.ActivationResponse (Unity.HandledType.NOT_HANDLED);
142+ });
143+
144+ if ("retweet" in _features)
145+ {
146+ if (_account_service == "twitter")
147+ retweet_str = _("Retweet");
148+ else
149+ retweet_str = _("Share");
150+ var retweet_action = new Unity.PreviewAction ("retweet", retweet_str, icon);
151+ preview.add_action (retweet_action);
152+ retweet_action.activated.connect ((source) => {
153+ Idle.add (() => {
154+ var dispatcher = new Friends.Dispatcher ();
155+ dispatcher.retweet (_account_id, _status_id);
156+ return false;
157+ });
158+ return new Unity.ActivationResponse (Unity.HandledType.SHOW_PREVIEW);
159 });
160-
161- if ("retweet" in _features)
162- {
163- if (_account_service == "twitter")
164- retweet_str = _("Retweet");
165- else
166- retweet_str = _("Share");
167- var retweet_action = new Unity.PreviewAction ("retweet", retweet_str, icon);
168- preview.add_action (retweet_action);
169- retweet_action.activated.connect ((source) => {
170- Idle.add (() => {
171- var dispatcher = new Friends.Dispatcher ();
172- dispatcher.retweet (_account_id, _status_id);
173- return false;
174- });
175- return new Unity.ActivationResponse (Unity.HandledType.SHOW_PREVIEW);
176- });
177- }
178+ }
179
180- bool from_me = model.get_bool (iter, StreamModelColumn.FROM_ME);
181- // REPLY
182- //if ("reply" in _features && !from_me)
183- //{
184- // var reply_action = new Unity.PreviewAction ("reply", _("Reply"), icon);
185- // preview.add_action (reply_action);
186- // reply_action.activated.connect ((source) => {
187- // return new Unity.ActivationResponse(Unity.HandledType.HIDE_DASH);
188- // });
189- //}
190+ bool from_me = model.get_bool (iter, StreamModelColumn.FROM_ME);
191+ // REPLY
192+ //if ("reply" in _features && !from_me)
193+ //{
194+ // var reply_action = new Unity.PreviewAction ("reply", _("Reply"), icon);
195+ // preview.add_action (reply_action);
196+ // reply_action.activated.connect ((source) => {
197+ // return new Unity.ActivationResponse(Unity.HandledType.HIDE_DASH);
198+ // });
199+ //}
200
201- bool liked = model.get_bool (iter, StreamModelColumn.LIKED);
202- if ("like" in _features && "unlike" in _features && !from_me)
203- {
204- like_str = liked ? _("Unlike") : _("Like");
205- var like_action = new Unity.PreviewAction ("like", like_str, icon);
206- preview.add_action (like_action);
207- like_action.activated.connect ((source) => {
208- Idle.add (() => {
209- var dispatcher = new Friends.Dispatcher ();
210- var ret = liked ? dispatcher.unlike (_account_id, _status_id) : dispatcher.like (_account_id, _status_id);
211- return false;
212- });
213- model.set_value (iter, StreamModelColumn.LIKED, !liked);
214- Unity.Preview new_preview = this.preview (uri);
215- return new Unity.ActivationResponse.with_preview (new_preview);
216+ bool liked = model.get_bool (iter, StreamModelColumn.LIKED);
217+ if ("like" in _features && "unlike" in _features && !from_me)
218+ {
219+ like_str = liked ? _("Unlike") : _("Like");
220+ var like_action = new Unity.PreviewAction ("like", like_str, icon);
221+ preview.add_action (like_action);
222+ like_action.activated.connect ((source) => {
223+ Idle.add (() => {
224+ var dispatcher = new Friends.Dispatcher ();
225+ var ret = liked ? dispatcher.unlike (_account_id, _status_id) : dispatcher.like (_account_id, _status_id);
226+ return false;
227 });
228- }
229+ model.set_value (iter, StreamModelColumn.LIKED, !liked);
230+ Unity.Preview new_preview = this.preview (uri);
231+ return new Unity.ActivationResponse.with_preview (new_preview);
232+ });
233 }
234
235 return preview;
236
237=== modified file 'src/schemas.vala'
238--- src/schemas.vala 2013-02-25 15:09:57 +0000
239+++ src/schemas.vala 2013-03-20 13:50:55 +0000
240@@ -51,7 +51,9 @@
241 /* Dee.Model schema */
242 public enum StreamModelColumn
243 {
244- MESSAGE_IDS,
245+ PROTOCOL,
246+ ACCOUNT_ID,
247+ MESSAGE_ID,
248 STREAM,
249 SENDER,
250 SENDER_ID,
251@@ -68,7 +70,10 @@
252 LINK_URL,
253 LINK_DESC,
254 LINK_CAPTION,
255- LINK_ICON
256+ LINK_ICON,
257+ LOCATION,
258+ LATITUDE,
259+ LONGITUDE
260 }
261
262 } /* end UnityFriends namespace */

Subscribers

People subscribed via source and target branches

to all changes: