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.
Revision history for this message
Andrea Azzarone (azzar1) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2015-12-15 08:19:15 +0000
+++ debian/changelog 2016-06-29 15:59:43 +0000
@@ -1,3 +1,9 @@
1libunity (7.1.4+15.10.20151002-0ubuntu3) UNRELEASED; urgency=medium
2
3 * Process GFileMonitors signals with a small timeout. (LP: #1506744)
4
5 -- Andrea Azzarone <azzaronea@gmail.com> Wed, 29 Jun 2016 17:58:46 +0200
6
1libunity (7.1.4+15.10.20151002-0ubuntu2) xenial; urgency=medium7libunity (7.1.4+15.10.20151002-0ubuntu2) xenial; urgency=medium
28
3 * Set dash online search option to off by default (LP: #1521208)9 * Set dash online search option to off by default (LP: #1521208)
410
=== modified file 'src/unity-appinfo-manager.vala'
--- src/unity-appinfo-manager.vala 2014-02-03 17:22:39 +0000
+++ src/unity-appinfo-manager.vala 2016-06-29 15:59:43 +0000
@@ -62,13 +62,15 @@
62 private HashTable<string, StringArrayWrapper> categories_by_id; /* desktop id or path -> xdg cats */62 private HashTable<string, StringArrayWrapper> categories_by_id; /* desktop id or path -> xdg cats */
63 private HashTable<string, StringArrayWrapper> keywords_by_id; /* desktop id or path -> X-GNOME-Keywords and X-AppInstall-Keywords */63 private HashTable<string, StringArrayWrapper> keywords_by_id; /* desktop id or path -> X-GNOME-Keywords and X-AppInstall-Keywords */
64 private HashTable<string,string?> paths_by_id; /* desktop id -> full path to desktop file */64 private HashTable<string,string?> paths_by_id; /* desktop id -> full path to desktop file */
65 65 private List<uint> timeout_handlers;
66
66 private AppInfoManager ()67 private AppInfoManager ()
67 {68 {
68 appinfo_by_id = new HashTable<string,AppInfo?> (str_hash, str_equal);69 appinfo_by_id = new HashTable<string,AppInfo?> (str_hash, str_equal);
69 categories_by_id = new HashTable<string,StringArrayWrapper> (str_hash, str_equal);70 categories_by_id = new HashTable<string,StringArrayWrapper> (str_hash, str_equal);
70 keywords_by_id = new HashTable<string,StringArrayWrapper> (str_hash, str_equal);71 keywords_by_id = new HashTable<string,StringArrayWrapper> (str_hash, str_equal);
71 paths_by_id = new HashTable<string,string?> (str_hash, str_equal);72 paths_by_id = new HashTable<string,string?> (str_hash, str_equal);
73 timeout_handlers = new List<uint> ();
7274
73 monitors = new HashTable<string,FileMonitor> (str_hash, str_equal);75 monitors = new HashTable<string,FileMonitor> (str_hash, str_equal);
74 76
@@ -86,7 +88,15 @@
86 }88 }
87 }89 }
88 }90 }
89 91
92 ~AppInfoManager ()
93 {
94 timeout_handlers.foreach ((id) =>
95 {
96 Source.remove (id);
97 });
98 }
99
90 [Deprecated (replacement = "AppInfoManager.get_default")]100 [Deprecated (replacement = "AppInfoManager.get_default")]
91 public static AppInfoManager get_instance ()101 public static AppInfoManager get_instance ()
92 {102 {
@@ -114,21 +124,31 @@
114 * we remove it from the cache */124 * we remove it from the cache */
115 private void on_dir_changed (FileMonitor mon, File file, File? other_file, FileMonitorEvent e)125 private void on_dir_changed (FileMonitor mon, File file, File? other_file, FileMonitorEvent e)
116 {126 {
117 var desktop_id = file.get_basename ();127 uint timeout_handler = 0;
118 var path = file.get_path ();128
119 AppInfo? appinfo;129 timeout_handler = Timeout.add_seconds (2, () =>
120 130 {
121 if (appinfo_by_id.remove (desktop_id))131 var desktop_id = file.get_basename ();
122 {132 var path = file.get_path ();
123 appinfo = lookup (desktop_id);133 AppInfo? appinfo;
124 changed (desktop_id, appinfo);134
125 }135 if (appinfo_by_id.remove (desktop_id))
126 136 {
127 if (appinfo_by_id.remove (path))137 appinfo = lookup (desktop_id);
128 {138 changed (desktop_id, appinfo);
129 appinfo = lookup (path);139 }
130 changed (path, appinfo);140
131 }141 if (appinfo_by_id.remove (path))
142 {
143 appinfo = lookup (path);
144 changed (path, appinfo);
145 }
146
147 timeout_handlers.remove (timeout_handler);
148 return false;
149 });
150
151 timeout_handlers.append (timeout_handler);
132 }152 }
133 153
134 /**154 /**

Subscribers

People subscribed via source and target branches

to all changes: