On Tue, 2013-09-03 at 17:53 +0100, Martyn Russell wrote:
> Hi all,
> 
> Jürg, Philip, any chance of a quick review from you guys:
> 
>    https://git.gnome.org/browse/tracker/log/?h=fix-deprecations
> 
> Jürg, I actually couldn't see a GTask VAPI on my distro, I guess it's 
> available in later versions of Vala?


Compare these two APIs, I think you need to pass the cancellable as
parameter to g_task_new here:

https://developer.gnome.org/gio/2.36/gio-GIOScheduler.html#g-io-scheduler-push-job
https://developer.gnome.org/gio/2.36/GTask.html#g-task-new


                WritebackData *data;
+               GTask *task;
+
+               task = g_task_new (controller, NULL, NULL, NULL);
                data = writeback_data_new (controller,
                                           writeback_handlers,
                                           priv->connection,
                                           subject,
                                           results,
                                           invocation,
                                           request);
 
-               g_io_scheduler_push_job (io_writeback_job, data, NULL, 0,
-                                        data->cancellable);
+               g_task_set_task_data (task, data, NULL /*(GDestroyNotify) 
writeback_data_free */);
+               g_task_run_in_thread (task, io_writeback_job);
+               g_object_unref (task);


So it should go like this:


data = writeback_data_new (controller,
                           writeback_handlers,
                           priv->connection,
                           subject,
                           results,
                           invocation,
                           request);

task = g_task_new (controller, data->cancellable, NULL, NULL); 




-- 
Philip Van Hoof
Software developer
Codeminded BVBA - http://codeminded.be

_______________________________________________
tracker-list mailing list
tracker-list@gnome.org
https://mail.gnome.org/mailman/listinfo/tracker-list

Reply via email to