QmlProfiler: Add a binary trace format

Storing traces in binary form is preferable as loading and saving is
faster and the trace files are smaller.

Change-Id: Ia7340ac526d5ce9391b1e32fc48fc1fab3ffa13d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Ulf Hermann
2016-05-10 13:27:48 +02:00
parent d6d69b811a
commit ecd8e764dd
7 changed files with 205 additions and 72 deletions

View File

@@ -615,13 +615,15 @@ void saveLastTraceFile(const QString &filename)
void QmlProfilerTool::showSaveDialog()
{
QLatin1String tFile(QtdFileExtension);
QLatin1String zFile(QztFileExtension);
QString filename = QFileDialog::getSaveFileName(
ICore::mainWindow(), tr("Save QML Trace"),
QmlProfilerPlugin::globalSettings()->lastTraceFile(),
tr("QML traces (*%1)").arg(QLatin1String(TraceFileExtension)));
tr("QML traces (*%1 *%2)").arg(zFile).arg(tFile));
if (!filename.isEmpty()) {
if (!filename.endsWith(QLatin1String(TraceFileExtension)))
filename += QLatin1String(TraceFileExtension);
if (!filename.endsWith(zFile) && !filename.endsWith(tFile))
filename += zFile;
saveLastTraceFile(filename);
Debugger::enableMainWindow(false);
d->m_profilerModelManager->save(filename);
@@ -635,10 +637,12 @@ void QmlProfilerTool::showLoadDialog()
Debugger::selectPerspective(QmlProfilerPerspectiveId);
QLatin1String tFile(QtdFileExtension);
QLatin1String zFile(QztFileExtension);
QString filename = QFileDialog::getOpenFileName(
ICore::mainWindow(), tr("Load QML Trace"),
QmlProfilerPlugin::globalSettings()->lastTraceFile(),
tr("QML traces (*%1)").arg(QLatin1String(TraceFileExtension)));
tr("QML traces (*%1 *%2)").arg(zFile).arg(tFile));
if (!filename.isEmpty()) {
saveLastTraceFile(filename);