Add doc repo as submodule
[frida/frida.git] / src / core / Settings.cxx
1 #include "Settings.hxx"
2
3 Settings* Settings::instance = NULL;
4
5 Settings::Settings()
6 : QSettings("frida")
7 , logger(log4cxx::Logger::getLogger("core.Settings")) {
8 setIniCodec("UTF-8");
9 instance = this;
10
11 QStringList runtimePaths = QStandardPaths::standardLocations(QStandardPaths::RuntimeLocation);
12 if (! runtimePaths.empty() && (*runtimePaths.begin()) != "") {
13 LOG4CXX_DEBUG(logger, "Using runtime Path \"" << runtimePaths.begin()->toStdString() << "\" from list of length " << runtimePaths.length());
14 runtimeDirectory = new QDir(*runtimePaths.begin());
15 } else {
16 QTemporaryDir* dir = new QTemporaryDir();
17 if (dir->isValid()) {
18 runtimeDirectory = new QDir(dir->path());
19 LOG4CXX_INFO(logger, "Using custom runtime Path " << dir->path().toStdString());
20 } else {
21 LOG4CXX_ERROR(logger, "Could not create Runtime directory!");
22 }
23 }
24 }