diff --git a/runtime/Server.cpp b/runtime/Server.cpp index 7730184..e7964a7 100644 --- a/runtime/Server.cpp +++ b/runtime/Server.cpp @@ -79,7 +79,8 @@ Server::~Server() bool Server::Init() { - QSettings settings; + //QSettings settings; + QSettings settings(QCoreApplication::applicationDirPath() + "/pgadmin4.ini", QSettings::IniFormat); // Find the webapp QStringList paths; @@ -92,7 +93,15 @@ bool Server::Init() for (int i = 0; i < paths.size(); ++i) { QDir dir(QCoreApplication::applicationDirPath() + "/" + paths[i]); - m_appfile = dir.canonicalPath() + "/pgAdmin4.py"; + QFileInfo info(paths[i]); + if (info.isRelative()) { + //m_appfile = dir.canonicalPath() + "/pgAdmin4.py"; + m_appfile = dir.absolutePath() + "/pgAdmin4.py"; + } + else { + m_appfile = paths[i] + "/pgAdmin4.py"; + } + //qDebug() << "Webapp path: " << m_appfile; if (QFile::exists(m_appfile)) {