mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-06 03:04:13 +02:00
Merge pull request #1254 from ispyisail/fix/settings-dir-macos
Fix #1246: QET_SETTINGS_DIR reads the wrong folder on macOS
This commit is contained in:
@@ -112,6 +112,12 @@ int main(int argc, char **argv)
|
||||
// system (issue #1178). Set before anything reads a setting.
|
||||
const QString settings_dir = qEnvironmentVariable("QET_SETTINGS_DIR");
|
||||
if (!settings_dir.isEmpty()) {
|
||||
#ifdef Q_OS_DARWIN
|
||||
// On macOS, Qt names that subfolder after the organization domain
|
||||
// when there is one (<folder>/qelectrotech.org/) (issue #1246).
|
||||
// Nothing in QElectroTech reads the domain.
|
||||
QCoreApplication::setOrganizationDomain(QString());
|
||||
#endif
|
||||
QSettings::setDefaultFormat(QSettings::IniFormat);
|
||||
QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, settings_dir);
|
||||
QSettings::setPath(QSettings::IniFormat, QSettings::SystemScope, settings_dir);
|
||||
|
||||
Reference in New Issue
Block a user