From 652312347d614c837d38e6699bad25c79ccf889f Mon Sep 17 00:00:00 2001 From: Christiaan Janssen Date: Mon, 22 Aug 2011 16:43:03 +0200 Subject: [PATCH] QmlProfiler: fixed file extension in standalone tool Change-Id: I8699bb22b3f8ca6289e0378f3fe3d8d2a7e67013 Reviewed-on: http://codereview.qt.nokia.com/3326 Reviewed-by: Qt Sanity Bot Reviewed-by: Kai Koehne --- src/tools/qmlprofiler/qmlprofilerapplication.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/tools/qmlprofiler/qmlprofilerapplication.cpp b/src/tools/qmlprofiler/qmlprofilerapplication.cpp index e882c5f6fc..dcfc7017c8 100644 --- a/src/tools/qmlprofiler/qmlprofilerapplication.cpp +++ b/src/tools/qmlprofiler/qmlprofilerapplication.cpp @@ -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; } -- 2.11.0