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"
|
" q, quit\n"
|
||||||
" Terminate program.";
|
" Terminate program.";
|
||||||
|
|
||||||
|
static const char TraceFileExtension[] = ".qtd";
|
||||||
|
|
||||||
QmlProfilerApplication::QmlProfilerApplication(int &argc, char **argv) :
|
QmlProfilerApplication::QmlProfilerApplication(int &argc, char **argv) :
|
||||||
QCoreApplication(argc, argv),
|
QCoreApplication(argc, argv),
|
||||||
m_runMode(LaunchMode),
|
m_runMode(LaunchMode),
|
||||||
@@ -187,15 +189,15 @@ void QmlProfilerApplication::printCommands()
|
|||||||
QString QmlProfilerApplication::traceFileName() const
|
QString QmlProfilerApplication::traceFileName() const
|
||||||
{
|
{
|
||||||
QString fileName = m_tracePrefix + "_" +
|
QString fileName = m_tracePrefix + "_" +
|
||||||
QDateTime::currentDateTime().toString("yyMMdd_hhmmss") + ".xml";
|
QDateTime::currentDateTime().toString("yyMMdd_hhmmss") + TraceFileExtension;
|
||||||
if (QFileInfo(fileName).exists()) {
|
if (QFileInfo(fileName).exists()) {
|
||||||
QString baseName;
|
QString baseName;
|
||||||
int suffixIndex = 0;
|
int suffixIndex = 0;
|
||||||
do {
|
do {
|
||||||
baseName = QFileInfo(fileName).baseName()
|
baseName = QFileInfo(fileName).baseName()
|
||||||
+ QString::number(suffixIndex++);
|
+ QString::number(suffixIndex++);
|
||||||
} while (QFileInfo(baseName + ".xml").exists());
|
} while (QFileInfo(baseName + TraceFileExtension).exists());
|
||||||
fileName = baseName + ".xml";
|
fileName = baseName + TraceFileExtension;
|
||||||
}
|
}
|
||||||
return fileName;
|
return fileName;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user