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
=== 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 @@
740static void740static void
741new_window (BamfMatcher * matcher, BamfView * view, gpointer user_data)741new_window (BamfMatcher * matcher, BamfView * view, gpointer user_data)
742{742{
743 if (view == NULL || !BAMF_IS_WINDOW(view)) {
744 return;
745 }
746
743 BamfWindow * window = BAMF_WINDOW(view);747 BamfWindow * window = BAMF_WINDOW(view);
744 if (window == NULL) {
745 return;
746 }
747
748 if (bamf_window_get_window_type(window) != BAMF_WINDOW_DESKTOP) {748 if (bamf_window_get_window_type(window) != BAMF_WINDOW_DESKTOP) {
749 return;749 return;
750 }750 }
@@ -772,11 +772,11 @@
772static void772static void
773old_window (BamfMatcher * matcher, BamfView * view, gpointer user_data)773old_window (BamfMatcher * matcher, BamfView * view, gpointer user_data)
774{774{
775 if (view == NULL || !BAMF_IS_WINDOW(view)) {
776 return;
777 }
778
775 BamfWindow * window = BAMF_WINDOW(view);779 BamfWindow * window = BAMF_WINDOW(view);
776 if (window == NULL) {
777 return;
778 }
779
780 if (bamf_window_get_window_type(window) != BAMF_WINDOW_DESKTOP) {780 if (bamf_window_get_window_type(window) != BAMF_WINDOW_DESKTOP) {
781 return;781 return;
782 }782 }

Subscribers

People subscribed via source and target branches