dont set sharedLayout var if the layout not exist

pull/5/head
Michail Vourlakos 6 years ago
parent 913c35523f
commit 9f338f38a4

@ -22,6 +22,7 @@
// local
#include "sharedlayout.h"
#include "importer.h"
#include "../lattecorona.h"
#include "../layoutmanager.h"
#include "../screenpool.h"
@ -198,7 +199,7 @@ QString ActiveLayout::sharedLayoutName() const
void ActiveLayout::setSharedLayoutName(QString name)
{
if (m_sharedLayoutName == name) {
if (m_sharedLayoutName == name || !Importer::layoutExists(name)) {
return;
}
@ -243,9 +244,14 @@ void ActiveLayout::loadConfig()
{
m_disableBordersForMaximizedWindows = m_layoutGroup.readEntry("disableBordersForMaximizedWindows", false);
m_showInMenu = m_layoutGroup.readEntry("showInMenu", false);
m_sharedLayoutName = m_layoutGroup.readEntry("sharedLayout", QString());
m_activities = m_layoutGroup.readEntry("activities", QStringList());
QString sharedLayoutName = m_layoutGroup.readEntry("sharedLayout", QString());
if (Importer::layoutExists(sharedLayoutName)) {
m_sharedLayoutName = sharedLayoutName;
}
emit activitiesChanged();
}

Loading…
Cancel
Save