Merge lp:~cjcurran/indicator-session/apt-updates-bug into lp:indicator-session/0.1

Proposed by Conor Curran
Status: Merged
Approved by: Ted Gould
Approved revision: 176
Merged at revision: 176
Proposed branch: lp:~cjcurran/indicator-session/apt-updates-bug
Merge into: lp:indicator-session/0.1
Diff against target: 80 lines (+17/-13)
3 files modified
src/apt-transaction.c (+12/-5)
src/apt-watcher.c (+3/-4)
src/indicator-session.c (+2/-4)
To merge this branch: bzr merge lp:~cjcurran/indicator-session/apt-updates-bug
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+71348@code.launchpad.net

Description of the change

Now the apt-transaction should only flag that there are updates available when there is more than one update in the array, gstrvlength returns length 1 when the array on dfeet is empty

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/apt-transaction.c'
2--- src/apt-transaction.c 2011-08-05 15:09:59 +0000
3+++ src/apt-transaction.c 2011-08-12 12:27:24 +0000
4@@ -185,11 +185,18 @@
5 g_variant_get (value, "(asasasasasasas)", &install,
6 &reinstall, &remove, &purge, &upgrade, &downgrade,
7 &keep);
8- gboolean upgrade_needed = (g_strv_length(upgrade) > 0) ||
9- (g_strv_length(install) > 0) ||
10- (g_strv_length(reinstall) > 0) ||
11- (g_strv_length(remove) > 0) ||
12- (g_strv_length(purge) > 0);
13+ /*
14+ g_debug ("upgrade package length %i", g_strv_length(upgrade));
15+ g_debug ("install package length %i", g_strv_length(install));
16+ g_debug ("reinstall package length %i", g_strv_length(reinstall));
17+ g_debug ("remove package length %i", g_strv_length(remove));
18+ g_debug ("purge package length %i", g_strv_length(purge));
19+ */
20+ gboolean upgrade_needed = (g_strv_length(upgrade) > 1) ||
21+ (g_strv_length(install) > 1) ||
22+ (g_strv_length(reinstall) > 1) ||
23+ (g_strv_length(remove) > 1) ||
24+ (g_strv_length(purge) > 1);
25 if (upgrade_needed == TRUE){
26 current_state = UPDATES_AVAILABLE;
27 }
28
29=== modified file 'src/apt-watcher.c'
30--- src/apt-watcher.c 2011-08-09 08:59:20 +0000
31+++ src/apt-watcher.c 2011-08-12 12:27:24 +0000
32@@ -281,8 +281,9 @@
33 _("Reboot Required"));
34 session_dbus_restart_required (self->session_dbus_interface);
35 }
36+ g_debug ("Finished with a reboot value of %i", reboot);
37 g_object_unref (G_OBJECT(self->current_transaction));
38- self->current_transaction = NULL;
39+ self->current_transaction = NULL;
40 }
41 self->current_state = state;
42 }
43@@ -327,9 +328,7 @@
44 self->current_transaction = apt_transaction_new (input, REAL);
45 g_signal_connect (G_OBJECT(self->current_transaction),
46 "state-update",
47- G_CALLBACK(apt_watcher_transaction_state_update_cb), self);
48-
49-
50+ G_CALLBACK(apt_watcher_transaction_state_update_cb), self);
51 }
52 }
53 g_variant_unref (parameters);
54
55=== modified file 'src/indicator-session.c'
56--- src/indicator-session.c 2011-08-09 08:59:20 +0000
57+++ src/indicator-session.c 2011-08-12 12:27:24 +0000
58@@ -163,13 +163,11 @@
59 }
60
61 self->users.label = GTK_LABEL (gtk_label_new (NULL));
62- // Only show once we have a valid username
63- // gtk_widget_hide (GTK_WIDGET(self->users.label));
64
65 // devices
66 self->devices.menu = GTK_MENU (dbusmenu_gtkmenu_new(INDICATOR_SESSION_DBUS_NAME,
67 INDICATOR_SESSION_DBUS_OBJECT));
68- self->devices.image = indicator_image_helper (ICON_DEFAULT);
69+ self->devices.image = indicator_image_helper ("system-devices-panel");
70
71 gtk_widget_show (GTK_WIDGET(self->devices.menu));
72 gtk_widget_show (GTK_WIDGET(self->devices.image));
73@@ -501,7 +499,7 @@
74 }
75 else if (g_strcmp0(signal_name, "RebootRequired") == 0) {
76 // TODO waiting on design to give me a name.
77- self->devices.image = indicator_image_helper (ICON_DEFAULT);
78+ self->devices.image = indicator_image_helper ("system-devices-alert-panel");
79 }
80 }
81

Subscribers

People subscribed via source and target branches