Code review comment for lp:~evfool/synaptic/lp975578

Revision history for this message
Daniel Hartwig (wigs) wrote :

On cancel, the status will be set to:
 Failed to mark all available upgrades!

which is not correct.

This should rather not-set/clear the status message, as per cancelling other operations (see gtk/rgmainwindow.cc:2905, for example), or at least change to mention “cancelled”. Below is a patch for this. Note that the final call to showErrors is a noop on cancel, since askStateChange will discard pending errors if the user cancels.

=== modified file 'gtk/rgmainwindow.cc'
--- gtk/rgmainwindow.cc 2012-07-12 20:03:08 +0000
+++ gtk/rgmainwindow.cc 2012-11-13 01:58:53 +0000
@@ -3247,10 +3247,12 @@
    else
       res = me->_lister->upgrade();

- me->askStateChange(state);
+ bool changed = me->askStateChange(state);
    me->refreshTable(pkg);

- if (res)
+ if (!changed)
+ me->setStatusText();
+ else if (res)
       me->setStatusText(_("Successfully marked available upgrades"));
    else
       me->setStatusText(_("Failed to mark all available upgrades!"));

review: Needs Fixing

« Back to merge proposal