[gnome-boxes] Reset install_media when it has become stale



commit 775dfd3f1bcb9c80ec888a511cc6a33705ee97b9
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Mon Sep 17 18:22:27 2012 +0200

    Reset install_media when it has become stale
    
    When clicking on an ISO from the ISO list, we already know
    'install_media' so we can set it immediatly. When we
    select a media from the filechooser, we don't know the
    corresponding install_media immediatly, so we have to guess
    it later on.
    However, these 2 different situations conflict when the user
    first selects a media from the ISO list in the wizard, then goes
    back in the wizard and selects a file from the file chooser.
    The old media is then reused instead of the new one being used.
    This commit sets install_media to null when a file is selected
    in the file chooser so that it's guess later on instead of being
    reused.
    I chose not to clear install_media when navigating through the
    wizard in order to be able to reuse the media when going back in
    the wizard, and then forward without changing anything.
    An alternate fix that would likely work is to always reset it to
    null, and to reset it every time the URI change.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=684219

 src/wizard-source.vala |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/wizard-source.vala b/src/wizard-source.vala
index 57d140d..3fecd06 100644
--- a/src/wizard-source.vala
+++ b/src/wizard-source.vala
@@ -301,6 +301,8 @@ private class Boxes.WizardSource: GLib.Object {
         dialog.filter.add_mime_type ("application/x-cd-image");
         if (dialog.run () == Gtk.ResponseType.ACCEPT) {
             uri = dialog.get_uri ();
+            // clean install_media as this may be set already when going back in the wizard
+            install_media = null;
             url_entry.activate ();
         }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]