src/core/BasicBlock.cxx
src/core/Comment.cxx
src/core/Function.cxx
+ src/core/Settings.cxx
src/gui/Mainwindow.cxx
src/gui/widgets/BasicBlockWidget.cxx
src/gui/widgets/CFGScene.cxx
SET(frida_HEADERS
src/include_llvm.hxx
src/core/InformationManager.hxx
+ src/core/Settings.hxx
src/qt.hxx
src/gui/Mainwindow.hxx
src/gui/widgets/BasicBlockWidget.hxx
--- /dev/null
+#include "Settings.hxx"
+
+Settings* Settings::instance = NULL;
+
+Settings::Settings()
+ : QSettings("frida")
+ , logger(log4cxx::Logger::getLogger("core.Settings")) {
+ setIniCodec("UTF-8");
+ instance = this;
+
+ QStringList runtimePaths = QStandardPaths::standardLocations(QStandardPaths::RuntimeLocation);
+ if (! runtimePaths.empty() && (*runtimePaths.begin()) != "") {
+ LOG4CXX_DEBUG(logger, "Using runtime Path \"" << runtimePaths.begin()->toStdString() << "\" from list of length " << runtimePaths.length());
+ runtimeDirectory = new QDir(*runtimePaths.begin());
+ } else {
+ QTemporaryDir* dir = new QTemporaryDir();
+ if (dir->isValid()) {
+ runtimeDirectory = new QDir(dir->path());
+ LOG4CXX_INFO(logger, "Using custom runtime Path " << dir->path().toStdString());
+ } else {
+ LOG4CXX_ERROR(logger, "Could not create Runtime directory!");
+ }
+ }
+}
--- /dev/null
+#ifndef INCLUDE__Settings_hxx
+#define INCLUDE__Settings_hxx
+
+#include "qt.hxx"
+#include "log4cxx/logger.h"
+
+class Settings : public QSettings {
+public:
+ QDir* getRuntimeDirectory() const {return runtimeDirectory;}
+ static Settings* get() {return instance;}
+private:
+ Settings();
+
+ static Settings* instance;
+ log4cxx::LoggerPtr logger;
+ QDir* runtimeDirectory;
+
+ friend int main(int argc, char** argv);
+};
+
+#endif /* INCLUDE__Settings_hxx */
#include "gui/Mainwindow.hxx"
#include "core/InformationManager.hxx"
+#include "core/Settings.hxx"
#include "disassembler/llvm/LLVMDisassembler.hxx"
#include "Config.hxx"
#endif
log4cxx::Logger::getRootLogger()->setLevel(level);
+ Settings settings;
InformationManager iman;
LOG4CXX_DEBUG(_logger, "Initializing LLVM");