Merge lp:~unity-team/libunity/x-sru1 into lp:libunity/xenial

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Andrea Azzarone
Approved revision: 323
Merged at revision: 323
Proposed branch: lp:~unity-team/libunity/x-sru1
Merge into: lp:libunity/xenial
Diff against target: 98 lines (+43/-17)
2 files modified
debian/changelog (+6/-0)
src/unity-appinfo-manager.vala (+37/-17)
To merge this branch: bzr merge lp:~unity-team/libunity/x-sru1
Reviewer Review Type Date Requested Status
Andrea Azzarone (community) Approve
Review via email: mp+298664@code.launchpad.net

Commit message

Releasing SRU1 for Xenial

To post a comment you must log in.
Andrea Azzarone (azzar1) :
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 2015-12-15 08:19:15 +0000
3+++ debian/changelog 2016-06-29 15:59:43 +0000
4@@ -1,3 +1,9 @@
5+libunity (7.1.4+15.10.20151002-0ubuntu3) UNRELEASED; urgency=medium
6+
7+ * Process GFileMonitors signals with a small timeout. (LP: #1506744)
8+
9+ -- Andrea Azzarone <azzaronea@gmail.com> Wed, 29 Jun 2016 17:58:46 +0200
10+
11 libunity (7.1.4+15.10.20151002-0ubuntu2) xenial; urgency=medium
12
13 * Set dash online search option to off by default (LP: #1521208)
14
15=== modified file 'src/unity-appinfo-manager.vala'
16--- src/unity-appinfo-manager.vala 2014-02-03 17:22:39 +0000
17+++ src/unity-appinfo-manager.vala 2016-06-29 15:59:43 +0000
18@@ -62,13 +62,15 @@
19 private HashTable<string, StringArrayWrapper> categories_by_id; /* desktop id or path -> xdg cats */
20 private HashTable<string, StringArrayWrapper> keywords_by_id; /* desktop id or path -> X-GNOME-Keywords and X-AppInstall-Keywords */
21 private HashTable<string,string?> paths_by_id; /* desktop id -> full path to desktop file */
22-
23+ private List<uint> timeout_handlers;
24+
25 private AppInfoManager ()
26 {
27 appinfo_by_id = new HashTable<string,AppInfo?> (str_hash, str_equal);
28 categories_by_id = new HashTable<string,StringArrayWrapper> (str_hash, str_equal);
29 keywords_by_id = new HashTable<string,StringArrayWrapper> (str_hash, str_equal);
30 paths_by_id = new HashTable<string,string?> (str_hash, str_equal);
31+ timeout_handlers = new List<uint> ();
32
33 monitors = new HashTable<string,FileMonitor> (str_hash, str_equal);
34
35@@ -86,7 +88,15 @@
36 }
37 }
38 }
39-
40+
41+ ~AppInfoManager ()
42+ {
43+ timeout_handlers.foreach ((id) =>
44+ {
45+ Source.remove (id);
46+ });
47+ }
48+
49 [Deprecated (replacement = "AppInfoManager.get_default")]
50 public static AppInfoManager get_instance ()
51 {
52@@ -114,21 +124,31 @@
53 * we remove it from the cache */
54 private void on_dir_changed (FileMonitor mon, File file, File? other_file, FileMonitorEvent e)
55 {
56- var desktop_id = file.get_basename ();
57- var path = file.get_path ();
58- AppInfo? appinfo;
59-
60- if (appinfo_by_id.remove (desktop_id))
61- {
62- appinfo = lookup (desktop_id);
63- changed (desktop_id, appinfo);
64- }
65-
66- if (appinfo_by_id.remove (path))
67- {
68- appinfo = lookup (path);
69- changed (path, appinfo);
70- }
71+ uint timeout_handler = 0;
72+
73+ timeout_handler = Timeout.add_seconds (2, () =>
74+ {
75+ var desktop_id = file.get_basename ();
76+ var path = file.get_path ();
77+ AppInfo? appinfo;
78+
79+ if (appinfo_by_id.remove (desktop_id))
80+ {
81+ appinfo = lookup (desktop_id);
82+ changed (desktop_id, appinfo);
83+ }
84+
85+ if (appinfo_by_id.remove (path))
86+ {
87+ appinfo = lookup (path);
88+ changed (path, appinfo);
89+ }
90+
91+ timeout_handlers.remove (timeout_handler);
92+ return false;
93+ });
94+
95+ timeout_handlers.append (timeout_handler);
96 }
97
98 /**

Subscribers

People subscribed via source and target branches

to all changes: