do not break user view template file on first use

work/spdx
Michail Vourlakos 4 years ago
parent 2b59a085e4
commit 373b8c5b56

@ -535,8 +535,17 @@ ViewDelayedCreationData Storage::newView(const Layout::GenericLayout *destinatio
//! Setting mutable for create a containment
destination->corona()->setImmutability(Plasma::Types::Mutable);
//! copy view template path in temp file
QString templateTmpAbsolutePath = m_storageTmpDir.path() + "/" + QFileInfo(templateFile).fileName() + ".newids";
if (QFile(templateTmpAbsolutePath).exists()) {
QFile(templateTmpAbsolutePath).remove();
}
QFile(templateFile).copy(templateTmpAbsolutePath);
//! update ids to unique ones
QString temp2File = newUniqueIdsLayoutFromFile(destination, templateFile);
QString temp2File = newUniqueIdsLayoutFromFile(destination, templateTmpAbsolutePath);
//! Finally import the configuration
QList<Plasma::Containment *> importedViews = importLayoutFile(destination, temp2File);

Loading…
Cancel
Save