Changed the daemon check approach in other places, where it makes sense

Dmitri Bogomolov 6 years ago
parent 1b921a718c
commit 0c4d4de82f
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

@ -66,7 +66,7 @@ class singleCleaner(threading.Thread, StoppableThread):
# If we are running as a daemon then we are going to fill up the UI
# queue which will never be handled by a UI. We should clear it to
# save memory.
if BMConfigParser().safeGetBoolean('bitmessagesettings', 'daemon'):
if shared.thisapp.daemon:
if timeWeLastClearedInventoryAndPubkeysTables < int(time.time()) - 7380:
timeWeLastClearedInventoryAndPubkeysTables = int(time.time())

@ -3,7 +3,6 @@ import Queue
import threading
import time
from bmconfigparser import BMConfigParser
from debug import logger
from helper_sql import sqlQuery, sqlStoredProcedure
from helper_threading import StoppableThread
@ -60,7 +59,7 @@ def doCleanShutdown():
except Queue.Empty:
if BMConfigParser().safeGetBoolean('bitmessagesettings','daemon'):
if shared.thisapp.daemon:'Clean shutdown complete.')

@ -1,6 +1,6 @@
import os
from bmconfigparser import BMConfigParser
import shared
# This is used so that the translateText function can be used when we are in daemon mode and not using any QT functions.
class translateClass:
@ -17,7 +17,7 @@ def _translate(context, text, disambiguation = None, encoding = None, n = None):
return translateText(context, text, n)
def translateText(context, text, n = None):
if not BMConfigParser().safeGetBoolean('bitmessagesettings', 'daemon'):
if not shared.thisapp.daemon:
from PyQt4 import QtCore, QtGui
except Exception as err: