Merge lp:~mc-return/unity/unity.merge-reduce-scope-of-variables.2 into lp:unity

Proposed by MC Return on 2012-12-04
Status: Merged
Approved by: Brandon Schaefer on 2012-12-05
Approved revision: 2963
Merged at revision: 2959
Proposed branch: lp:~mc-return/unity/unity.merge-reduce-scope-of-variables.2
Merge into: lp:unity
Diff against target: 122 lines (+7/-7)
7 files modified
dash/ResultViewGrid.cpp (+1/-1)
panel/PanelMenuView.cpp (+1/-1)
plugins/unityshell/src/nux-base-window-accessible.cpp (+1/-1)
plugins/unityshell/src/unity-quicklist-menu-accessible.cpp (+1/-1)
plugins/unityshell/src/unity-search-bar-accessible.cpp (+1/-1)
plugins/unityshell/src/unityshell.cpp (+1/-1)
services/panel-service.c (+1/-1)
To merge this branch: bzr merge lp:~mc-return/unity/unity.merge-reduce-scope-of-variables.2
Reviewer Review Type Date Requested Status
Brandon Schaefer (community) 2012-12-04 Approve on 2012-12-05
PS Jenkins bot continuous-integration Pending
Review via email: mp+137949@code.launchpad.net

Commit Message

Reduced the scope of various variables.
Removed a redundant check - index is unsigned, so it cannot be negative.

To post a comment you must log in.
Brandon Schaefer (brandontschaefer) wrote :

Looks good to me.

review: Approve
2963. By MC Return on 2012-12-05

Reverted the change in panel-service.c

Brandon Schaefer (brandontschaefer) wrote :

Awesome, thank you!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'dash/ResultViewGrid.cpp'
2--- dash/ResultViewGrid.cpp 2012-11-19 18:54:19 +0000
3+++ dash/ResultViewGrid.cpp 2012-12-05 22:19:22 +0000
4@@ -707,7 +707,7 @@
5 unsigned num_results = GetNumResults();
6 unsigned index = GetIndexAtPosition(x, y);
7 mouse_over_index_ = index;
8- if (index >= 0 && index < num_results)
9+ if (index < num_results)
10 {
11 // we got a click on a button so activate it
12 ResultIterator it(GetIteratorAtRow(index));
13
14=== modified file 'panel/PanelMenuView.cpp'
15--- panel/PanelMenuView.cpp 2012-11-30 22:20:43 +0000
16+++ panel/PanelMenuView.cpp 2012-12-05 22:19:22 +0000
17@@ -699,7 +699,6 @@
18 {
19 using namespace panel;
20 cairo_t* cr;
21- cairo_pattern_t* linpat;
22 int x = MAIN_LEFT_PADDING + TITLE_PADDING + geo.x;
23 int y = geo.y;
24
25@@ -753,6 +752,7 @@
26
27 if (text_width > text_space)
28 {
29+ cairo_pattern_t* linpat;
30 int out_pixels = text_width - text_space;
31 const int fading_pixels = 35;
32 int fading_width = out_pixels < fading_pixels ? out_pixels : fading_pixels;
33
34=== modified file 'plugins/unityshell/src/nux-base-window-accessible.cpp'
35--- plugins/unityshell/src/nux-base-window-accessible.cpp 2012-07-09 15:53:27 +0000
36+++ plugins/unityshell/src/nux-base-window-accessible.cpp 2012-12-05 22:19:22 +0000
37@@ -173,7 +173,6 @@
38 nux_base_window_accessible_check_active(NuxBaseWindowAccessible* self,
39 nux::BaseWindow* active_window)
40 {
41- const gchar* signal_name;
42 gboolean is_active;
43 nux::Object* nux_object = NULL;
44 nux::BaseWindow* bwindow = NULL;
45@@ -189,6 +188,7 @@
46
47 if (self->priv->active != is_active)
48 {
49+ const gchar* signal_name;
50 self->priv->active = is_active;
51
52 if (is_active)
53
54=== modified file 'plugins/unityshell/src/unity-quicklist-menu-accessible.cpp'
55--- plugins/unityshell/src/unity-quicklist-menu-accessible.cpp 2012-03-14 06:24:18 +0000
56+++ plugins/unityshell/src/unity-quicklist-menu-accessible.cpp 2012-12-05 22:19:22 +0000
57@@ -210,7 +210,6 @@
58 QuicklistView* quicklist = NULL;
59 QuicklistMenuItem* child = NULL;
60 AtkObject* child_accessible = NULL;
61- AtkObject* parent = NULL;
62 nux::Object* nux_object = NULL;
63
64 g_return_val_if_fail(UNITY_IS_QUICKLIST_MENU_ACCESSIBLE(obj), NULL);
65@@ -226,6 +225,7 @@
66
67 if (child_accessible != NULL)
68 {
69+ AtkObject* parent = NULL;
70 g_object_ref(child_accessible);
71 parent = atk_object_get_parent(child_accessible);
72 if (parent != obj)
73
74=== modified file 'plugins/unityshell/src/unity-search-bar-accessible.cpp'
75--- plugins/unityshell/src/unity-search-bar-accessible.cpp 2012-03-14 06:24:18 +0000
76+++ plugins/unityshell/src/unity-search-bar-accessible.cpp 2012-12-05 22:19:22 +0000
77@@ -107,7 +107,6 @@
78 {
79 SearchBar* search_bar = NULL;
80 nux::TextEntry* text_entry = NULL;
81- AtkObject* text_entry_accessible = NULL;
82 nux::Object* nux_object = NULL;
83
84 g_return_if_fail(UNITY_IS_SEARCH_BAR_ACCESSIBLE(self));
85@@ -122,6 +121,7 @@
86
87 if (text_entry != NULL)
88 {
89+ AtkObject* text_entry_accessible = NULL;
90 text_entry_accessible = unity_a11y_get_accessible(text_entry);
91 atk_object_set_name(text_entry_accessible, s.c_str());
92 }
93
94=== modified file 'plugins/unityshell/src/unityshell.cpp'
95--- plugins/unityshell/src/unityshell.cpp 2012-12-03 16:04:38 +0000
96+++ plugins/unityshell/src/unityshell.cpp 2012-12-05 22:19:22 +0000
97@@ -2727,11 +2727,11 @@
98 if (n == CompWindowNotifyFocusChange)
99 {
100 UnityScreen* us = UnityScreen::get(screen);
101- CompWindow *lw;
102
103 // can't rely on launcher->IsOverlayVisible on focus change (because ubus is async close on focus change.)
104 if (us && (us->dash_controller_->IsVisible() || us->hud_controller_->IsVisible()))
105 {
106+ CompWindow *lw;
107 lw = screen->findWindow(us->launcher_controller_->LauncherWindowId(0));
108 lw->moveInputFocusTo();
109 }
110
111=== modified file 'services/panel-service.c'
112--- services/panel-service.c 2012-12-04 14:38:44 +0000
113+++ services/panel-service.c 2012-12-05 22:19:22 +0000
114@@ -1335,7 +1335,7 @@
115 gint width,
116 gint height)
117 {
118- IndicatorObject *object;
119+ IndicatorObject *object;
120 IndicatorObjectEntry *entry;
121 gboolean valid_entry = TRUE;
122 PanelServicePrivate *priv = self->priv;