vala r2419 - in trunk: . gobject
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r2419 - in trunk: . gobject
- Date: Wed, 4 Feb 2009 20:31:24 +0000 (UTC)
Author: juergbi
Date: Wed Feb 4 20:31:24 2009
New Revision: 2419
URL: http://svn.gnome.org/viewvc/vala?rev=2419&view=rev
Log:
2009-02-04 JÃrg Billeter <j bitron ch>
* gobject/valadbusclientmodule.vala:
Do not handle signals of irrelevant object paths
Modified:
trunk/ChangeLog
trunk/gobject/valadbusclientmodule.vala
Modified: trunk/gobject/valadbusclientmodule.vala
==============================================================================
--- trunk/gobject/valadbusclientmodule.vala (original)
+++ trunk/gobject/valadbusclientmodule.vala Wed Feb 4 20:31:24 2009
@@ -982,7 +982,30 @@
var filter_block = new CCodeBlock ();
- handle_signals (iface, filter_block);
+ // only handle signals concering the object path
+ var cdecl = new CCodeDeclaration ("char*");
+ cdecl.add_declarator (new CCodeVariableDeclarator ("path"));
+ filter_block.add_statement (cdecl);
+
+ var get_path = new CCodeFunctionCall (new CCodeIdentifier ("g_object_get"));
+ get_path.add_argument (new CCodeIdentifier ("user_data"));
+ get_path.add_argument (new CCodeConstant ("\"path\""));
+ get_path.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier ("path")));
+ get_path.add_argument (new CCodeConstant ("NULL"));
+ filter_block.add_statement (new CCodeExpressionStatement (get_path));
+
+ var ccheck = new CCodeFunctionCall (new CCodeIdentifier ("dbus_message_has_path"));
+ ccheck.add_argument (new CCodeIdentifier ("message"));
+ ccheck.add_argument (new CCodeIdentifier ("path"));
+
+ var object_filter_block = new CCodeBlock ();
+ filter_block.add_statement (new CCodeIfStatement (ccheck, object_filter_block));
+
+ handle_signals (iface, object_filter_block);
+
+ var free_path = new CCodeFunctionCall (new CCodeIdentifier ("g_free"));
+ free_path.add_argument (new CCodeIdentifier ("path"));
+ filter_block.add_statement (new CCodeExpressionStatement (free_path));
filter_block.add_statement (new CCodeReturnStatement (new CCodeIdentifier ("DBUS_HANDLER_RESULT_NOT_YET_HANDLED")));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]