Merge lp:~unity-team/unity-lens-friends/libunity7-compatible into lp:unity-lens-friends

Proposed by James Henstridge
Status: Merged
Approved by: Ken VanDine
Approved revision: 61
Merged at revision: 55
Proposed branch: lp:~unity-team/unity-lens-friends/libunity7-compatible
Merge into: lp:unity-lens-friends
Diff against target: 580 lines (+125/-149)
11 files modified
configure.ac (+6/-6)
data/Makefile.am (+7/-7)
data/social.scope.in.in (+7/-6)
data/unity-lens-friends.service.in (+1/-1)
debian/changelog (+23/-0)
debian/control (+8/-5)
debian/rules (+3/-3)
po/POTFILES.in (+1/-1)
src/Makefile.am (+2/-1)
src/daemon.vala (+65/-116)
src/main.vala (+2/-3)
To merge this branch: bzr merge lp:~unity-team/unity-lens-friends/libunity7-compatible
Reviewer Review Type Date Requested Status
Ken VanDine Approve
Review via email: mp+163668@code.launchpad.net

Commit message

Merge libunity7-compatible branch to trunk.

Description of the change

Merge the libunity7-compatible branch to trunk. We are in the process of integrating libunity7/smart-scopes into Saucy, so further development should be against the new API.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'configure.ac'
--- configure.ac 2013-01-15 17:25:52 +0000
+++ configure.ac 2013-05-14 09:34:26 +0000
@@ -25,8 +25,8 @@
25######################################################25######################################################
26# intltool rule for generating translated .lens file26# intltool rule for generating translated .lens file
27######################################################27######################################################
28INTLTOOL_LENS_RULE='%.lens: %.lens.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'28INTLTOOL_SCOPE_RULE='%.scope: %.scope.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
29AC_SUBST(INTLTOOL_LENS_RULE)29AC_SUBST(INTLTOOL_SCOPE_RULE)
3030
31DEE_REQUIRED=1.0.031DEE_REQUIRED=1.0.0
32UNITY_REQUIRED=6.732UNITY_REQUIRED=6.7
@@ -44,18 +44,18 @@
44AC_SUBST(BASE_LIBS)44AC_SUBST(BASE_LIBS)
4545
46if test "x$with_localinstall" = "xyes"; then46if test "x$with_localinstall" = "xyes"; then
47 LENSESDIR="${datadir}/unity/lenses"47 SCOPESDIR="${datadir}/unity/scopes"
48else48else
49 LENSESDIR=`$PKG_CONFIG --variable=lensesdir unity`49 SCOPESDIR=`$PKG_CONFIG --variable=scopesdir unity`
50fi50fi
51AC_SUBST(LENSESDIR)51AC_SUBST(SCOPESDIR)
5252
5353
54AC_CONFIG_FILES([54AC_CONFIG_FILES([
55 Makefile55 Makefile
56 src/Makefile56 src/Makefile
57 data/Makefile57 data/Makefile
58 data/friends.lens.in58 data/social.scope.in
59 data/icons/Makefile59 data/icons/Makefile
60 data/icons/hicolor/Makefile60 data/icons/hicolor/Makefile
61 data/icons/hicolor/scalable/places/Makefile61 data/icons/hicolor/scalable/places/Makefile
6262
=== modified file 'data/Makefile.am'
--- data/Makefile.am 2012-10-26 23:23:06 +0000
+++ data/Makefile.am 2013-05-14 09:34:26 +0000
@@ -8,19 +8,19 @@
8%.service: %.service.in8%.service: %.service.in
9 sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@9 sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
1010
11lens_in_files = friends.lens.in11scope_in_files = social.scope.in
12lensdir = $(LENSESDIR)/friends12scopedir = $(SCOPESDIR)
13lens_DATA = $(lens_in_files:.lens.in=.lens)13scope_DATA = $(scope_in_files:.scope.in=.scope)
1414
15@INTLTOOL_LENS_RULE@15@INTLTOOL_SCOPE_RULE@
1616
17defaultdir = $(datadir)/friends/unity17defaultdir = $(datadir)/friends/unity
1818
19EXTRA_DIST = \19EXTRA_DIST = \
20 $(lens_DATA) \20 $(scope_DATA) \
21 $(lens_in_files) \21 $(scope_in_files) \
22 $(service_in_files)22 $(service_in_files)
2323
24CLEANFILES = \24CLEANFILES = \
25 $(dbus_services_DATA) \25 $(dbus_services_DATA) \
26 $(lens_DATA)26 $(scope_DATA)
2727
=== renamed file 'data/friends.lens.in.in' => 'data/social.scope.in.in'
--- data/friends.lens.in.in 2012-10-17 04:41:32 +0000
+++ data/social.scope.in.in 2013-05-14 09:34:26 +0000
@@ -1,14 +1,15 @@
1[Lens]1[Scope]
2DBusName=com.canonical.Unity.Lens.Friends2DBusName=com.canonical.Unity.Scope.Friends
3DBusPath=/com/canonical/unity/lens/friends3DBusPath=/com/canonical/unity/scope/friends
4Icon=/usr/share/unity/6/lens-nav-gwibber.svg4Icon=@prefix@/share/unity/icons/lens-nav-gwibber.svg
5_Name=Social5_Name=Social
6_Description=Social Network6_Description=This is an Ubuntu search plugin that enables information from Online accounts to be searched and displayed in the Dash underneath the Social header. If you do not wish to search this content source, you can disable this search plugin.
7_SearchHint=Enter name or content you would like to search for7_SearchHint=Enter name or content you would like to search for
8Shortcut=g8Shortcut=g
9Type=social
910
10#11#
11# Make translation work with Ubuntu's special handling of keyfiles12# Make translation work with Ubuntu's special handling of keyfiles
12#13#
13[Desktop Entry]14[Desktop Entry]
14X-Ubuntu-Gettext-Domain=friends15X-Ubuntu-Gettext-Domain=unity-lens-friends
1516
=== modified file 'data/unity-lens-friends.service.in'
--- data/unity-lens-friends.service.in 2012-10-17 20:13:50 +0000
+++ data/unity-lens-friends.service.in 2013-05-14 09:34:26 +0000
@@ -1,3 +1,3 @@
1[D-BUS Service]1[D-BUS Service]
2Name=com.canonical.Unity.Lens.Friends2Name=com.canonical.Unity.Scope.Friends
3Exec=@libexecdir@/unity-lens-friends3Exec=@libexecdir@/unity-lens-friends
44
=== modified file 'debian/changelog'
--- debian/changelog 2013-04-12 16:39:54 +0000
+++ debian/changelog 2013-05-14 09:34:26 +0000
@@ -1,3 +1,17 @@
1unity-lens-friends (0.1.2daily13.05.07ubuntu.unity.experimental.certified-0ubuntu1) raring; urgency=low
2
3 [ Michal Hruby ]
4 * Bump version
5
6 [ Ken VanDine ]
7 * [FFe] Provide an API for access data from Friends (LP: #1156941)
8
9 [ Ubuntu daily release ]
10 * Automatic snapshot from revision 60 (ubuntu-unity/experimental-
11 certified)
12
13 -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Tue, 07 May 2013 07:22:42 +0000
14
1unity-lens-friends (0.1.1bzr13.04.12-0ubuntu1) raring; urgency=low15unity-lens-friends (0.1.1bzr13.04.12-0ubuntu1) raring; urgency=low
216
3 [ Sebastien Bacher ]17 [ Sebastien Bacher ]
@@ -11,6 +25,15 @@
1125
12unity-lens-friends (0.1.1bzr13.03.26-0ubuntu1) raring; urgency=low26unity-lens-friends (0.1.1bzr13.03.26-0ubuntu1) raring; urgency=low
1327
28 [ James Henstridge ]
29 * Require new libunity.
30
31 [ Didier Roche ]
32 * Some packaging fixes
33 * transition from gwibber lens to the friends one
34 * Automatic snapshot from revision 43 (bootstrap)
35
36 [ Ken VanDine ]
14 * strip links from content, the lens can't render them37 * strip links from content, the lens can't render them
1538
16 -- Ken VanDine <ken.vandine@canonical.com> Tue, 26 Mar 2013 13:53:53 -040039 -- Ken VanDine <ken.vandine@canonical.com> Tue, 26 Mar 2013 13:53:53 -0400
1740
=== modified file 'debian/control'
--- debian/control 2013-04-12 15:12:28 +0000
+++ debian/control 2013-05-14 09:34:26 +0000
@@ -1,6 +1,6 @@
1Source: unity-lens-friends1Source: unity-lens-friends
2Section: misc2Section: misc
3Priority: extra3Priority: optional
4Maintainer: Ubuntu Desktop Team <ubuntu-desktop@lists.ubuntu.com>4Maintainer: Ubuntu Desktop Team <ubuntu-desktop@lists.ubuntu.com>
5Build-Depends: autotools-dev,5Build-Depends: autotools-dev,
6 debhelper (>= 9),6 debhelper (>= 9),
@@ -10,7 +10,7 @@
10 libaccounts-glib-dev,10 libaccounts-glib-dev,
11 libdee-dev (>= 1.0.0),11 libdee-dev (>= 1.0.0),
12 libfriends-dev (>= 0.1),12 libfriends-dev (>= 0.1),
13 libunity-dev,13 libunity-dev (>= 6.91),
14 valac-0.18,14 valac-0.18,
15Standards-Version: 3.9.415Standards-Version: 3.9.4
16Homepage: https://launchpad.net/unity-lens-friends16Homepage: https://launchpad.net/unity-lens-friends
@@ -23,6 +23,9 @@
23Depends: ${shlibs:Depends},23Depends: ${shlibs:Depends},
24 ${misc:Depends},24 ${misc:Depends},
25 friends (>= 0.1.3),25 friends (>= 0.1.3),
26Description: Friends Lens for unity26Conflicts: unity-lens-gwibber,
27 This package contains the "friends" lens which can be used27Provides: unity-lens-gwibber,
28 in Unity to view streams from Friends.28Replaces: unity-lens-gwibber,
29Description: Friends scope for unity
30 This package contains the "friends" scope which allows Unity
31 to search for view streams from Friends.
2932
=== modified file 'debian/rules'
--- debian/rules 2013-04-12 15:12:28 +0000
+++ debian/rules 2013-05-14 09:34:26 +0000
@@ -3,11 +3,11 @@
3# Uncomment this to turn on verbose mode.3# Uncomment this to turn on verbose mode.
4#export DH_VERBOSE=14#export DH_VERBOSE=1
55
6%:
7 dh $@ --with autoreconf,translations
8
6override_dh_autoreconf:9override_dh_autoreconf:
7 NOCONFIGURE=1 dh_autoreconf ./autogen.sh10 NOCONFIGURE=1 dh_autoreconf ./autogen.sh
811
9override_dh_install:12override_dh_install:
10 dh_install --fail-missing13 dh_install --fail-missing
11
12%:
13 dh $@ --with autoreconf,translations
1414
=== modified file 'po/POTFILES.in'
--- po/POTFILES.in 2012-10-17 20:13:50 +0000
+++ po/POTFILES.in 2013-05-14 09:34:26 +0000
@@ -2,4 +2,4 @@
22
3src/daemon.vala3src/daemon.vala
4src/main.vala4src/main.vala
5[type: gettext/ini] data/friends.lens.in.in5[type: gettext/ini] data/social.scope.in.in
66
=== modified file 'src/Makefile.am'
--- src/Makefile.am 2013-02-25 15:09:57 +0000
+++ src/Makefile.am 2013-05-14 09:34:26 +0000
@@ -26,7 +26,8 @@
26 --pkg unity \26 --pkg unity \
27 --pkg gio-2.0 \27 --pkg gio-2.0 \
28 --pkg accounts \28 --pkg accounts \
29 --basedir=.29 --basedir=. \
30 $(MAINTAINER_VALAFLAGS)
3031
31unity_lens_friends_LDADD = \32unity_lens_friends_LDADD = \
32 $(BASE_LIBS) \33 $(BASE_LIBS) \
3334
=== modified file 'src/daemon.vala'
--- src/daemon.vala 2013-03-27 00:34:30 +0000
+++ src/daemon.vala 2013-05-14 09:34:26 +0000
@@ -25,7 +25,7 @@
25namespace UnityFriends {25namespace UnityFriends {
2626
27 /* DBus name for the place. Must match out .place file */27 /* DBus name for the place. Must match out .place file */
28 const string BUS_NAME = "com.canonical.Unity.Lens.Friends";28 const string BUS_NAME = "com.canonical.Unity.Scope.Friends";
29 const string ICON_PATH = Config.DATADIR + "/icons/unity-icon-theme/places/svg/";29 const string ICON_PATH = Config.DATADIR + "/icons/unity-icon-theme/places/svg/";
30 const string STRIP_LINKS = """</?a[^>]*>""";30 const string STRIP_LINKS = """</?a[^>]*>""";
3131
@@ -35,8 +35,7 @@
35 */35 */
36 public class Daemon : GLib.Object36 public class Daemon : GLib.Object
37 {37 {
38 private Unity.Lens lens;38 private Unity.DeprecatedScope scope;
39 private Unity.Scope scope;
40 private Unity.PreferencesManager preferences = Unity.PreferencesManager.get_default ();39 private Unity.PreferencesManager preferences = Unity.PreferencesManager.get_default ();
41 private unowned Dee.ResourceManager resources;40 private unowned Dee.ResourceManager resources;
42 private Dee.Model? _model = null;41 private Dee.Model? _model = null;
@@ -53,16 +52,18 @@
53 private Ag.Manager _account_manager;52 private Ag.Manager _account_manager;
54 private bool _has_accounts = false;53 private bool _has_accounts = false;
55 private HashMap<string,Variant> featureMap;54 private HashMap<string,Variant> featureMap;
55 private Variant empty_asv;
5656
57 construct57 construct
58 {58 {
59 lens = new Unity.Lens("/com/canonical/unity/lens/friends", "friends");59 empty_asv = new Variant.array (VariantType.VARDICT.element (), {});
60 lens.search_in_global = false;60 scope = new Unity.DeprecatedScope("/com/canonical/unity/scope/friends", "friends.scope");
61 lens.search_hint = _("Enter name or content you would like to search for");61 scope.search_in_global = false;
62 lens.visible = false;62 scope.search_hint = _("Enter name or content you would like to search for");
63 scope.visible = false;
63 try64 try
64 {65 {
65 lens.export ();66 scope.export ();
66 } catch (GLib.IOError e)67 } catch (GLib.IOError e)
67 {68 {
68 warning ("failed to export lens: %s", e.message);69 warning ("failed to export lens: %s", e.message);
@@ -84,7 +85,7 @@
84 }85 }
85 else if (accts.length () == 0)86 else if (accts.length () == 0)
86 {87 {
87 lens.visible = false;88 scope.visible = false;
88 _has_accounts = false;89 _has_accounts = false;
89 }90 }
90 else91 else
@@ -98,58 +99,24 @@
98 void setup ()99 void setup ()
99 {100 {
100 setup_friends ();101 setup_friends ();
101 scope = new Unity.Scope ("/com/canonical/unity/scope/friends");102
102 scope.search_in_global = false;103 scope.visible = true;
103 scope.preview_uri.connect (preview);104 scope.preview_uri.connect (preview);
104105
105 lens.visible = true;
106
107 lens.add_local_scope (scope);
108
109 /* Listen for filter changes */106 /* Listen for filter changes */
110 scope.notify["active"].connect (() =>
111 {
112 if (scope.active)
113 {
114 scope.queue_search_changed (SearchType.DEFAULT);
115 }
116 });
117
118 scope.generate_search_key.connect ((lens_search) =>107 scope.generate_search_key.connect ((lens_search) =>
119 {108 {
120 return lens_search.search_string.strip ();109 return lens_search.search_string.strip ();
121 });110 });
122 scope.search_changed.connect ((lens_search, search_type, cancellable) =>111 scope.search_changed.connect ((search, search_type, cancellable) =>
123 {112 {
124 if (search_type == SearchType.DEFAULT)113 dispatch_search.begin (search, search_type, cancellable);
125 update_scope_search.begin (lens_search, cancellable);
126 else
127 update_global_search.begin (lens_search, cancellable);
128 });
129
130 lens.notify["active"].connect ((obj, pspec) => {
131 if (lens.active && scope.active)
132 {
133 if (_stream_iter_first != _model.get_first_iter () || _stream_iter_last != _model.get_last_iter ())
134 {
135 if (scope.active)
136 {
137 scope.queue_search_changed (SearchType.DEFAULT);
138 }
139 }
140 }
141 });
142
143 scope.filters_changed.connect (() =>
144 {
145 scope.queue_search_changed (SearchType.DEFAULT);
146 });114 });
147115
148 preferences.notify["remote-content-search"].connect ((obj, pspec) =>116 preferences.notify["remote-content-search"].connect ((obj, pspec) =>
149 {117 {
150 scope.queue_search_changed (SearchType.DEFAULT);118 scope.queue_search_changed (SearchType.DEFAULT);
151 });119 });
152
153 }120 }
154121
155 private void map_account_features ()122 private void map_account_features ()
@@ -238,7 +205,7 @@
238205
239 private void populate_filters ()206 private void populate_filters ()
240 {207 {
241 var filters = new GLib.List<Unity.Filter> ();208 var filters = new Unity.FilterSet ();
242209
243 /* Stream filter */210 /* Stream filter */
244 {211 {
@@ -254,21 +221,21 @@
254 filter.add_option ("public", _("Public"));221 filter.add_option ("public", _("Public"));
255 */222 */
256223
257 filters.append (filter);224 filters.add (filter);
258 }225 }
259226
260 /* Account filter */227 /* Account filter */
261 {228 {
262 var filter = create_account_filter ();229 var filter = create_account_filter ();
263 filters.append (filter);230 filters.add (filter);
264 }231 }
265232
266 lens.filters = filters;233 scope.filters = filters;
267234
268 _account_manager.account_created.connect ((id) => {235 _account_manager.account_created.connect ((id) => {
269 debug ("ACCOUNT ADDED");236 debug ("ACCOUNT ADDED");
270 var _acct = _account_manager.get_account ((Ag.AccountId)id);237 var _acct = _account_manager.get_account ((Ag.AccountId)id);
271 var filter = scope.get_filter ("account_id") as CheckOptionFilter;238 var filter = scope.filters.get_filter_by_id ("account_id") as CheckOptionFilter;
272 create_account_filter_option (filter, _acct);239 create_account_filter_option (filter, _acct);
273 map_account_features ();240 map_account_features ();
274 });241 });
@@ -310,49 +277,49 @@
310277
311 private void populate_categories ()278 private void populate_categories ()
312 {279 {
313 var categories = new GLib.List<Unity.Category> ();280 var categories = new Unity.CategorySet ();
314 Icon icon;281 Icon icon;
315282
316 var icon_dir = File.new_for_path ("/usr/share/unity-lens-friends/ui/icons/hicolor/scalable/places/");283 var icon_dir = File.new_for_path ("/usr/share/unity-lens-friends/ui/icons/hicolor/scalable/places/");
317284
318 icon = new FileIcon (icon_dir.get_child ("group-messages.svg"));285 icon = new FileIcon (icon_dir.get_child ("group-messages.svg"));
319 var cat = new Unity.Category (_("Messages"), icon, Unity.CategoryRenderer.HORIZONTAL_TILE);286 var cat = new Unity.Category ("messages", _("Messages"), icon, Unity.CategoryRenderer.HORIZONTAL_TILE);
320 categories.append (cat);287 categories.add (cat);
321288
322 icon = new FileIcon (icon_dir.get_child ("group-replies.svg"));289 icon = new FileIcon (icon_dir.get_child ("group-replies.svg"));
323 cat = new Unity.Category (_("Mentions"), icon, Unity.CategoryRenderer.HORIZONTAL_TILE);290 cat = new Unity.Category ("mentions", _("Mentions"), icon, Unity.CategoryRenderer.HORIZONTAL_TILE);
324 categories.append (cat);291 categories.add (cat);
325292
326 icon = new FileIcon (icon_dir.get_child ("group-images.svg"));293 icon = new FileIcon (icon_dir.get_child ("group-images.svg"));
327 cat = new Unity.Category (_("Images"), icon, Unity.CategoryRenderer.FLOW);294 cat = new Unity.Category ("images", _("Images"), icon, Unity.CategoryRenderer.FLOW);
328 categories.append (cat);295 categories.add (cat);
329296
330 icon = new FileIcon (icon_dir.get_child ("group-videos.svg"));297 icon = new FileIcon (icon_dir.get_child ("group-videos.svg"));
331 cat = new Unity.Category (_("Videos"), icon, Unity.CategoryRenderer.FLOW);298 cat = new Unity.Category ("videos", _("Videos"), icon, Unity.CategoryRenderer.FLOW);
332 categories.append (cat);299 categories.add (cat);
333300
334 icon = new FileIcon (icon_dir.get_child ("group-links.svg"));301 icon = new FileIcon (icon_dir.get_child ("group-links.svg"));
335 cat = new Unity.Category (_("Links"), icon, Unity.CategoryRenderer.HORIZONTAL_TILE);302 cat = new Unity.Category ("links", _("Links"), icon, Unity.CategoryRenderer.HORIZONTAL_TILE);
336 categories.append (cat);303 categories.add (cat);
337304
338 icon = new FileIcon (icon_dir.get_child ("group-private.svg"));305 icon = new FileIcon (icon_dir.get_child ("group-private.svg"));
339 cat = new Unity.Category (_("Private"), icon, Unity.CategoryRenderer.HORIZONTAL_TILE);306 cat = new Unity.Category ("private", _("Private"), icon, Unity.CategoryRenderer.HORIZONTAL_TILE);
340 categories.append (cat);307 categories.add (cat);
341308
342 icon = new FileIcon (icon_dir.get_child ("group-public.svg"));309 icon = new FileIcon (icon_dir.get_child ("group-public.svg"));
343 cat = new Unity.Category (_("Public"), icon, Unity.CategoryRenderer.HORIZONTAL_TILE);310 cat = new Unity.Category ("public", _("Public"), icon, Unity.CategoryRenderer.HORIZONTAL_TILE);
344 categories.append (cat);311 categories.add (cat);
345312
346 lens.categories = categories;313 scope.categories = categories;
347 }314 }
348315
349316
350 private bool is_empty_search (LensSearch search)317 private bool is_empty_search (DeprecatedScopeSearch search)
351 {318 {
352 return search.search_string.strip () == "";319 return search.search_string.strip () == "";
353 }320 }
354321
355 private async void update_global_search (LensSearch search, Cancellable cancellable)322 private async void dispatch_search (DeprecatedScopeSearch search, SearchType search_type, GLib.Cancellable cancellable)
356 {323 {
357 /**324 /**
358 * only perform the request if the user has not disabled325 * only perform the request if the user has not disabled
@@ -365,51 +332,29 @@
365 return;332 return;
366 }333 }
367334
368 var results_model = scope.global_results_model;
369
370 // FIXME: no results for home screen of the dash?335 // FIXME: no results for home screen of the dash?
371 if (is_empty_search (search))336 if (search_type == SearchType.GLOBAL && is_empty_search (search))
372 {337 {
373 search.finished ();338 search.finished ();
374 return;339 return;
375 }340 }
376341
377 update_results_model (results_model, search.search_string, null);342 update_results_model (search, null);
378343 debug ("%u results", search.results_model.get_n_rows ());
379 search.finished ();344 search.finished ();
380 }345 }
381
382 private async void update_scope_search (LensSearch search, Cancellable cancellable)
383 {
384 /**
385 * only perform the request if the user has not disabled
386 * online/commercial suggestions. That will hide the category as well.
387 */
388 if (preferences.remote_content_search != Unity.PreferencesManager.RemoteContent.ALL)
389 {
390 search.results_model.clear ();
391 search.finished ();
392 return;
393 }
394
395 var results_model = search.results_model;
396
397 update_results_model (results_model, search.search_string, null);
398 debug ("%u results", results_model.get_n_rows ());
399 search.finished ();
400 }
401
402346
403 /* Generic method to update a results model. We do it like this to minimize347 /* Generic method to update a results model. We do it like this to minimize
404 * code dup between updating the global- and the entry results model */348 * code dup between updating the global- and the entry results model */
405 private void update_results_model (Dee.Model results_model,349 private void update_results_model (DeprecatedScopeSearch search,
406 string? search, Categories? category)350 Categories? category)
407 {351 {
408 debug ("%u TOTAL ROWS", _model.get_n_rows ());352 debug ("%u TOTAL ROWS", _model.get_n_rows ());
409 unowned Dee.ModelIter iter, end;353 unowned Dee.ModelIter iter, end;
410354
355 var results_model = search.results_model;
411 var stream_ids = new Gee.ArrayList<string> ();356 var stream_ids = new Gee.ArrayList<string> ();
412 var filter = scope.get_filter("stream") as CheckOptionFilter;357 var filter = search.get_filter("stream") as CheckOptionFilter;
413 if (filter.filtering)358 if (filter.filtering)
414 {359 {
415 foreach (Unity.FilterOption option in filter.options)360 foreach (Unity.FilterOption option in filter.options)
@@ -422,7 +367,7 @@
422 }367 }
423368
424 var account_ids = new Gee.ArrayList<string> ();369 var account_ids = new Gee.ArrayList<string> ();
425 filter = scope.get_filter ("account_id") as CheckOptionFilter;370 filter = search.get_filter ("account_id") as CheckOptionFilter;
426 if (filter.filtering)371 if (filter.filtering)
427 {372 {
428 foreach (Unity.FilterOption option in filter.options)373 foreach (Unity.FilterOption option in filter.options)
@@ -447,7 +392,7 @@
447 392
448 var term_list = Object.new (typeof (Dee.TermList)) as Dee.TermList;393 var term_list = Object.new (typeof (Dee.TermList)) as Dee.TermList;
449 // search only the folded terms, FIXME: is that a good idea?394 // search only the folded terms, FIXME: is that a good idea?
450 _analyzer.tokenize (_ascii_filter.apply (search), term_list);395 _analyzer.tokenize (_ascii_filter.apply (search.search_string), term_list);
451396
452 var matches = new Sequence<Dee.ModelIter> ();397 var matches = new Sequence<Dee.ModelIter> ();
453 for (uint i = 0; i < term_list.num_terms (); i++)398 for (uint i = 0; i < term_list.num_terms (); i++)
@@ -556,7 +501,8 @@
556 case "private": group = Categories.PRIVATE; break;501 case "private": group = Categories.PRIVATE; break;
557 case "public": group = Categories.PUBLIC; break;502 case "public": group = Categories.PUBLIC; break;
558 }503 }
559 504
505 string uri = model.get_string (iter, StreamModelColumn.URL);
560 string _icon_uri = model.get_string (iter, StreamModelColumn.ICON_URI);506 string _icon_uri = model.get_string (iter, StreamModelColumn.ICON_URI);
561 if (stream_id == "images")507 if (stream_id == "images")
562 _img_uri = model.get_string (iter, StreamModelColumn.LINK_PICTURE);508 _img_uri = model.get_string (iter, StreamModelColumn.LINK_PICTURE);
@@ -569,12 +515,15 @@
569 else515 else
570 _img_uri = get_avatar_path (_icon_uri);516 _img_uri = get_avatar_path (_icon_uri);
571517
572 results_model.append (model.get_string (iter, StreamModelColumn.URL),518 results_model.append (uri,
573 _img_uri,519 _img_uri,
574 group,520 group,
575 "text/html",521 ResultType.PERSONAL,
576 GLib.Markup.escape_text (_model.get_string(iter, StreamModelColumn.SENDER)),522 "text/html",
577 sanitize_message (_model.get_string(iter, StreamModelColumn.MESSAGE)));523 GLib.Markup.escape_text (_model.get_string(iter, StreamModelColumn.SENDER)),
524 sanitize_message (_model.get_string(iter, StreamModelColumn.MESSAGE)),
525 uri,
526 empty_asv);
578 }527 }
579528
580 private string get_avatar_path (string uri)529 private string get_avatar_path (string uri)
581530
=== modified file 'src/main.vala'
--- src/main.vala 2012-10-30 18:21:51 +0000
+++ src/main.vala 2013-05-14 09:34:26 +0000
@@ -67,7 +67,7 @@
67 * making it race against GDBus' worker thread to export our67 * making it race against GDBus' worker thread to export our
68 * objects on the bus before/after owning our name and receiving68 * objects on the bus before/after owning our name and receiving
69 * method calls on our objects (which may not yet be up!)*/69 * method calls on our objects (which may not yet be up!)*/
70 if (dbus_name_has_owner ("com.canonical.Unity.Lens.Friends"))70 if (dbus_name_has_owner (BUS_NAME))
71 {71 {
72 print ("Another instance of the Unity Friends Daemon " +72 print ("Another instance of the Unity Friends Daemon " +
73 "already appears to be running.\nBailing out.\n");73 "already appears to be running.\nBailing out.\n");
@@ -79,8 +79,7 @@
79 daemon = new Daemon ();79 daemon = new Daemon ();
80 80
81 /* Use GApplication directly for single instance app functionality */81 /* Use GApplication directly for single instance app functionality */
82 app = new Application ("com.canonical.Unity.Lens.Friends",82 app = new Application (BUS_NAME, ApplicationFlags.IS_SERVICE);
83 ApplicationFlags.IS_SERVICE);
84 try {83 try {
85 app.register ();84 app.register ();
86 } catch (Error e) {85 } catch (Error e) {

Subscribers

People subscribed via source and target branches

to all changes: