History

don't force use of Settings to all QCoreApplication

Stephen Birarda committed 11 years ago

Commit ddb52341 parent 83cd50c5 files · +14 −11Browse files

Showing the changes to libraries/shared/src/SettingInterface.cpp (1 of 5 files). Show all

Unified · Split

libraries/shared/src/SettingInterface.cpp+4−7
@@ -36,7 +36,7 @@ namespace Setting { · 35 unmodified lines
36 }36 }
37 37
38 // Sets up the settings private instance. Should only be run once at startup38 // Sets up the settings private instance. Should only be run once at startup
39 void setupPrivateInstance() {39 void init() {
40 // read the ApplicationInfo.ini file for Name/Version/Domain information40 // read the ApplicationInfo.ini file for Name/Version/Domain information
41 QSettings::setDefaultFormat(QSettings::IniFormat);41 QSettings::setDefaultFormat(QSettings::IniFormat);
42 QSettings applicationInfo(PathUtils::resourcesPath() + "info/ApplicationInfo.ini", QSettings::IniFormat);42 QSettings applicationInfo(PathUtils::resourcesPath() + "info/ApplicationInfo.ini", QSettings::IniFormat);
@@ -59,14 +59,11 @@ namespace Setting { · 16 unmodified lines
59 QObject::connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));59 QObject::connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
60 privateInstance->moveToThread(thread);60 privateInstance->moveToThread(thread);
61 thread->start();61 thread->start();
62 qCDebug(shared) << "Settings thread started.";62 qCDebug(shared) << "Settings thread started.";
63 63
64 // Register cleanupPrivateInstance to run inside QCoreApplication's destructor.64 // Register cleanupPrivateInstance to run inside QCoreApplication's destructor.
65 qAddPostRoutine(cleanupPrivateInstance);65 qAddPostRoutine(cleanupPrivateInstance);
66 }66 }
67 // Register setupPrivateInstance to run after QCoreApplication's constructor.
68 Q_COREAPP_STARTUP_FUNCTION(setupPrivateInstance)
69
70 67
71 Interface::~Interface() {68 Interface::~Interface() {
72 if (privateInstance) {69 if (privateInstance) {