diff --git a/app/layouts/manager.cpp b/app/layouts/manager.cpp index 97ac4c971..0e2db39ae 100644 --- a/app/layouts/manager.cpp +++ b/app/layouts/manager.cpp @@ -301,7 +301,6 @@ void Manager::importPresets(bool includeDefault) if (!includeDefault) { start = 2; } - for (int i = start; i <= 4; ++i) { importPreset(i, false); } diff --git a/app/layouts/synchronizer.cpp b/app/layouts/synchronizer.cpp index 850c36457..7b6117ed7 100644 --- a/app/layouts/synchronizer.cpp +++ b/app/layouts/synchronizer.cpp @@ -68,10 +68,6 @@ Synchronizer::Synchronizer(QObject *parent) syncMultipleLayoutsToActivities(); } }); - - //! Templates tracking - - connect(m_manager->corona()->templatesManager(), &Templates::Manager::newLayoutAdded, this, &Synchronizer::onLayoutAdded); } Synchronizer::~Synchronizer() @@ -582,6 +578,11 @@ void Synchronizer::loadLayouts() emit layoutsChanged(); emit menuLayoutsChanged(); + + if (!m_isLoaded) { + m_isLoaded = true; + connect(m_manager->corona()->templatesManager(), &Latte::Templates::Manager::newLayoutAdded, this, &Synchronizer::onLayoutAdded); + } } void Synchronizer::onLayoutAdded(const QString &layout) @@ -606,6 +607,11 @@ void Synchronizer::onLayoutAdded(const QString &layout) if (!sharedName.isEmpty() && !m_sharedLayoutIds.contains(sharedName)) { m_sharedLayoutIds << sharedName; } + + if (m_isLoaded) { + emit layoutsChanged(); + emit menuLayoutsChanged(); + } } void Synchronizer::unloadLayouts() diff --git a/app/layouts/synchronizer.h b/app/layouts/synchronizer.h index f7f96defd..fcca13f2e 100644 --- a/app/layouts/synchronizer.h +++ b/app/layouts/synchronizer.h @@ -149,6 +149,7 @@ private: private: bool m_multipleModeInitialized{false}; + bool m_isLoaded{false}; QString m_currentLayoutNameInMultiEnvironment; QString m_shouldSwitchToLayout;