[Spice-commits] 2 commits - gtk/glib-compat.c gtk/glib-compat.h gtk/spice-session.c

Christophe Fergau teuf at kemper.freedesktop.org
Thu Feb 28 08:57:45 PST 2013


 gtk/glib-compat.c   |   27 +++++++++++++++++++++++++++
 gtk/glib-compat.h   |    5 +++++
 gtk/spice-session.c |    2 ++
 3 files changed, 34 insertions(+)

New commits:
commit 889bbf3bcfaaf82bb7fa5366625692df0199a0eb
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Wed Feb 27 14:37:11 2013 +0100

    Add fallback for g_key_file_set_uint64
    
    This was only added in glib 2.26

diff --git a/gtk/glib-compat.c b/gtk/glib-compat.c
index 5f2e29e..0c108ef 100644
--- a/gtk/glib-compat.c
+++ b/gtk/glib-compat.c
@@ -18,6 +18,33 @@
 
 #if !GLIB_CHECK_VERSION(2,26,0)
 G_DEFINE_BOXED_TYPE (GError, spice_error, g_error_copy, g_error_free)
+
+/**
+ * g_key_file_set_uint64:
+ * @key_file: a #GKeyFile
+ * @group_name: a group name
+ * @key: a key
+ * @value: an integer value
+ *
+ * Associates a new integer value with @key under @group_name.
+ * If @key cannot be found then it is created.
+ *
+ * Since: 2.26
+ **/
+void
+g_key_file_set_uint64 (GKeyFile    *key_file,
+                       const gchar *group_name,
+                       const gchar *key,
+                       guint64      value)
+{
+  gchar *result;
+
+  g_return_if_fail (key_file != NULL);
+
+  result = g_strdup_printf ("%" G_GUINT64_FORMAT, value);
+  g_key_file_set_value (key_file, group_name, key, result);
+  g_free (result);
+}
 #endif
 
 #if !GLIB_CHECK_VERSION(2,28,0)
diff --git a/gtk/glib-compat.h b/gtk/glib-compat.h
index 64e7eb1..cc5232a 100644
--- a/gtk/glib-compat.h
+++ b/gtk/glib-compat.h
@@ -68,6 +68,11 @@ type_name##_get_type (void) \
 GType spice_error_get_type (void) G_GNUC_CONST;
 
 #define G_PARAM_DEPRECATED  (1 << 31)
+
+void      g_key_file_set_uint64             (GKeyFile             *key_file,
+					     const gchar          *group_name,
+					     const gchar          *key,
+					     guint64               value);
 #endif /* glib 2.26 */
 
 #if !GLIB_CHECK_VERSION(2,28,0)
commit d06020e83956a8d6aef1caef9c9d8b61f6ddb89c
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Wed Feb 27 14:29:37 2013 +0100

    Don't try to call _wocky_http_proxy_get_type with old gio
    
    Proxy support is only built when gio is newer than 2.26, don't try
    to call symbols from wocky-http.c with older glib as this would
    result in link failures.

diff --git a/gtk/spice-session.c b/gtk/spice-session.c
index 0f33ba7..6fa8699 100644
--- a/gtk/spice-session.c
+++ b/gtk/spice-session.c
@@ -652,7 +652,9 @@ static void spice_session_class_init(SpiceSessionClass *klass)
 {
     GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
 
+#if GLIB_CHECK_VERSION(2, 26, 0)
     _wocky_http_proxy_get_type();
+#endif
 
     gobject_class->dispose      = spice_session_dispose;
     gobject_class->finalize     = spice_session_finalize;


More information about the Spice-commits mailing list