summaryrefslogtreecommitdiff
path: root/src/plugins/projectexplorer/session.cpp
diff options
context:
space:
mode:
authorDaniel Teske <daniel.teske@nokia.com>2012-02-06 17:19:36 +0100
committerDaniel Teske <daniel.teske@nokia.com>2012-02-07 15:01:08 +0100
commit27275a07487643804913ae4b8da2f3ca677f3b07 (patch)
tree8f7eea63f5c1248e3bc45bf6fd6360c93931cf71 /src/plugins/projectexplorer/session.cpp
parent9c611c41d7f8d64d08cf6679b254cc07b962cbe1 (diff)
downloadqt-creator-27275a07487643804913ae4b8da2f3ca677f3b07.tar.gz
Move SessionFile::m_values to SessionManager
Change-Id: Iccb40a16d3087f612ad5d570ed42a243fe87dfe5 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
Diffstat (limited to 'src/plugins/projectexplorer/session.cpp')
-rw-r--r--src/plugins/projectexplorer/session.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp
index 2b09506976..aa765ce6f8 100644
--- a/src/plugins/projectexplorer/session.cpp
+++ b/src/plugins/projectexplorer/session.cpp
@@ -87,8 +87,6 @@ public:
SessionFile();
private:
- QMap<QString, QVariant> m_values;
-
QFutureInterface<void> future;
friend class ProjectExplorer::SessionManager;
};
@@ -351,6 +349,7 @@ bool SessionManager::createImpl(const QString &fileName)
m_startupProject = 0;
m_failedProjects.clear();
m_depMap.clear();
+ m_values.clear();
const QString &sessionName = sessionNameFromFileName(fileName);
emit aboutToLoadSession(sessionName);
m_sessionName = sessionName;
@@ -397,6 +396,7 @@ bool SessionManager::loadImpl(const QString &fileName)
m_startupProject = 0;
m_failedProjects.clear();
m_depMap.clear();
+ m_values.clear();
const QString &sessionName = sessionNameFromFileName(fileName);
emit aboutToLoadSession(sessionName);
m_sessionName = sessionName;
@@ -418,7 +418,7 @@ bool SessionManager::loadImpl(const QString &fileName)
const QStringList &keys = reader.restoreValue(QLatin1String("valueKeys")).toStringList();
foreach (const QString &key, keys) {
QVariant value = reader.restoreValue(QLatin1String("value-") + key);
- m_file->m_values.insert(key, value);
+ m_values.insert(key, value);
}
QStringList fileList =
@@ -571,9 +571,9 @@ bool SessionManager::save()
ICore::editorManager()->saveState().toBase64());
QMap<QString, QVariant>::const_iterator it, end;
- end = m_file->m_values.constEnd();
+ end = m_values.constEnd();
QStringList keys;
- for (it = m_file->m_values.constBegin(); it != end; ++it) {
+ for (it = m_values.constBegin(); it != end; ++it) {
writer.saveValue(QLatin1String("value-") + it.key(), it.value());
keys << it.key();
}
@@ -852,21 +852,16 @@ void SessionManager::removeProjects(QList<Project *> remove)
void SessionManager::setValue(const QString &name, const QVariant &value)
{
- if (!m_file)
- return;
-
- if (m_file->m_values.value(name) == value)
+ if (m_values.value(name) == value)
return;
- m_file->m_values.insert(name, value);
+ m_values.insert(name, value);
markSessionFileDirty(false);
}
QVariant SessionManager::value(const QString &name)
{
- if (!m_file)
- return QVariant();
- QMap<QString, QVariant>::const_iterator it = m_file->m_values.find(name);
- return (it == m_file->m_values.constEnd()) ? QVariant() : *it;
+ QMap<QString, QVariant>::const_iterator it = m_values.find(name);
+ return (it == m_values.constEnd()) ? QVariant() : *it;
}
QString SessionManager::activeSession() const