Mercurial > hg > tony
diff main/main.cpp @ 592:164fa1ee2642
Fix calculation of Vamp path based on application file name
author | Chris Cannam |
---|---|
date | Tue, 17 Sep 2019 11:25:37 +0100 |
parents | 2090dd9bfbc1 |
children | b76234d1a217 |
line wrap: on
line diff
--- a/main/main.cpp Wed Sep 11 15:25:09 2019 +0100 +++ b/main/main.cpp Tue Sep 17 11:25:37 2019 +0100 @@ -160,19 +160,28 @@ #endif if (tonyVampPath == "") { - tonyVampPath = QApplication::applicationDirPath(); + + QString appName = QApplication::applicationName(); + QString myDir = QApplication::applicationDirPath(); + QString binaryName = QFileInfo(QCoreApplication::arguments().at(0)) + .fileName(); #ifdef Q_OS_WIN32 QString programFiles = getEnvQStr("ProgramFiles"); if (programFiles == "") programFiles = "C:\\Program Files"; - QString defaultTonyPath(programFiles + "\\Tony"); - tonyVampPath = tonyVampPath + sep + defaultTonyPath; + QString pfPath(programFiles + "\\" + appName); + myVampPath = myDir + sep + pfPath; #else #ifdef Q_OS_MAC - tonyVampPath = tonyVampPath + "/../Resources:" + tonyVampPath; + myVampPath = myDir + "/../Resources"; #else - QString defaultTonyPath("/usr/local/lib/tony:/usr/lib/tony"); - tonyVampPath = tonyVampPath + sep + defaultTonyPath; + if (binaryName != "") { + myVampPath = + myDir + "/../lib/" + binaryName + sep; + } + myVampPath = myVampPath + + myDir + "/../lib/" + appName + sep + + myDir; #endif #endif }