Merge lp:~ricotz/pantheon-files/timeout-uint into lp:~elementary-apps/pantheon-files/trunk

Proposed by Rico Tzschichholz
Status: Merged
Approved by: Jeremy Wootten
Approved revision: 1829
Merged at revision: 1836
Proposed branch: lp:~ricotz/pantheon-files/timeout-uint
Merge into: lp:~elementary-apps/pantheon-files/trunk
Diff against target: 82 lines (+15/-15)
2 files modified
libwidgets/LocationBar.vala (+7/-7)
src/View/Chrome/ButtonWithMenu.vala (+8/-8)
To merge this branch: bzr merge lp:~ricotz/pantheon-files/timeout-uint
Reviewer Review Type Date Requested Status
Jeremy Wootten Approve
Review via email: mp+260269@code.launchpad.net

Commit message

Respect that timeout-ids are typed as uint

To post a comment you must log in.
Revision history for this message
Jeremy Wootten (jeremywootten) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'libwidgets/LocationBar.vala'
--- libwidgets/LocationBar.vala 2015-05-23 12:18:59 +0000
+++ libwidgets/LocationBar.vala 2015-05-27 09:54:56 +0000
@@ -116,7 +116,7 @@
116 public signal void up ();116 public signal void up ();
117 public signal void down ();117 public signal void down ();
118118
119 private int timeout = -1;119 private uint timeout = 0;
120120
121 private Granite.Services.IconFactory icon_factory;121 private Granite.Services.IconFactory icon_factory;
122122
@@ -211,10 +211,10 @@
211211
212 queue_draw ();212 queue_draw ();
213213
214 if (timeout == -1 && event.button == 1) {214 if (timeout == 0 && event.button == 1) {
215 timeout = (int) Timeout.add (150, () => {215 timeout = Timeout.add (150, () => {
216 select_bread_from_coord (event);216 select_bread_from_coord (event);
217 timeout = -1;217 timeout = 0;
218 return false;218 return false;
219 });219 });
220 }220 }
@@ -243,9 +243,9 @@
243243
244 reset_elements_states ();244 reset_elements_states ();
245245
246 if (timeout != -1) {246 if (timeout > 0) {
247 Source.remove ((uint) timeout);247 Source.remove (timeout);
248 timeout = -1;248 timeout = 0;
249 }249 }
250250
251 if (is_focus)251 if (is_focus)
252252
=== modified file 'src/View/Chrome/ButtonWithMenu.vala'
--- src/View/Chrome/ButtonWithMenu.vala 2015-05-03 06:44:42 +0000
+++ src/View/Chrome/ButtonWithMenu.vala 2015-05-27 09:54:56 +0000
@@ -114,8 +114,8 @@
114 }114 }
115115
116 private int LONG_PRESS_TIME = Gtk.Settings.get_default ().gtk_double_click_time * 2;116 private int LONG_PRESS_TIME = Gtk.Settings.get_default ().gtk_double_click_time * 2;
117 private int timeout = -1;117 private uint timeout = 0;
118 private uint last_click_time = -1;118 private uint last_click_time = 0;
119 private bool has_fetcher = false;119 private bool has_fetcher = false;
120120
121 private unowned MenuFetcher _fetcher;121 private unowned MenuFetcher _fetcher;
@@ -164,9 +164,9 @@
164 active = false;164 active = false;
165 }165 }
166166
167 if (timeout != -1) {167 if (timeout > 0) {
168 Source.remove ((uint) timeout);168 Source.remove (timeout);
169 timeout = -1;169 timeout = 0;
170 }170 }
171171
172 return false;172 return false;
@@ -178,11 +178,11 @@
178 if (ev.button == 1 || ev.button == 3)178 if (ev.button == 1 || ev.button == 3)
179 active = true;179 active = true;
180180
181 if (timeout == -1 && ev.button == 1) {181 if (timeout == 0 && ev.button == 1) {
182 last_click_time = ev.time;182 last_click_time = ev.time;
183 timeout = (int) Timeout.add(max_press_time, () => {183 timeout = Timeout.add (max_press_time, () => {
184 /* long click */184 /* long click */
185 timeout = -1;185 timeout = 0;
186 popup_menu (ev);186 popup_menu (ev);
187 return false;187 return false;
188 });188 });

Subscribers

People subscribed via source and target branches

to all changes: