diff options
author | Seif Lotfy <seif@lotfy.com> | 2013-02-27 19:22:37 +0100 |
---|---|---|
committer | Seif Lotfy <seif@lotfy.com> | 2013-02-27 19:22:37 +0100 |
commit | db3acc1d481cf509429a00f7ab87ffed0deac0d0 (patch) | |
tree | 20b110fc36873663cad121e9b545641141abba24 /libzeitgeist | |
parent | b72ded1aaf3a5bdae2d97d4d52acb8f40cd7e21e (diff) | |
download | zeitgeist-db3acc1d481cf509429a00f7ab87ffed0deac0d0.tar.gz |
fix spacing and move threadpool init to on_connection_established
Diffstat (limited to 'libzeitgeist')
-rw-r--r-- | libzeitgeist/log.vala | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/libzeitgeist/log.vala b/libzeitgeist/log.vala index e67cfeed..9116abfc 100644 --- a/libzeitgeist/log.vala +++ b/libzeitgeist/log.vala @@ -83,14 +83,6 @@ public class Log : QueuedProxyWrapper public Log () { monitors = new HashTable<Monitor, int>(direct_hash, direct_equal); - try { - threads = new ThreadPool<DbWorker>.with_owned_data((worker) => { - worker.run (); - }, get_nprocs_conf (), true); - } catch (ThreadError err) { - warning("%s\n", err.message); - } - MainLoop mainloop = new MainLoop(); Bus.get_proxy.begin<RemoteLog> (BusType.SESSION, Utils.ENGINE_DBUS_NAME, @@ -140,9 +132,16 @@ public class Log : QueuedProxyWrapper engine_version = proxy.version; warn_if_fail (engine_version.get_type_string () == "(iii)"); - if (proxy.datapath != null && proxy.datapath != ":memory:" && - FileUtils.test (proxy.datapath, GLib.FileTest.EXISTS) && - threads != null) { + try { + threads = new ThreadPool<DbWorker>.with_owned_data ((worker) => { + worker.run (); + }, get_nprocs_conf (), true); + } catch (ThreadError err) { + warning ("%s\n", err.message); + } + + if (threads != null && proxy.datapath != ":memory:" && + FileUtils.test (proxy.datapath, GLib.FileTest.EXISTS)) { Utils.set_database_file_path (proxy.datapath); try { dbreader = new DbReader (); @@ -277,7 +276,7 @@ public class Log : QueuedProxyWrapper result_set = new SimpleResultSet (result); Idle.add ((owned) callback); } catch (EngineError err) { - warning("%s\n", err.message); + warning ("%s", err.message); } return null; }; @@ -334,7 +333,7 @@ public class Log : QueuedProxyWrapper storage_state, num_events, result_type); Idle.add ((owned) callback); } catch (EngineError err) { - warning("%s\n", err.message); + warning ("%s", err.message); } return null; }; @@ -386,7 +385,7 @@ public class Log : QueuedProxyWrapper result_set = new SimpleResultSet (result); Idle.add ((owned) callback); } catch (EngineError err) { - warning("%s\n", err.message); + warning ("%s", err.message); } return null; }; @@ -433,7 +432,7 @@ public class Log : QueuedProxyWrapper result_event_templates, storage_state, num_events, result_type); Idle.add ((owned) callback); } catch (EngineError err) { - warning("%s\n", err.message); + warning ("%s", err.message); } return null; }; |