Confused with signals which return gboolean
While working on evolution-data-server changes to use libical-glib I (withtintou's help) also enabled vala bindings for some parts which were not enabled before, like for libebackend. When generating vala bindings from GObject introspection code the vala claims this:
EBackend-1.2.gir:1472.7-1472.30: warning: Signal `E.Cache.before_put' conflicts with method of the same name
<virtual-method name="before_put" throws="1">
It corresponds to this code in the .git file:
<virtual-method name="before_put" throws="1">
<source-position filename="src/libebackend/e-cache.h" line="366"/>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="cache" transfer-ownership="none">
<type name="Cache" c:type="ECache*"/>
</instance-parameter>
<parameter name="uid" transfer-ownership="none">
<type name="utf8" c:type="const gchar*"/>
</parameter>
<parameter name="revision" transfer-ownership="none">
<type name="utf8" c:type="const gchar*"/>
</parameter>
<parameter name="object" transfer-ownership="none">
<type name="utf8" c:type="const gchar*"/>
</parameter>
<parameter name="other_columns" transfer-ownership="none">
<type name="CacheColumnValues" c:type="ECacheColumnValues*"/>
</parameter>
<parameter name="is_replace" transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</virtual-method>
and
<field name="before_put">
<callback name="before_put" throws="1">
<source-position filename="src/libebackend/e-cache.h" line="366"/>
<return-value transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="cache" transfer-ownership="none">
<type name="Cache" c:type="ECache*"/>
</parameter>
<parameter name="uid" transfer-ownership="none">
<type name="utf8" c:type="const gchar*"/>
</parameter>
<parameter name="revision" transfer-ownership="none">
<type name="utf8" c:type="const gchar*"/>
</parameter>
<parameter name="object" transfer-ownership="none">
<type name="utf8" c:type="const gchar*"/>
</parameter>
<parameter name="other_columns" transfer-ownership="none">
<type name="CacheColumnValues" c:type="ECacheColumnValues*"/>
</parameter>
<parameter name="is_replace" transfer-ownership="none">
<type name="gboolean" c:type="gboolean"/>
</parameter>
<parameter name="cancellable"
transfer-ownership="none"
nullable="1"
allow-none="1">
<type name="Gio.Cancellable" c:type="GCancellable*"/>
</parameter>
</parameters>
</callback>
</field>
which corresponds to this definition in the C header file:
struct _ECacheClass {
/*< private >*/
GObjectClass parent_class;
....
/* Signals */
gboolean (* before_put) (ECache *cache,
const gchar *uid,
const gchar *revision,
const gchar *object,
ECacheColumnValues *other_columns,
gboolean is_replace,
GCancellable *cancellable,
GError **error);
....
and this in the C .c file:
signals[BEFORE_PUT] = g_signal_new (
"before-put",
G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ECacheClass, before_put),
e_cache_signals_accumulator,
NULL,
g_cclosure_marshal_generic,
G_TYPE_BOOLEAN, 7,
G_TYPE_STRING,
G_TYPE_STRING,
G_TYPE_STRING,
E_TYPE_CACHE_COLUMN_VALUES,
G_TYPE_BOOLEAN,
G_TYPE_CANCELLABLE,
G_TYPE_POINTER);
I tried to change the prototype (and the signal) to not return that gboolean
and it made the compiler warning go away, which makes me believe that the vala is confused with it. I've multiple similar signals (with virtual method counterparts) in the code, all affected. I thought it's the GError **
, but it was the return value.
Could there be done anything about it, please?