[gnome-boxes] spice,vnc: Simplify setting up syncing of properties
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] spice,vnc: Simplify setting up syncing of properties
- Date: Wed, 16 Mar 2016 17:16:59 +0000 (UTC)
commit 447d66dfbb6ea372b1fb48f545a5de675463f2c5
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Wed Mar 16 16:30:41 2016 +0000
spice,vnc: Simplify setting up syncing of properties
Instead of hooking-up to 'config' property changes to set-up syncing of
saved properties of display, let's just do that already after
initializing 'config' property (which happens once anyway).
https://bugzilla.gnome.org/show_bug.cgi?id=761202
src/spice-display.vala | 8 ++++----
src/vnc-display.vala | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/spice-display.vala b/src/spice-display.vala
index fe5109a..f632352 100644
--- a/src/spice-display.vala
+++ b/src/spice-display.vala
@@ -56,10 +56,6 @@ private class Boxes.SpiceDisplay: Boxes.Display {
});
} catch (GLib.Error error) {
}
-
- this.notify["config"].connect (() => {
- config.save_properties (gtk_session, gtk_session_saved_properties);
- });
}
private Spice.MainChannel? _main_channel;
@@ -122,6 +118,8 @@ private class Boxes.SpiceDisplay: Boxes.Display {
session.cert_subject = host_subject;
else
session.cert_subject = GLib.Environment.get_variable ("BOXES_SPICE_HOST_SUBJECT");
+
+ config.save_properties (gtk_session, gtk_session_saved_properties);
}
public SpiceDisplay.with_uri (Machine machine, BoxConfig config, string uri) {
@@ -131,6 +129,8 @@ private class Boxes.SpiceDisplay: Boxes.Display {
this.config = config;
session.uri = uri;
+
+ config.save_properties (gtk_session, gtk_session_saved_properties);
}
public override Gtk.Widget get_display (int n) {
diff --git a/src/vnc-display.vala b/src/vnc-display.vala
index 4ca84a8..20a51fe 100644
--- a/src/vnc-display.vala
+++ b/src/vnc-display.vala
@@ -69,10 +69,6 @@ private class Boxes.VncDisplay: Boxes.Display {
display.close ();
});
-
- this.notify["config"].connect (() => {
- config.save_properties (display, saved_properties);
- });
}
public VncDisplay (BoxConfig config, string host, int port) {
@@ -80,6 +76,8 @@ private class Boxes.VncDisplay: Boxes.Display {
this.host = host;
this.port = port;
+
+ config.save_properties (display, saved_properties);
}
public VncDisplay.with_uri (BoxConfig config, string _uri) throws Boxes.Error {
@@ -95,6 +93,8 @@ private class Boxes.VncDisplay: Boxes.Display {
this.host = uri.server;
this.port = uri.port <= 0 ? 5900 : uri.port;
+
+ config.save_properties (display, saved_properties);
}
public override Gtk.Widget get_display (int n) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]