[gnome-boxes] machine: use UUID instead of screenshot prefix



commit fbb94c7304234c3e0aae5a964f0f58a53e91af03
Author: Marc-Andrà Lureau <marcandre lureau gmail com>
Date:   Sat Aug 4 23:38:44 2012 +0200

    machine: use UUID instead of screenshot prefix
    
    Now that there is a UUID for each box, we can stop having various
    get_screenshot_prefix () code, and use it as filename prefix.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=681246

 src/libvirt-machine.vala |    4 ----
 src/machine.vala         |    6 ++----
 src/remote-machine.vala  |    4 ----
 3 files changed, 2 insertions(+), 12 deletions(-)
---
diff --git a/src/libvirt-machine.vala b/src/libvirt-machine.vala
index b6084f1..ba902a1 100644
--- a/src/libvirt-machine.vala
+++ b/src/libvirt-machine.vala
@@ -344,10 +344,6 @@ private class Boxes.LibvirtMachine: Boxes.Machine {
         }
     }
 
-    public override string get_screenshot_prefix () {
-        return domain.get_uuid ();
-    }
-
     public override async Gdk.Pixbuf? take_screenshot () throws GLib.Error {
         var state = DomainState.NONE;
         try {
diff --git a/src/machine.vala b/src/machine.vala
index d63f5bd..9001854 100644
--- a/src/machine.vala
+++ b/src/machine.vala
@@ -178,17 +178,15 @@ private abstract class Boxes.Machine: Boxes.CollectionItem, Boxes.IPropertiesPro
     }
 
     public string get_screenshot_filename () {
-        return get_user_pkgcache (get_screenshot_prefix () + "-screenshot.png");
+        return get_user_pkgcache (config.uuid + "-screenshot.png");
     }
 
-    public async virtual Gdk.Pixbuf? take_screenshot () throws GLib.Error {
+    public virtual async Gdk.Pixbuf? take_screenshot () throws GLib.Error {
         return null;
     }
 
     public abstract List<Boxes.Property> get_properties (Boxes.PropertiesPage page);
 
-    public abstract string get_screenshot_prefix ();
-
     public abstract async void connect_display ();
 
     public virtual void disconnect_display () {
diff --git a/src/remote-machine.vala b/src/remote-machine.vala
index 11c0d76..6369a20 100644
--- a/src/remote-machine.vala
+++ b/src/remote-machine.vala
@@ -52,10 +52,6 @@ private class Boxes.RemoteMachine: Boxes.Machine, Boxes.IPropertiesProvider {
         return list;
     }
 
-    public override string get_screenshot_prefix () {
-        return source.filename;
-    }
-
     public override void delete (bool by_user = true) {
         return_if_fail (by_user);
 



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