Ensure only one instance is running and publish company info.

This commit is contained in:
2025-03-08 12:23:59 +01:00
parent 35c977c89e
commit f5b32d6621
3 changed files with 40 additions and 4 deletions

View File

@@ -249,8 +249,12 @@ class ConfigLoader(QObject):
self.__saveConfig()
@Slot(result = dict)
def getCompanyInfo():
return self.__config['company']
def getCompanyInfo(self):
try:
return self.__config['company']
except KeyError as ex:
print(f"Missing company info: {ex}")
return None
@Slot(dict)
def saveMiscConf(self, misc_conf = None):
@@ -259,7 +263,11 @@ class ConfigLoader(QObject):
@Slot(result = bool)
def systray(self):
return self.__config['misc']['SYSTRAY']
try:
return self.__config['misc']['SYSTRAY']
except KeyError as ex:
print(f"Missing configuration: {ex}")
return False
@Slot(str, str)