diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-09-11 16:55:46 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-09-15 13:06:44 +0000 |
commit | a324694671f5fc51bfdabbc6a83f45be79855957 (patch) | |
tree | 3f7bc649116832456ea703d24e11e6c66fea41d1 /src/plugins/qmlprofiler/qmlprofilersettings.cpp | |
parent | 05388a7229ad3111f3d4ecf5b4b9db39d20398d6 (diff) |
QmlProfiler: Persist the last trace file loaded or saved
This is quite handy if you keep all your traces in one directory.
Change-Id: I09842404493c02fb0ca9c4a328950f7b6dcb5be0
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/plugins/qmlprofiler/qmlprofilersettings.cpp')
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilersettings.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilersettings.cpp b/src/plugins/qmlprofiler/qmlprofilersettings.cpp index 7e1a4a5e1a7..d1cb5ac1224 100644 --- a/src/plugins/qmlprofiler/qmlprofilersettings.cpp +++ b/src/plugins/qmlprofiler/qmlprofilersettings.cpp @@ -44,6 +44,7 @@ QmlProfilerSettings::QmlProfilerSettings() QVariantMap defaults; defaults.insert(QLatin1String(Constants::FLUSH_INTERVAL), 1000); defaults.insert(QLatin1String(Constants::FLUSH_ENABLED), false); + defaults.insert(QLatin1String(Constants::LAST_TRACE_FILE), QString()); // Read stored values QSettings *settings = Core::ICore::settings(); @@ -92,6 +93,19 @@ void QmlProfilerSettings::setFlushInterval(quint32 flushInterval) } } +QString QmlProfilerSettings::lastTraceFile() const +{ + return m_lastTraceFile; +} + +void QmlProfilerSettings::setLastTraceFile(const QString &lastTracePath) +{ + if (m_lastTraceFile != lastTracePath) { + m_lastTraceFile = lastTracePath; + emit changed(); + } +} + void QmlProfilerSettings::writeGlobalSettings() const { QSettings *settings = Core::ICore::settings(); @@ -107,12 +121,14 @@ void QmlProfilerSettings::toMap(QVariantMap &map) const { map[QLatin1String(Constants::FLUSH_INTERVAL)] = m_flushInterval; map[QLatin1String(Constants::FLUSH_ENABLED)] = m_flushEnabled; + map[QLatin1String(Constants::LAST_TRACE_FILE)] = m_lastTraceFile; } void QmlProfilerSettings::fromMap(const QVariantMap &map) { m_flushEnabled = map.value(QLatin1String(Constants::FLUSH_ENABLED)).toBool(); m_flushInterval = map.value(QLatin1String(Constants::FLUSH_INTERVAL)).toUInt(); + m_lastTraceFile = map.value(QLatin1String(Constants::LAST_TRACE_FILE)).toString(); emit changed(); } |