mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 06:37:17 +00:00
Fix #760, issue with language on windows
Fix the issue related to run.py qsettings not using the same options as in preferences.py
This commit is contained in:
@@ -66,6 +66,20 @@ def adjust_after_deserialization(v):
|
||||
return v
|
||||
|
||||
|
||||
def createQSettings():
|
||||
# Create a QSettings instance with the correct arguments.
|
||||
# On windows use an ini file in the AppDataLocation instead of registry if possible as it
|
||||
# makes it easier for a user to clear it out when there are issues.
|
||||
if ISWINDOWS:
|
||||
Locations = QStandardPaths.standardLocations(QStandardPaths.AppDataLocation)
|
||||
if Locations:
|
||||
return QSettings(op.join(Locations[0], "settings.ini"), QSettings.IniFormat)
|
||||
else:
|
||||
return QSettings()
|
||||
else:
|
||||
return QSettings()
|
||||
|
||||
|
||||
# About QRect conversion:
|
||||
# I think Qt supports putting basic structures like QRect directly in QSettings, but I prefer not
|
||||
# to rely on it and stay with generic structures.
|
||||
@@ -77,18 +91,7 @@ class Preferences(QObject):
|
||||
def __init__(self):
|
||||
QObject.__init__(self)
|
||||
self.reset()
|
||||
# On windows use an ini file in the AppDataLocation instead of registry if possible as it
|
||||
# makes it easier for a user to clear it out when there are issues.
|
||||
if ISWINDOWS:
|
||||
Locations = QStandardPaths.standardLocations(QStandardPaths.AppDataLocation)
|
||||
if Locations:
|
||||
self._settings = QSettings(
|
||||
op.join(Locations[0], "settings.ini"), QSettings.IniFormat
|
||||
)
|
||||
else:
|
||||
self._settings = QSettings()
|
||||
else:
|
||||
self._settings = QSettings()
|
||||
self._settings = createQSettings()
|
||||
|
||||
def _load_values(self, settings, get):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user