[gnome-documents] miners: don't use a timeout for miner refresh methods



commit 2a1e68ca5afdd90337f5a3d9dd1110fdfce4d3f6
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Oct 25 09:48:08 2012 -0400

    miners: don't use a timeout for miner refresh methods
    
    Since it can possibly take very long; use GLib.MAXINT to remove any
    timeout from these bus calls.

 src/miners.js |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/src/miners.js b/src/miners.js
index d6bb5ba..988c468 100644
--- a/src/miners.js
+++ b/src/miners.js
@@ -21,6 +21,7 @@
  */
 
 const Gio = imports.gi.Gio;
+const GLib = imports.gi.GLib;
 
 const MinerIface = <interface name="org.gnome.Documents.Miner">
     <method name="RefreshDB" />
@@ -28,14 +29,18 @@ const MinerIface = <interface name="org.gnome.Documents.Miner">
 
 var MinerProxy = Gio.DBusProxy.makeProxyWrapper(MinerIface);
 
-function GDataMiner(iface, path) {
-    return new MinerProxy(Gio.DBus.session,
-                          'org.gnome.Documents.GDataMiner',
-                          '/org/gnome/Documents/GDataMiner');
+function _makeMinerProxy(iface, path) {
+    let miner = new MinerProxy(Gio.DBus.session, iface, path);
+    miner.set_default_timeout(GLib.MAXINT32);
+    return miner;
 }
 
-function ZpjMiner(iface, path) {
-    return new MinerProxy(Gio.DBus.session,
-                          'org.gnome.Documents.ZpjMiner',
-                          '/org/gnome/Documents/ZpjMiner');
+function GDataMiner() {
+    return _makeMinerProxy('org.gnome.Documents.GDataMiner',
+                           '/org/gnome/Documents/GDataMiner');
+}
+
+function ZpjMiner() {
+    return _makeMinerProxy('org.gnome.Documents.ZpjMiner',
+                           '/org/gnome/Documents/ZpjMiner');
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]