Commit 0334bc93 authored by Tobias Hunger's avatar Tobias Hunger

Session: Save color as part of the session

This makes it much easier to see which session you are in (if you care
to use color-coding;-).

Change-Id: I96d55aa9a67fc44cb88797458d5a9e99208b957c
Reviewed-by: default avatarTobias Hunger <>
parent f50f1416
......@@ -49,6 +49,7 @@
#include <utils/listutils.h>
#include <utils/qtcassert.h>
#include <utils/stylehelper.h>
#include <QDebug>
#include <QDir>
......@@ -316,6 +317,15 @@ bool SessionManager::save()
if (m_startupProject)
data.insert(QLatin1String("StartupProject"), m_startupProject->document()->fileName());
QColor c = Utils::StyleHelper::requestedBaseColor();
if (c.isValid()) {
QString tmp = QString::fromLatin1("#%1%2%3")
.arg(, 2, 16, QLatin1Char('0'))
.arg(, 2, 16, QLatin1Char('0'))
.arg(, 2, 16, QLatin1Char('0'));
writer.saveValue(QLatin1String("Color"), tmp);
QStringList projectFiles;
foreach (Project *pro, m_projects)
projectFiles << pro->document()->fileName();
......@@ -861,6 +871,10 @@ bool SessionManager::loadSession(const QString &session)
emit aboutToLoadSession(session);
QColor c = QColor(reader.restoreValue(QLatin1String("Color")).toString());
if (c.isValid())
QStringList fileList =
int openEditorsCount = reader.restoreValue(QLatin1String("OpenEditors")).toInt();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment