Merge lp:~mterry/indicator-appmenu/ignore-non-window-views into lp:indicator-appmenu/0.3

Proposed by Michael Terry
Status: Merged
Merged at revision: 92
Proposed branch: lp:~mterry/indicator-appmenu/ignore-non-window-views
Merge into: lp:indicator-appmenu/0.3
Diff against target: 35 lines (+8/-8)
1 file modified
src/indicator-appmenu.c (+8/-8)
To merge this branch: bzr merge lp:~mterry/indicator-appmenu/ignore-non-window-views
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+47420@code.launchpad.net

Description of the change

On view-opened or view-closed signals, the view is not guaranteed to be a window (may be an app). The current code was throwing critical warnings when it encountered an app, so this just sanitizes the input a bit better.

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :

  review approve

On Tue, 2011-01-25 at 16:44 +0000, Michael Terry wrote:
> Michael Terry has proposed merging lp:~mterry/indicator-appmenu/ignore-non-window-views into lp:indicator-appmenu.
>
> Requested reviews:
> Indicator Applet Developers (indicator-applet-developers)
>
> For more details, see:
> https://code.launchpad.net/~mterry/indicator-appmenu/ignore-non-window-views/+merge/47420
>
> On view-opened or view-closed signals, the view is not guaranteed to be a window (may be an app). The current code was throwing critical warnings when it encountered an app, so this just sanitizes the input a bit better.
> differences between files attachment (review-diff.txt)
> === modified file 'src/indicator-appmenu.c'
> --- src/indicator-appmenu.c 2011-01-14 04:44:29 +0000
> +++ src/indicator-appmenu.c 2011-01-25 16:43:53 +0000
> @@ -740,11 +740,11 @@
> static void
> new_window (BamfMatcher * matcher, BamfView * view, gpointer user_data)
> {
> + if (view == NULL || !BAMF_IS_WINDOW(view)) {
> + return;
> + }
> +
> BamfWindow * window = BAMF_WINDOW(view);
> - if (window == NULL) {
> - return;
> - }
> -
> if (bamf_window_get_window_type(window) != BAMF_WINDOW_DESKTOP) {
> return;
> }
> @@ -772,11 +772,11 @@
> static void
> old_window (BamfMatcher * matcher, BamfView * view, gpointer user_data)
> {
> + if (view == NULL || !BAMF_IS_WINDOW(view)) {
> + return;
> + }
> +
> BamfWindow * window = BAMF_WINDOW(view);
> - if (window == NULL) {
> - return;
> - }
> -
> if (bamf_window_get_window_type(window) != BAMF_WINDOW_DESKTOP) {
> return;
> }
>

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/indicator-appmenu.c'
2--- src/indicator-appmenu.c 2011-01-14 04:44:29 +0000
3+++ src/indicator-appmenu.c 2011-01-25 16:43:53 +0000
4@@ -740,11 +740,11 @@
5 static void
6 new_window (BamfMatcher * matcher, BamfView * view, gpointer user_data)
7 {
8+ if (view == NULL || !BAMF_IS_WINDOW(view)) {
9+ return;
10+ }
11+
12 BamfWindow * window = BAMF_WINDOW(view);
13- if (window == NULL) {
14- return;
15- }
16-
17 if (bamf_window_get_window_type(window) != BAMF_WINDOW_DESKTOP) {
18 return;
19 }
20@@ -772,11 +772,11 @@
21 static void
22 old_window (BamfMatcher * matcher, BamfView * view, gpointer user_data)
23 {
24+ if (view == NULL || !BAMF_IS_WINDOW(view)) {
25+ return;
26+ }
27+
28 BamfWindow * window = BAMF_WINDOW(view);
29- if (window == NULL) {
30- return;
31- }
32-
33 if (bamf_window_get_window_type(window) != BAMF_WINDOW_DESKTOP) {
34 return;
35 }

Subscribers

People subscribed via source and target branches