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
1=== modified file 'libwidgets/LocationBar.vala'
2--- libwidgets/LocationBar.vala 2015-05-23 12:18:59 +0000
3+++ libwidgets/LocationBar.vala 2015-05-27 09:54:56 +0000
4@@ -116,7 +116,7 @@
5 public signal void up ();
6 public signal void down ();
7
8- private int timeout = -1;
9+ private uint timeout = 0;
10
11 private Granite.Services.IconFactory icon_factory;
12
13@@ -211,10 +211,10 @@
14
15 queue_draw ();
16
17- if (timeout == -1 && event.button == 1) {
18- timeout = (int) Timeout.add (150, () => {
19+ if (timeout == 0 && event.button == 1) {
20+ timeout = Timeout.add (150, () => {
21 select_bread_from_coord (event);
22- timeout = -1;
23+ timeout = 0;
24 return false;
25 });
26 }
27@@ -243,9 +243,9 @@
28
29 reset_elements_states ();
30
31- if (timeout != -1) {
32- Source.remove ((uint) timeout);
33- timeout = -1;
34+ if (timeout > 0) {
35+ Source.remove (timeout);
36+ timeout = 0;
37 }
38
39 if (is_focus)
40
41=== modified file 'src/View/Chrome/ButtonWithMenu.vala'
42--- src/View/Chrome/ButtonWithMenu.vala 2015-05-03 06:44:42 +0000
43+++ src/View/Chrome/ButtonWithMenu.vala 2015-05-27 09:54:56 +0000
44@@ -114,8 +114,8 @@
45 }
46
47 private int LONG_PRESS_TIME = Gtk.Settings.get_default ().gtk_double_click_time * 2;
48- private int timeout = -1;
49- private uint last_click_time = -1;
50+ private uint timeout = 0;
51+ private uint last_click_time = 0;
52 private bool has_fetcher = false;
53
54 private unowned MenuFetcher _fetcher;
55@@ -164,9 +164,9 @@
56 active = false;
57 }
58
59- if (timeout != -1) {
60- Source.remove ((uint) timeout);
61- timeout = -1;
62+ if (timeout > 0) {
63+ Source.remove (timeout);
64+ timeout = 0;
65 }
66
67 return false;
68@@ -178,11 +178,11 @@
69 if (ev.button == 1 || ev.button == 3)
70 active = true;
71
72- if (timeout == -1 && ev.button == 1) {
73+ if (timeout == 0 && ev.button == 1) {
74 last_click_time = ev.time;
75- timeout = (int) Timeout.add(max_press_time, () => {
76+ timeout = Timeout.add (max_press_time, () => {
77 /* long click */
78- timeout = -1;
79+ timeout = 0;
80 popup_menu (ev);
81 return false;
82 });

Subscribers

People subscribed via source and target branches

to all changes: