forked from qt-creator/qt-creator
QmlProfiler: fixed file extension in standalone tool
Change-Id: I8699bb22b3f8ca6289e0378f3fe3d8d2a7e67013 Reviewed-on: http://codereview.qt.nokia.com/3326 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
@@ -71,6 +71,8 @@ static const char commandTextC[] =
|
||||
" q, quit\n"
|
||||
" Terminate program.";
|
||||
|
||||
static const char TraceFileExtension[] = ".qtd";
|
||||
|
||||
QmlProfilerApplication::QmlProfilerApplication(int &argc, char **argv) :
|
||||
QCoreApplication(argc, argv),
|
||||
m_runMode(LaunchMode),
|
||||
@@ -187,15 +189,15 @@ void QmlProfilerApplication::printCommands()
|
||||
QString QmlProfilerApplication::traceFileName() const
|
||||
{
|
||||
QString fileName = m_tracePrefix + "_" +
|
||||
QDateTime::currentDateTime().toString("yyMMdd_hhmmss") + ".xml";
|
||||
QDateTime::currentDateTime().toString("yyMMdd_hhmmss") + TraceFileExtension;
|
||||
if (QFileInfo(fileName).exists()) {
|
||||
QString baseName;
|
||||
int suffixIndex = 0;
|
||||
do {
|
||||
baseName = QFileInfo(fileName).baseName()
|
||||
+ QString::number(suffixIndex++);
|
||||
} while (QFileInfo(baseName + ".xml").exists());
|
||||
fileName = baseName + ".xml";
|
||||
} while (QFileInfo(baseName + TraceFileExtension).exists());
|
||||
fileName = baseName + TraceFileExtension;
|
||||
}
|
||||
return fileName;
|
||||
}
|
||||
|
Reference in New Issue
Block a user