storage:adjustments to newUniquedIdsFile

work/spdx
Michail Vourlakos 4 years ago
parent 9e4c233816
commit 54e9fcdcec

@ -260,7 +260,7 @@ void Storage::importToCorona(const Layout::GenericLayout *layout)
copyGroup.sync();
//! update ids to unique ones
QString temp2File = newUniqueIdsLayoutFromFile(temp1FilePath, layout);
QString temp2File = newUniqueIdsFile(temp1FilePath, layout);
//! Finally import the configuration
importLayoutFile(layout, temp2File);
@ -295,9 +295,9 @@ bool Storage::appletGroupIsValid(const KConfigGroup &appletGroup)
&& appletGroup.group("Configuration").hasKey("PreloadWeight") );
}
QString Storage::newUniqueIdsLayoutFromFile(QString originFile, const Layout::GenericLayout *destinationLayout, QString destinationFile)
QString Storage::newUniqueIdsFile(QString originFile, const Layout::GenericLayout *destinationLayout, QString destinationFile)
{
if (!destinationLayout || !destinationLayout->corona()) {
if (destinationFile.isEmpty() && (!destinationLayout || !destinationLayout->corona())) {
return QString();
}
@ -437,8 +437,12 @@ QString Storage::newUniqueIdsLayoutFromFile(QString originFile, const Layout::Ge
}
}
if (destinationLayout->corona()->layoutsManager()->memoryUsage() == MemoryUsage::MultipleLayouts) {
if (destinationFile.isEmpty() && destinationLayout->corona()->layoutsManager()->memoryUsage() == MemoryUsage::MultipleLayouts) {
//! will be added in main corona multiple layouts file
investigate_conts.group(cId).writeEntry("layoutId", destinationLayout->name());
} else {
//! will be added in inactive layout
investigate_conts.group(cId).writeEntry("layoutId", QString());
}
}
@ -558,7 +562,7 @@ ViewDelayedCreationData Storage::newView(const Layout::GenericLayout *destinatio
QFile(templateFile).copy(templateTmpAbsolutePath);
//! update ids to unique ones
QString temp2File = newUniqueIdsLayoutFromFile(templateTmpAbsolutePath, destination);
QString temp2File = newUniqueIdsFile(templateTmpAbsolutePath, destination);
//! Finally import the configuration
QList<Plasma::Containment *> importedViews = importLayoutFile(destination, temp2File);
@ -821,7 +825,7 @@ ViewDelayedCreationData Storage::copyView(const Layout::GenericLayout *layout, P
//! end of subcontainments specific code
//! update ids to unique ones
QString temp2File = newUniqueIdsLayoutFromFile(temp1File, layout);
QString temp2File = newUniqueIdsFile(temp1File, layout);
//! Finally import the configuration
QList<Plasma::Containment *> importedDocks = importLayoutFile(layout, temp2File);

@ -129,7 +129,7 @@ private:
//! provides a new file path based the provided file. The new file
//! has updated ids for containments and applets based on the corona
//! loaded ones
QString newUniqueIdsLayoutFromFile(QString originFile, const Layout::GenericLayout *destinationLayout = nullptr, QString destinationFile = QString());
QString newUniqueIdsFile(QString originFile, const Layout::GenericLayout *destinationLayout = nullptr, QString destinationFile = QString());
//! imports a layout file and returns the containments for the docks
QList<Plasma::Containment *> importLayoutFile(const Layout::GenericLayout *layout, QString file);

Loading…
Cancel
Save