sync settings before exporting

pull/19/head
Michail Vourlakos 5 years ago
parent 043849c4e7
commit 7ef74d2096

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

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

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

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

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

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

Loading…
Cancel
Save