Commit e6779aae authored by dt's avatar dt
Browse files

Use QT_INSTALL_DATA instead of path() for searching the debugger helper

parent 8261498c
...@@ -171,9 +171,16 @@ QString CMakeManager::findQtDir(const ProjectExplorer::Environment &env) ...@@ -171,9 +171,16 @@ QString CMakeManager::findQtDir(const ProjectExplorer::Environment &env)
QFileInfo qmake(path + "/" + possibleCommand); QFileInfo qmake(path + "/" + possibleCommand);
if (qmake.exists()) { if (qmake.exists()) {
if (!qtVersionForQMake(qmake.absoluteFilePath()).isNull()) { if (!qtVersionForQMake(qmake.absoluteFilePath()).isNull()) {
QDir dir(qmake.absoluteDir()); QProcess proc;
dir.cdUp(); proc.start(qmake.absoluteFilePath(), QStringList() << "-query" << "QT_INSTALL_DATA");
return dir.absolutePath(); if (proc.waitForFinished()) {
return proc.readAll().trimmed();
} else {
proc.kill();
QDir dir(qmake.absoluteDir());
dir.cdUp();
return dir.absolutePath();
}
} }
} }
} }
......
...@@ -870,9 +870,12 @@ void QtVersion::setPath(const QString &path) ...@@ -870,9 +870,12 @@ void QtVersion::setPath(const QString &path)
QString QtVersion::dumperLibrary() const QString QtVersion::dumperLibrary() const
{ {
uint hash = qHash(path()); uint hash = qHash(path());
QString qtInstallData = versionInfo().value("QT_INSTALL_DATA");
if (qtInstallData.isEmpty())
qtInstallData = path();
QStringList directories; QStringList directories;
directories directories
<< (path() + "/qtc-debugging-helper/") << (qtInstallData + "/qtc-debugging-helper/")
<< (QApplication::applicationDirPath() + "/../qtc-debugging-helper/" + QString::number(hash)) + "/" << (QApplication::applicationDirPath() + "/../qtc-debugging-helper/" + QString::number(hash)) + "/"
<< (QDesktopServices::storageLocation(QDesktopServices::DataLocation) + "/qtc-debugging-helper/" + QString::number(hash)) + "/"; << (QDesktopServices::storageLocation(QDesktopServices::DataLocation) + "/qtc-debugging-helper/" + QString::number(hash)) + "/";
foreach(const QString &directory, directories) { foreach(const QString &directory, directories) {
...@@ -1390,9 +1393,12 @@ QString QtVersion::buildDebuggingHelperLibrary() ...@@ -1390,9 +1393,12 @@ QString QtVersion::buildDebuggingHelperLibrary()
QString output; QString output;
uint hash = qHash(path()); uint hash = qHash(path());
QString qtInstallData = versionInfo().value("QT_INSTALL_DATA");
if (qtInstallData.isEmpty())
qtInstallData = path();
QStringList directories; QStringList directories;
directories directories
<< path() + "/qtc-debugging-helper/" << qtInstallData + "/qtc-debugging-helper/"
<< QApplication::applicationDirPath() + "/../qtc-debugging-helper/" + QString::number(hash) +"/" << QApplication::applicationDirPath() + "/../qtc-debugging-helper/" + QString::number(hash) +"/"
<< QDesktopServices::storageLocation (QDesktopServices::DataLocation) + "/qtc-debugging-helper/" + QString::number(hash) +"/"; << QDesktopServices::storageLocation (QDesktopServices::DataLocation) + "/qtc-debugging-helper/" + QString::number(hash) +"/";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment