[gnome-boxes] installer-media: Reuse MediaManager reference for !FLATPAK codeblock



commit 69b50df2a44b21ffd39c2fb277587387e6da29c0
Author: Felipe Borges <felipeborges gnome org>
Date:   Thu Dec 23 10:36:01 2021 +0100

    installer-media: Reuse MediaManager reference for !FLATPAK codeblock

 src/installer-media.vala | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/src/installer-media.vala b/src/installer-media.vala
index 3990a575..b14d0c06 100644
--- a/src/installer-media.vala
+++ b/src/installer-media.vala
@@ -128,15 +128,14 @@
     public async InstallerMedia.for_path (string       path,
                                           Cancellable? cancellable = null) throws GLib.Error {
         var device_file = yield get_device_file_from_path (path, cancellable);
+        var media_manager = MediaManager.get_default ();
 #if !FLATPAK
         var device = yield get_device_from_device_file (device_file, media_manager.client);
-
         if (device != null)
             yield get_media_info_from_device (device, media_manager.os_db);
         else {
 #endif
             from_image = true;
-            var media_manager = MediaManager.get_default ();
             os_media = yield media_manager.os_db.guess_os_from_install_media_path (device_file, cancellable);
             if (os_media != null)
                 os = os_media.os;


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