update Layout::MULTIPLELAYOUTSHIDDENNAME

which is used to identify multiple layouts hidden
base layout
pull/19/head
Michail Vourlakos 5 years ago
parent ba178e534d
commit 5ed3f111e3

@ -30,8 +30,6 @@
namespace Latte {
namespace Layout {
const QString AbstractLayout::MultipleLayoutsName = ".multiple-layouts_hidden";
AbstractLayout::AbstractLayout(QObject *parent, QString layoutFile, QString assignedName)
: QObject(parent)
{

@ -58,6 +58,8 @@ Q_ENUM_NS(BackgroundStyle);
namespace Latte {
namespace Layout {
const char MULTIPLELAYOUTSHIDDENNAME[] = ".multiple-layouts_hidden";
class AbstractLayout : public QObject
{
Q_OBJECT
@ -76,8 +78,6 @@ public:
AbstractLayout(QObject *parent, QString layoutFile, QString assignedName = QString());
~AbstractLayout() override;
static const QString MultipleLayoutsName;
int version() const;
void setVersion(int ver);

@ -716,7 +716,7 @@ bool Storage::layoutIsBroken(QStringList &errors) const
qDebug() << " --- storaged file : " << m_layout->file();
} else {
if (m_layout->corona()->layoutsManager()->memoryUsage() == MemoryUsage::MultipleLayouts) {
qDebug() << " --- in multiple layouts hidden file : " << Layouts::Importer::layoutFilePath(AbstractLayout::MultipleLayoutsName);
qDebug() << " --- in multiple layouts hidden file : " << Layouts::Importer::layoutFilePath(MULTIPLELAYOUTSHIDDENNAME);
} else {
qDebug() << " --- in active layout file : " << m_layout->file();
}

@ -609,7 +609,7 @@ QString Importer::uniqueLayoutName(QString name)
QStringList Importer::checkRepairMultipleLayoutsLinkedFile()
{
QString linkedFilePath = QDir::homePath() + "/.config/latte/" + Layout::AbstractLayout::MultipleLayoutsName + ".layout.latte";
QString linkedFilePath = QDir::homePath() + "/.config/latte/" + Layout::MULTIPLELAYOUTSHIDDENNAME + ".layout.latte";
KSharedConfigPtr filePtr = KSharedConfig::openConfig(linkedFilePath);
KConfigGroup linkedContainments = KConfigGroup(filePtr, "Containments");
@ -629,7 +629,7 @@ QStringList Importer::checkRepairMultipleLayoutsLinkedFile()
QStringList updatedLayouts;
for(const auto &layoutName : linkedLayoutContainmentGroups.uniqueKeys()) {
if (layoutName != Layout::AbstractLayout::MultipleLayoutsName && layoutExists(layoutName)) {
if (layoutName != Layout::MULTIPLELAYOUTSHIDDENNAME && layoutExists(layoutName)) {
updatedLayouts << layoutName;
KSharedConfigPtr layoutFilePtr = KSharedConfig::openConfig(layoutFilePath(layoutName));
KConfigGroup origLayoutContainments = KConfigGroup(layoutFilePtr, "Containments");

@ -111,7 +111,7 @@ void Manager::load()
}
//! Check if the multiple-layouts hidden file is present, add it if it isnt
if (!QFile(QDir::homePath() + "/.config/latte/" + Layout::AbstractLayout::MultipleLayoutsName + ".layout.latte").exists()) {
if (!QFile(QDir::homePath() + "/.config/latte/" + Layout::MULTIPLELAYOUTSHIDDENNAME + ".layout.latte").exists()) {
importPreset(MultipleLayoutsPresetId, false);
}

@ -564,7 +564,7 @@ void Synchronizer::loadLayouts()
QStringList files = layoutDir.entryList(filter, QDir::Files | QDir::NoSymLinks);
for (const auto &layout : files) {
if (layout.contains(Layout::AbstractLayout::MultipleLayoutsName)) {
if (layout.contains(Layout::MULTIPLELAYOUTSHIDDENNAME)) {
//! IMPORTANT: DON'T ADD MultipleLayouts hidden file in layouts list
continue;
}
@ -697,7 +697,7 @@ bool Synchronizer::switchToLayout(QString layoutName, int previousMemoryUsage)
if (!lPath.isEmpty()) {
if (m_manager->memoryUsage() == MemoryUsage::SingleLayout) {
// emit currentLayoutIsSwitching(currentLayoutName());
} else if (m_manager->memoryUsage() == MemoryUsage::MultipleLayouts && layoutName != Layout::AbstractLayout::MultipleLayoutsName) {
} else if (m_manager->memoryUsage() == MemoryUsage::MultipleLayouts && layoutName != Layout::MULTIPLELAYOUTSHIDDENNAME) {
CentralLayout toLayout(this, lPath);
QStringList toActivities = toLayout.activities();
@ -736,11 +736,11 @@ bool Synchronizer::switchToLayout(QString layoutName, int previousMemoryUsage)
unloadLayouts();
if (initializingMultipleLayouts) {
fixedLayoutName = QString(Layout::AbstractLayout::MultipleLayoutsName);
fixedLayoutName = QString(Layout::MULTIPLELAYOUTSHIDDENNAME);
fixedLPath = layoutPath(fixedLayoutName);
}
if (fixedLayoutName != Layout::AbstractLayout::MultipleLayoutsName) {
if (fixedLayoutName != Layout::MULTIPLELAYOUTSHIDDENNAME) {
CentralLayout *newLayout = new CentralLayout(this, fixedLPath, fixedLayoutName);
addLayout(newLayout);
}

@ -20,6 +20,7 @@
#include "templatesmanager.h"
// local
#include "../layout/abstractlayout.h"
#include "../layout/centrallayout.h"
#include "../layouts/importer.h"
@ -89,7 +90,7 @@ Data::LayoutsTable Manager::systemLayoutTemplates()
for (int i=0; i<m_layoutTemplates.rowCount(); ++i) {
if ( m_layoutTemplates[i].name != i18n(DEFAULTLAYOUTTEMPLATENAME)
&& m_layoutTemplates[i].name != i18n(EMPTYLAYOUTTEMPLATENAME)
&& m_layoutTemplates[i].name != MULTIPLELAYOUTSTEMPLATENAME) {
&& m_layoutTemplates[i].name != Layout::MULTIPLELAYOUTSHIDDENNAME) {
templates << m_layoutTemplates[i];
}
}

@ -40,7 +40,6 @@ namespace Templates {
const char DEFAULTLAYOUTTEMPLATENAME[] = "Default";
const char EMPTYLAYOUTTEMPLATENAME[] = "Empty";
const char MULTIPLELAYOUTSTEMPLATENAME[] = "multiple-layouts_hidden";
class Manager : public QObject
{

@ -1,4 +0,0 @@
[LayoutSettings]
color=red
showInMenu=true
version=2
Loading…
Cancel
Save