GNOME Bugzilla – Bug 770889
Port to GTask & GThreadPool, and fix some associated problems
Last modified: 2016-09-06 04:50:06 UTC
We should stop using GSimpleAsyncResult and GIOScheduler to stop all the deprecation warnings during the build. Some of the variables that should be tied to each invocation of gom_miner_refresh_db_async are now tied to the entire GomMimer instance. This will cause problems if a second invocation was to happen on the same GomMiner instance. See the patches.
Created attachment 334785 [details] [review] miner: Simplify code by creating the connection during construction
Created attachment 334786 [details] [review] miner: Let GomAccountMinerJob own a reference to the connection
Created attachment 334787 [details] [review] miner: Port gom_miner_refresh_db() to GTask
Created attachment 334788 [details] [review] miner: Port gom_account_miner_job_process() to GTask
Created attachment 334789 [details] [review] miner: Replace GIOScheduler with GThreadPool and idle GSource
Created attachment 334790 [details] [review] miner: Create the GTask before trying to return a GError
Created attachment 334791 [details] [review] miner: Remove a one-line convenience function
Created attachment 334792 [details] [review] miner: Pass the GTask around instead of using an instance variable
Created attachment 334793 [details] [review] miner: Get the cancellable from the GTask, not an instance variable
Created attachment 334794 [details] [review] src: Drop the GCancellable member from GomAccountMinerJob
Created attachment 334795 [details] [review] miner: Use a more descriptive name for the GomAccountMinerJob pointers
Created attachment 334796 [details] [review] miner: Don't use an instance variable for the list of pending jobs
So far, these patches seem to work as intended. I am going to test them a bit more, and unless someone finds something wrong with them, I will merge them tomorrow.
Pushed to master! Let me know if something goes wrong.