forked from qt-creator/qt-creator
Valgrind: Replace QDir::separator with slash
Change-Id: I8f8192dc065702cb1c6bb218b8d992bb9775cd10 Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -200,7 +200,7 @@ void CallgrindController::getLocalDataFile()
|
||||
arg(m_valgrindProc->pid());
|
||||
const QString workingDir = m_valgrindProc->workingDirectory();
|
||||
// first, set the to-be-parsed file to callgrind.out.PID
|
||||
QString fileName = workingDir.isEmpty() ? baseFileName : (workingDir + QDir::separator() + baseFileName);
|
||||
QString fileName = workingDir.isEmpty() ? baseFileName : (workingDir + QLatin1Char('/') + baseFileName);
|
||||
|
||||
if (!m_valgrindProc->isLocal()) {
|
||||
///TODO: error handling
|
||||
@@ -217,7 +217,7 @@ void CallgrindController::getLocalDataFile()
|
||||
QStringList outputFiles = dir.entryList();
|
||||
// if there are files like callgrind.out.PID.NUM, set it to the most recent one of those
|
||||
if (!outputFiles.isEmpty())
|
||||
fileName = workingDir + QDir::separator() + dir.entryList().first();
|
||||
fileName = workingDir + QLatin1Char('/') + dir.entryList().first();
|
||||
|
||||
emit localParseDataAvailable(fileName);
|
||||
}
|
||||
@@ -237,7 +237,7 @@ void CallgrindController::foundRemoteFile()
|
||||
void CallgrindController::sftpInitialized()
|
||||
{
|
||||
cleanupTempFile();
|
||||
QTemporaryFile dataFile(QDir::tempPath() + QDir::separator() + QLatin1String("callgrind.out."));
|
||||
QTemporaryFile dataFile(QDir::tempPath() + QLatin1Char('/') + QLatin1String("callgrind.out."));
|
||||
QTC_ASSERT(dataFile.open(), return);
|
||||
m_tempDataFile = dataFile.fileName();
|
||||
dataFile.setAutoRemove(false);
|
||||
|
||||
@@ -92,7 +92,7 @@ static QString makeFrameName(const Frame &frame, const QString &relativeTo,
|
||||
const QString d = frame.directory();
|
||||
const QString f = frame.file();
|
||||
const QString fn = frame.functionName();
|
||||
const QString fullPath = d + QDir::separator() + f;
|
||||
const QString fullPath = d + QLatin1Char('/') + f;
|
||||
|
||||
QString path;
|
||||
if (!d.isEmpty() && !f.isEmpty())
|
||||
@@ -109,12 +109,12 @@ static QString makeFrameName(const Frame &frame, const QString &relativeTo,
|
||||
if (frame.line() != -1)
|
||||
path += QLatin1Char(':') + QString::number(frame.line());
|
||||
|
||||
path = path.toHtmlEscaped();
|
||||
path = QDir::toNativeSeparators(path.toHtmlEscaped());
|
||||
|
||||
if (link && !f.isEmpty() && QFile::exists(fullPath)) {
|
||||
// make a hyperlink label
|
||||
path = QString::fromLatin1("<a href=\"file://%1:%2\" %4>%3</a>")
|
||||
.arg(fullPath, QString::number(frame.line()), path, linkAttr);
|
||||
.arg(fullPath).arg(frame.line()).arg(path).arg(linkAttr);
|
||||
}
|
||||
|
||||
if (!fn.isEmpty())
|
||||
@@ -130,8 +130,9 @@ static QString relativeToPath()
|
||||
const ProjectExplorer::Project *project = ProjectExplorer::SessionManager::startupProject();
|
||||
|
||||
QString relativeTo(project ? project->projectDirectory().toString() : QDir::homePath());
|
||||
if (!relativeTo.endsWith(QDir::separator()))
|
||||
relativeTo.append(QDir::separator());
|
||||
const QChar slash = QLatin1Char('/');
|
||||
if (!relativeTo.endsWith(slash))
|
||||
relativeTo.append(slash);
|
||||
|
||||
return relativeTo;
|
||||
}
|
||||
|
||||
@@ -455,7 +455,7 @@ void MemcheckTool::engineStarting(const AnalyzerRunControl *engine)
|
||||
|
||||
QString dir;
|
||||
if (RunConfiguration *rc = engine->runConfiguration())
|
||||
dir = rc->target()->project()->projectDirectory().toString() + QDir::separator();
|
||||
dir = rc->target()->project()->projectDirectory().toString() + QLatin1Char('/');
|
||||
|
||||
const MemcheckRunControl *mEngine = dynamic_cast<const MemcheckRunControl *>(engine);
|
||||
QTC_ASSERT(mEngine, return);
|
||||
|
||||
@@ -113,7 +113,7 @@ QString ErrorListModel::Private::formatAbsoluteFilePath(const Error &error) cons
|
||||
{
|
||||
const Frame f = findRelevantFrame(error);
|
||||
if (!f.directory().isEmpty() && !f.file().isEmpty())
|
||||
return QString(f.directory() + QDir::separator() + f.file());
|
||||
return f.directory() + QLatin1Char('/') + f.file();
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ QString toolTipForFrame(const Frame &frame)
|
||||
{
|
||||
QString location;
|
||||
if (!frame.file().isEmpty()) {
|
||||
location = frame.directory() + QDir::separator() + frame.file();
|
||||
location = frame.directory() + QLatin1Char('/') + frame.file();
|
||||
if (frame.line() > 0)
|
||||
location += QLatin1Char(':') + QString::number(frame.line());
|
||||
}
|
||||
|
||||
@@ -65,8 +65,8 @@ static QString makeName(const Frame &frame)
|
||||
if (!fn.isEmpty())
|
||||
return fn;
|
||||
if (!d.isEmpty() && !f.isEmpty())
|
||||
return frame.line() > 0 ? QString::fromLatin1("%1%2%3:%4").arg(d, QDir::separator(), f, QString::number(frame.line()))
|
||||
: QString::fromLatin1("%1%2%3").arg(d, QDir::separator(), f);
|
||||
return frame.line() > 0 ? QString::fromLatin1("%1/%2:%3").arg(d, f).arg(frame.line())
|
||||
: QString::fromLatin1("%1/%2").arg(d, f);
|
||||
return frame.object();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user