[gnome-boxes/gnome-3-20] display: uri property now nullable



commit 2b2fcdf0adfc097b1cb7f24f493a611b036cc3e0
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu Apr 21 17:17:16 2016 +0100

    display: uri property now nullable
    
    In some cases URI won't make sense so let's make it nullable. One such
    case is that of local private VMs where we connect through an FD and a
    following patch will modify uri in SpiceDisplay null for this case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=738573

 src/display.vala                    |    2 +-
 src/libvirt-machine-properties.vala |    5 +++--
 src/spice-display.vala              |    2 +-
 src/vnc-display.vala                |    2 +-
 4 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/display.vala b/src/display.vala
index 0909f39..e8e3851 100644
--- a/src/display.vala
+++ b/src/display.vala
@@ -3,7 +3,7 @@ using Gtk;
 
 private abstract class Boxes.Display: GLib.Object, Boxes.IPropertiesProvider {
     public abstract string protocol { get; }
-    public abstract string uri { owned get; }
+    public abstract string? uri { owned get; }
 
     public BoxConfig? config { get; protected set; }
     public bool can_grab_mouse { get; protected set; }
diff --git a/src/libvirt-machine-properties.vala b/src/libvirt-machine-properties.vala
index 1a86282..9132ac4 100644
--- a/src/libvirt-machine-properties.vala
+++ b/src/libvirt-machine-properties.vala
@@ -133,8 +133,9 @@ private class Boxes.LibvirtMachineProperties: GLib.Object, Boxes.IPropertiesProv
             if (machine.display != null) {
                 // Translators: This is the protocal being used to connect to the display/desktop, e.g 
Spice, VNC, etc.
                 add_string_property (ref list, _("Display Protocol"), machine.display.protocol);
-                // Translators: This is the URI to connect to the display/desktop. e.g spice://somehost:5051.
-                add_string_property (ref list, _("Display URI"), machine.display.uri);
+                if (machine.display.uri != null)
+                    // Translators: This is the URI to connect to the display/desktop. e.g 
spice://somehost:5051.
+                    add_string_property (ref list, _("Display URI"), machine.display.uri);
             }
 
             break;
diff --git a/src/spice-display.vala b/src/spice-display.vala
index 8e8ab3f..6a2ac0c 100644
--- a/src/spice-display.vala
+++ b/src/spice-display.vala
@@ -5,7 +5,7 @@ using LibUSB;
 
 private class Boxes.SpiceDisplay: Boxes.Display {
     public override string protocol { get { return "SPICE"; } }
-    public override string uri { owned get { return session.uri; } }
+    public override string? uri { owned get { return session.uri; } }
     public GLib.ByteArray ca_cert { owned get { return session.ca; } set { session.ca = value; } }
 
     private weak Machine machine; // Weak ref for avoiding cyclic ref
diff --git a/src/vnc-display.vala b/src/vnc-display.vala
index 20a51fe..c6037e6 100644
--- a/src/vnc-display.vala
+++ b/src/vnc-display.vala
@@ -4,7 +4,7 @@ using Vnc;
 
 private class Boxes.VncDisplay: Boxes.Display {
     public override string protocol { get { return "VNC"; } }
-    public override string uri { owned get { return @"vnc://$host:$port"; } }
+    public override string? uri { owned get { return @"vnc://$host:$port"; } }
     private Vnc.Display display;
     private string host;
     private int port;


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