forked from qt-creator/qt-creator
Valgrind: some more FilePath in heob code
Change-Id: I53603b1a984bedd0a9d04aab9f6fbc38d9feee21 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -751,7 +751,7 @@ void MemcheckToolPrivate::heobAction()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString executable = sr.command.executable().toString();
|
FilePath executable = sr.command.executable();
|
||||||
const QString workingDirectory = Utils::FileUtils::normalizePathName(sr.workingDirectory.toString());
|
const QString workingDirectory = Utils::FileUtils::normalizePathName(sr.workingDirectory.toString());
|
||||||
const QString commandLineArguments = sr.command.arguments();
|
const QString commandLineArguments = sr.command.arguments();
|
||||||
const QStringList envStrings = sr.environment.toStringList();
|
const QStringList envStrings = sr.environment.toStringList();
|
||||||
@@ -763,10 +763,10 @@ void MemcheckToolPrivate::heobAction()
|
|||||||
TaskHub::requestPopup();
|
TaskHub::requestPopup();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!QFile::exists(executable))
|
if (!executable.exists())
|
||||||
executable = Utils::HostOsInfo::withExecutableSuffix(executable);
|
executable = executable.withExecutableSuffix();
|
||||||
if (!QFile::exists(executable)) {
|
if (!executable.exists()) {
|
||||||
const QString msg = MemcheckTool::tr("Heob: Cannot find %1.").arg(executable);
|
const QString msg = MemcheckTool::tr("Heob: Cannot find %1.").arg(executable.toUserOutput());
|
||||||
TaskHub::addTask(Task::Error, msg, Debugger::Constants::ANALYZERTASK_ID);
|
TaskHub::addTask(Task::Error, msg, Debugger::Constants::ANALYZERTASK_ID);
|
||||||
TaskHub::requestPopup();
|
TaskHub::requestPopup();
|
||||||
return;
|
return;
|
||||||
@@ -774,8 +774,11 @@ void MemcheckToolPrivate::heobAction()
|
|||||||
|
|
||||||
// make executable a relative path if possible
|
// make executable a relative path if possible
|
||||||
const QString wdSlashed = workingDirectory + '/';
|
const QString wdSlashed = workingDirectory + '/';
|
||||||
if (executable.startsWith(wdSlashed, Qt::CaseInsensitive))
|
QString executablePath = executable.path();
|
||||||
executable.remove(0, wdSlashed.size());
|
if (executablePath.startsWith(wdSlashed, Qt::CaseInsensitive)) {
|
||||||
|
executablePath.remove(0, wdSlashed.size());
|
||||||
|
executable.setPath(executablePath);
|
||||||
|
}
|
||||||
|
|
||||||
// heob arguments
|
// heob arguments
|
||||||
HeobDialog dialog(Core::ICore::dialogParent());
|
HeobDialog dialog(Core::ICore::dialogParent());
|
||||||
@@ -822,7 +825,7 @@ void MemcheckToolPrivate::heobAction()
|
|||||||
QFile::remove(xmlPath);
|
QFile::remove(xmlPath);
|
||||||
|
|
||||||
// full command line
|
// full command line
|
||||||
QString arguments = heob + heobArguments + " \"" + executable + '\"';
|
QString arguments = heob + heobArguments + " \"" + executable.path() + '\"';
|
||||||
if (!commandLineArguments.isEmpty())
|
if (!commandLineArguments.isEmpty())
|
||||||
arguments += ' ' + commandLineArguments;
|
arguments += ' ' + commandLineArguments;
|
||||||
QByteArray argumentsCopy(reinterpret_cast<const char *>(arguments.utf16()), arguments.size() * 2 + 2);
|
QByteArray argumentsCopy(reinterpret_cast<const char *>(arguments.utf16()), arguments.size() * 2 + 2);
|
||||||
|
Reference in New Issue
Block a user