1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-08 13:18:09 +03:00

data::layout provide schemeFile

This commit is contained in:
Michail Vourlakos 2021-06-16 10:07:34 +03:00
parent bf58c753ee
commit 509df95ae7
3 changed files with 12 additions and 2 deletions

View File

@ -30,6 +30,7 @@ Layout::Layout(Layout &&o)
isTemplate(o.isTemplate),
hasDisabledBorders(o.hasDisabledBorders),
popUpMargin(o.popUpMargin),
schemeFile(o.schemeFile),
activities(o.activities),
backgroundStyle(o.backgroundStyle),
errors(o.errors),
@ -52,6 +53,7 @@ Layout::Layout(const Layout &o)
isTemplate(o.isTemplate),
hasDisabledBorders(o.hasDisabledBorders),
popUpMargin(o.popUpMargin),
schemeFile(o.schemeFile),
activities(o.activities),
backgroundStyle(o.backgroundStyle),
errors(o.errors),
@ -76,6 +78,7 @@ Layout &Layout::operator=(Layout &&rhs)
isTemplate = rhs.isTemplate;
hasDisabledBorders = rhs.hasDisabledBorders;
popUpMargin = rhs.popUpMargin;
schemeFile = rhs.schemeFile;
activities = rhs.activities;
backgroundStyle = rhs.backgroundStyle;
errors = rhs.errors;
@ -101,6 +104,7 @@ Layout &Layout::operator=(const Layout &rhs)
isTemplate = rhs.isTemplate;
hasDisabledBorders = rhs.hasDisabledBorders;
popUpMargin = rhs.popUpMargin;
schemeFile = rhs.schemeFile;
activities = rhs.activities;
backgroundStyle = rhs.backgroundStyle;
errors = rhs.errors;
@ -126,6 +130,7 @@ bool Layout::operator==(const Layout &rhs) const
&& (isTemplate == rhs.isTemplate)
&& (hasDisabledBorders == rhs.hasDisabledBorders)
&& (popUpMargin == rhs.popUpMargin)
&& (schemeFile == rhs.schemeFile)
&& (activities == rhs.activities)
&& (backgroundStyle == rhs.backgroundStyle)
//&& (errors == rhs.errors) /*Disabled because this is not needed in order to track layout changes for saving*/

View File

@ -25,6 +25,7 @@ public:
static constexpr const char* ALLACTIVITIESID = "{0}";
static constexpr const char* FREEACTIVITIESID = "{free-activities}";
static constexpr const char* CURRENTACTIVITYID = "{current-activity}";
static constexpr const char* DEFAULTSCHEMEFILE = "kdeglobals";
Layout();
Layout(Layout &&o);
@ -36,6 +37,7 @@ public:
QString background;
QString textColor;
QString lastUsedActivity;
QString schemeFile{DEFAULTSCHEMEFILE};
bool isActive{false};
bool isConsideredActive{false}; //used from settings window to indicate activeness based on selected layouts mode
bool isLocked{false};

View File

@ -5,6 +5,9 @@
#include "abstractlayout.h"
// local
#include "../data/layoutdata.h"
// Qt
#include <QDir>
#include <QDebug>
@ -379,7 +382,7 @@ void AbstractLayout::loadConfig()
m_color = m_layoutGroup.readEntry("color", QString("blue"));
m_backgroundStyle = static_cast<BackgroundStyle>(m_layoutGroup.readEntry("backgroundStyle", (int)ColorBackgroundStyle));
m_schemeFile = m_layoutGroup.readEntry("schemeFile", QString("kdeglobals"));
m_schemeFile = m_layoutGroup.readEntry("schemeFile", Data::Layout::DEFAULTSCHEMEFILE);
QString deprecatedTextColor = m_layoutGroup.readEntry("textColor", QString());
QString deprecatedBackground = m_layoutGroup.readEntry("background", QString());
@ -414,7 +417,7 @@ void AbstractLayout::saveConfig()
m_layoutGroup.writeEntry("lastUsedActivity", m_lastUsedActivity);
m_layoutGroup.writeEntry("popUpMargin", m_popUpMargin);
m_layoutGroup.writeEntry("preferredForShortcutsTouched", m_preferredForShortcutsTouched);
m_layoutGroup.writeEntry("schemeFile", m_schemeFile == QLatin1String("kdeglobals") ? "" : m_schemeFile);
m_layoutGroup.writeEntry("schemeFile", m_schemeFile == Data::Layout::DEFAULTSCHEMEFILE ? "" : m_schemeFile);
m_layoutGroup.sync();
}