summaryrefslogtreecommitdiff
path: root/codegen/valagdbusclientmodule.vala
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2017-05-01 11:15:56 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2017-05-17 11:35:36 +0200
commit90cf68c81c63f1332d8c12a5787f364464c184f7 (patch)
tree41ec2da645223bb859befea8f5e964e344a1eb68 /codegen/valagdbusclientmodule.vala
parentd259b5f92c21c1137e5eadbc13ebe894a5df197d (diff)
downloadvala-90cf68c81c63f1332d8c12a5787f364464c184f7.tar.gz
Require and target GLib >= 2.40
The next stable release of vala will happen 3.5 years after the release of GLib 2.40.0. https://bugzilla.gnome.org/show_bug.cgi?id=782005
Diffstat (limited to 'codegen/valagdbusclientmodule.vala')
-rw-r--r--codegen/valagdbusclientmodule.vala54
1 files changed, 18 insertions, 36 deletions
diff --git a/codegen/valagdbusclientmodule.vala b/codegen/valagdbusclientmodule.vala
index d986b24db..dd8b405eb 100644
--- a/codegen/valagdbusclientmodule.vala
+++ b/codegen/valagdbusclientmodule.vala
@@ -706,21 +706,12 @@ public class Vala.GDBusClientModule : GDBusModule {
CCodeFunctionCall res_wrapper = null;
// use wrapper as source_object wouldn't be correct otherwise
- if (context.require_glib_version (2, 36)) {
- ccall.add_argument (new CCodeIdentifier (generate_async_callback_wrapper ()));
- res_wrapper = new CCodeFunctionCall (new CCodeIdentifier ("g_task_new"));
- res_wrapper.add_argument (new CCodeCastExpression (new CCodeIdentifier ("self"), "GObject *"));
- res_wrapper.add_argument (new CCodeConstant ("NULL"));
- res_wrapper.add_argument (new CCodeIdentifier ("_callback_"));
- res_wrapper.add_argument (new CCodeIdentifier ("_user_data_"));
- } else {
- ccall.add_argument (new CCodeIdentifier (generate_async_callback_wrapper ()));
- res_wrapper = new CCodeFunctionCall (new CCodeIdentifier ("g_simple_async_result_new"));
- res_wrapper.add_argument (new CCodeCastExpression (new CCodeIdentifier ("self"), "GObject *"));
- res_wrapper.add_argument (new CCodeIdentifier ("_callback_"));
- res_wrapper.add_argument (new CCodeIdentifier ("_user_data_"));
- res_wrapper.add_argument (new CCodeConstant ("NULL"));
- }
+ ccall.add_argument (new CCodeIdentifier (generate_async_callback_wrapper ()));
+ res_wrapper = new CCodeFunctionCall (new CCodeIdentifier ("g_task_new"));
+ res_wrapper.add_argument (new CCodeCastExpression (new CCodeIdentifier ("self"), "GObject *"));
+ res_wrapper.add_argument (new CCodeConstant ("NULL"));
+ res_wrapper.add_argument (new CCodeIdentifier ("_callback_"));
+ res_wrapper.add_argument (new CCodeIdentifier ("_user_data_"));
ccall.add_argument (res_wrapper);
ccode.add_expression (ccall);
@@ -736,30 +727,21 @@ public class Vala.GDBusClientModule : GDBusModule {
ccall.add_argument (connection);
// unwrap async result
- if (context.require_glib_version (2, 36)) {
- ccode.add_declaration ("GAsyncResult", new CCodeVariableDeclarator ("*_inner_res"));
+ ccode.add_declaration ("GAsyncResult", new CCodeVariableDeclarator ("*_inner_res"));
- var inner_res = new CCodeFunctionCall (new CCodeIdentifier ("g_task_propagate_pointer"));
- inner_res.add_argument (new CCodeCastExpression (new CCodeIdentifier ("_res_"), "GTask *"));
- inner_res.add_argument (new CCodeConstant ("NULL"));
- ccode.add_assignment (new CCodeIdentifier ("_inner_res"), inner_res);
+ var inner_res = new CCodeFunctionCall (new CCodeIdentifier ("g_task_propagate_pointer"));
+ inner_res.add_argument (new CCodeCastExpression (new CCodeIdentifier ("_res_"), "GTask *"));
+ inner_res.add_argument (new CCodeConstant ("NULL"));
+ ccode.add_assignment (new CCodeIdentifier ("_inner_res"), inner_res);
- ccall.add_argument (new CCodeIdentifier ("_inner_res"));
- ccall.add_argument (error_argument);
- ccode.add_assignment (new CCodeIdentifier ("_reply_message"), ccall);
-
- // _inner_res is guaranteed to be non-NULL, so just unref it
- var unref_inner_res = new CCodeFunctionCall (new CCodeIdentifier ("g_object_unref"));
- unref_inner_res.add_argument (new CCodeIdentifier ("_inner_res"));
- ccode.add_expression (unref_inner_res);
- } else {
- var inner_res = new CCodeFunctionCall (new CCodeIdentifier ("g_simple_async_result_get_op_res_gpointer"));
- inner_res.add_argument (new CCodeCastExpression (new CCodeIdentifier ("_res_"), "GSimpleAsyncResult *"));
- ccall.add_argument (inner_res);
+ ccall.add_argument (new CCodeIdentifier ("_inner_res"));
+ ccall.add_argument (error_argument);
+ ccode.add_assignment (new CCodeIdentifier ("_reply_message"), ccall);
- ccall.add_argument (error_argument);
- ccode.add_assignment (new CCodeIdentifier ("_reply_message"), ccall);
- }
+ // _inner_res is guaranteed to be non-NULL, so just unref it
+ var unref_inner_res = new CCodeFunctionCall (new CCodeIdentifier ("g_object_unref"));
+ unref_inner_res.add_argument (new CCodeIdentifier ("_inner_res"));
+ ccode.add_expression (unref_inner_res);
}
if (call_type == CallType.SYNC || call_type == CallType.FINISH) {