From ad8723ce4ffc9b00fefc8b89f9ae08e9f58ff428 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sat, 21 Mar 2020 01:46:33 +0200 Subject: [PATCH] fix, save temporary layouts when user applied --- app/settings/controllers/layoutscontroller.cpp | 2 +- app/settings/data/layoutdata.cpp | 5 +++++ app/settings/data/layoutdata.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/settings/controllers/layoutscontroller.cpp b/app/settings/controllers/layoutscontroller.cpp index 00f6cdf8a..0d882c440 100644 --- a/app/settings/controllers/layoutscontroller.cpp +++ b/app/settings/controllers/layoutscontroller.cpp @@ -718,7 +718,7 @@ void Layouts::save() } //! If the layout name changed OR the layout path is a temporary one - if (iLayoutCurrentData.name != iLayoutOriginalData.name) { + if ((iLayoutCurrentData.name != iLayoutOriginalData.name) || iLayoutCurrentData.isTemporary()) { //! If the layout is Active in MultipleLayouts if (m_corona->layoutsManager()->memoryUsage() == Types::MultipleLayouts && generic->isActive()) { qDebug() << " Active Layout Should Be Renamed From : " << generic->name() << " TO :: " << iLayoutCurrentData.name; diff --git a/app/settings/data/layoutdata.cpp b/app/settings/data/layoutdata.cpp index 99d1e489b..8593c6d24 100644 --- a/app/settings/data/layoutdata.cpp +++ b/app/settings/data/layoutdata.cpp @@ -118,6 +118,11 @@ bool Layout::isForFreeActivities() const return ((activities.count() == 1) && (activities[0] == FREEACTIVITIESID)); } +bool Layout::isTemporary() const +{ + return id.startsWith("/tmp"); +} + bool Layout::isEmpty() const { return isNull(); diff --git a/app/settings/data/layoutdata.h b/app/settings/data/layoutdata.h index 72f07bdf0..9698106cf 100644 --- a/app/settings/data/layoutdata.h +++ b/app/settings/data/layoutdata.h @@ -54,6 +54,7 @@ public: //! Functionality bool isShared() const; bool isForFreeActivities() const; + bool isTemporary() const; bool isNull() const; bool isEmpty() const;