pidgin/pidgin

Fix a warning about missing expand property

2014-03-17, Tomasz Wasilczyk
3a6156743d75
Parents e4618d775e0d
Children 02b5a573215c
Fix a warning about missing expand property
--- a/pidgin/gtkwebview.c Mon Mar 17 02:56:50 2014 +0100
+++ b/pidgin/gtkwebview.c Mon Mar 17 10:19:56 2014 +0100
@@ -1494,6 +1494,37 @@
G_OBJECT_CLASS(parent_class)->finalize(G_OBJECT(webview));
}
+enum {
+ PROP_0,
+ PROP_EXPAND
+};
+
+static void
+pidgin_webview_set_property(GObject *object, guint prop_id, const GValue *value,
+ GParamSpec *pspec)
+{
+ g_return_if_fail(PIDGIN_IS_WEBVIEW(object));
+
+ switch (prop_id) {
+ case PROP_EXPAND:
+ purple_debug_misc("webview",
+ "Ignored expand property (set to %d)",
+ g_value_get_boolean(value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id,
+ pspec);
+ }
+}
+
+static void
+pidgin_webview_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+{
+ g_return_if_fail(PIDGIN_IS_WEBVIEW(object));
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+}
+
static void
pidgin_webview_class_init(PidginWebViewClass *klass, gpointer userdata)
{
@@ -1579,6 +1610,15 @@
gtk_binding_entry_add_signal(binding_set, GDK_KEY_r, GDK_CONTROL_MASK,
"format-cleared", 0);
+ /* properties */
+
+ G_OBJECT_CLASS(klass)->set_property = pidgin_webview_set_property;
+ G_OBJECT_CLASS(klass)->get_property = pidgin_webview_get_property;
+ g_object_class_install_property(G_OBJECT_CLASS(klass),
+ PROP_EXPAND, g_param_spec_boolean("expand",
+ "not used", "It's just a fix, don't use it.", FALSE,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
purple_prefs_add_none(PIDGIN_PREFS_ROOT "/webview");
purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/webview/inspector_enabled", FALSE);
}