Merge lp:~a-j-buxton/indicator-applet/fix-loaded-count into lp:indicator-applet/13.10

Proposed by Alistair Buxton
Status: Merged
Approved by: Ted Gould
Approved revision: 419
Merged at revision: 419
Proposed branch: lp:~a-j-buxton/indicator-applet/fix-loaded-count
Merge into: lp:indicator-applet/13.10
Diff against target: 21 lines (+2/-2)
1 file modified
src/applet-main.c (+2/-2)
To merge this branch: bzr merge lp:~a-j-buxton/indicator-applet/fix-loaded-count
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Iain Lane Approve
Indicator Applet Developers Pending
Review via email: mp+183349@code.launchpad.net

Commit message

Fix the loaded indicators count.

The addition of support for indicator-ng means that there are now two
ways to load indicators, but only those loaded by the second function
are counted. Fix this by making the worker functions add to the counter
variable instead of assigning to it.

Description of the change

This fixes a bug introduced with the new indicator-ng support. There are now two ways to load plugins, and when the second way is done, it overwrites the count of plugins loaded by the first way, as the worker functions use call-by-reference. This change fixes the bug by adding to the variable rather than assigning to it.

I can't test this patch at the moment as I'm not using gnome-panel. I found the bug while porting the indicator-ng support to xfce4-indicator-applet. However, it's a trivial patch...

To post a comment you must log in.
Revision history for this message
Iain Lane (laney) wrote :

Cheers. How can I see this bug and verify your fix?

Revision history for this message
Alistair Buxton (a-j-buxton) wrote :

A couple of ways:
You can uninstall all indicator-ng type indicators from your system and
then load the applet. You will see "No Indicators" instead of the old type
indicators. Removing every indicator except for indicator-appindicator
should do this.

Alternatively you can use a debugger or printf statements to show the value
of indicators_loaded immediately after call to
load_indicators_from_indicator_files(menubar, &indicators_loaded); - it
will equal the number of indicator-ng indicators loaded only, instead of
the total number of indicators loaded by both the previous functions.

On 5 September 2013 12:09, Iain Lane <email address hidden> wrote:

> Cheers. How can I see this bug and verify your fix?
> --
>
> https://code.launchpad.net/~a-j-buxton/indicator-applet/fix-loaded-count/+merge/183349
> You are the owner of lp:~a-j-buxton/indicator-applet/fix-loaded-count.
>

--
Alistair Buxton
<email address hidden>

Revision history for this message
Iain Lane (laney) wrote :

Ah OK, thanks. Seems good; approving. Sorry for my delay in getting back to you.

Please set a commit message on this MP.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/applet-main.c'
2--- src/applet-main.c 2013-07-28 14:30:59 +0000
3+++ src/applet-main.c 2013-09-01 00:05:50 +0000
4@@ -706,7 +706,7 @@
5 }
6 }
7
8- *indicators_loaded = count;
9+ *indicators_loaded += count;
10
11 g_dir_close (dir);
12 }
13@@ -747,7 +747,7 @@
14 g_free (filename);
15 }
16
17- *indicators_loaded = count;
18+ *indicators_loaded += count;
19
20 g_dir_close (dir);
21 }

Subscribers

People subscribed via source and target branches