[PATCH spice-gtk 2/5] Add SPICE_MAX_CLIPBOARD environment variable

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

 



From: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>

Allow to easily override default max-clipboard value with environment
variable.
---
 gtk/channel-main.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/gtk/channel-main.c b/gtk/channel-main.c
index dbcaff8..75d0281 100644
--- a/gtk/channel-main.c
+++ b/gtk/channel-main.c
@@ -394,6 +394,17 @@ static void spice_main_channel_reset(SpiceChannel *channel, gboolean migrating)
     SPICE_CHANNEL_CLASS(spice_main_channel_parent_class)->channel_reset(channel, migrating);
 }
 
+static void spice_main_constructed(GObject *object)
+{
+    SpiceMainChannelPrivate *c = SPICE_MAIN_CHANNEL(object)->priv;
+
+    if (g_getenv("SPICE_MAX_CLIPBOARD"))
+        c->max_clipboard = atoi(g_getenv("SPICE_MAX_CLIPBOARD"));
+
+    if (G_OBJECT_CLASS(spice_main_channel_parent_class)->constructed)
+        G_OBJECT_CLASS(spice_main_channel_parent_class)->constructed(object);
+}
+
 static void spice_main_channel_class_init(SpiceMainChannelClass *klass)
 {
     GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
@@ -403,6 +414,7 @@ static void spice_main_channel_class_init(SpiceMainChannelClass *klass)
     gobject_class->finalize     = spice_main_channel_finalize;
     gobject_class->get_property = spice_main_get_property;
     gobject_class->set_property = spice_main_set_property;
+    gobject_class->constructed  = spice_main_constructed;
 
     channel_class->handle_msg    = spice_main_handle_msg;
     channel_class->iterate_write = spice_channel_iterate_write;
-- 
1.8.3.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]