multiple:unload central layouts after the additions

--this way a shared layout that unloads its only central
layout is not unloaded at all if a new central layout exists
with it
pull/19/head
Michail Vourlakos 5 years ago
parent 84858ff529
commit fed3194ca9

@ -854,23 +854,6 @@ void Synchronizer::syncMultipleLayoutsToActivities(QString layoutForFreeActiviti
}
}
//! Unload no needed Layouts
for (const auto &layoutName : layoutsToUnload) {
CentralLayout *layout = centralLayout(layoutName);
int posLayout = centralLayoutPos(layoutName);
if (posLayout >= 0) {
qDebug() << "REMOVING LAYOUT ::::: " << layoutName;
m_centralLayouts.removeAt(posLayout);
layout->syncToLayoutFile(true);
layout->unloadContainments();
layout->unloadLatteViews();
m_manager->clearUnloadedContainmentsFromLinkedFile(layout->unloadedContainmentsIds());
delete layout;
}
}
//! Add needed Layouts based on Activities
for (const auto &layoutName : layoutsToLoad) {
if (!centralLayout(layoutName)) {
@ -903,6 +886,23 @@ void Synchronizer::syncMultipleLayoutsToActivities(QString layoutForFreeActiviti
}
}
//! Unload no needed Layouts
for (const auto &layoutName : layoutsToUnload) {
CentralLayout *layout = centralLayout(layoutName);
int posLayout = centralLayoutPos(layoutName);
if (posLayout >= 0) {
qDebug() << "REMOVING LAYOUT ::::: " << layoutName;
m_centralLayouts.removeAt(posLayout);
layout->syncToLayoutFile(true);
layout->unloadContainments();
layout->unloadLatteViews();
m_manager->clearUnloadedContainmentsFromLinkedFile(layout->unloadedContainmentsIds());
delete layout;
}
}
updateCurrentLayoutNameInMultiEnvironment();
emit centralLayoutsChanged();
}

Loading…
Cancel
Save