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

sync settings before exporting

This commit is contained in:
Michail Vourlakos 2020-08-14 10:52:13 +03:00
parent 043849c4e7
commit 7ef74d2096
6 changed files with 18 additions and 0 deletions

View File

@ -349,6 +349,13 @@ QString AbstractLayout::layoutName(const QString &fileName)
return layoutName; return layoutName;
} }
void AbstractLayout::syncSettings()
{
if (QFile(file()).exists()) {
m_layoutGroup.sync();
}
}
void AbstractLayout::loadConfig() void AbstractLayout::loadConfig()
{ {
m_version = m_layoutGroup.readEntry("version", 2); m_version = m_layoutGroup.readEntry("version", 2);

View File

@ -117,6 +117,8 @@ public:
virtual Type type() const; virtual Type type() const;
void syncSettings();
// STATIC // STATIC
static QString defaultCustomTextColor(); static QString defaultCustomTextColor();
static QString defaultCustomBackground(); static QString defaultCustomBackground();

View File

@ -1674,6 +1674,7 @@ void GenericLayout::unlock()
void GenericLayout::syncToLayoutFile(bool removeLayoutId) void GenericLayout::syncToLayoutFile(bool removeLayoutId)
{ {
syncSettings();
m_storage->syncToLayoutFile(removeLayoutId); m_storage->syncToLayoutFile(removeLayoutId);
} }

View File

@ -577,6 +577,7 @@ void TabLayouts::on_export_layout()
//! Update ALL active original layouts before exporting, //! Update ALL active original layouts before exporting,
m_corona->layoutsManager()->synchronizer()->syncActiveLayoutsToOriginalFiles(); m_corona->layoutsManager()->synchronizer()->syncActiveLayoutsToOriginalFiles();
m_corona->universalSettings()->syncSettings();
QFileDialog *exportFileDialog = new QFileDialog(m_parentDialog, i18n("Export Layout"), QDir::homePath(), QStringLiteral("layout.latte")); QFileDialog *exportFileDialog = new QFileDialog(m_parentDialog, i18n("Export Layout"), QDir::homePath(), QStringLiteral("layout.latte"));

View File

@ -492,6 +492,11 @@ void UniversalSettings::setScreenScales(QString screenName, float widthScale, fl
emit screenScalesChanged(); emit screenScalesChanged();
} }
void UniversalSettings::syncSettings()
{
m_universalGroup.sync();
}
void UniversalSettings::loadConfig() void UniversalSettings::loadConfig()
{ {
m_version = m_universalGroup.readEntry("version", 1); m_version = m_universalGroup.readEntry("version", 1);

View File

@ -131,6 +131,8 @@ public slots:
Q_INVOKABLE float screenHeightScale(QString screenName) const; Q_INVOKABLE float screenHeightScale(QString screenName) const;
Q_INVOKABLE void setScreenScales(QString screenName, float widthScale, float heightScale); Q_INVOKABLE void setScreenScales(QString screenName, float widthScale, float heightScale);
void syncSettings();
signals: signals:
void autostartChanged(); void autostartChanged();
void badges3DStyleChanged(); void badges3DStyleChanged();