diff --git a/app/layouts/storage.cpp b/app/layouts/storage.cpp index 8a68118a7..e28cd0e36 100644 --- a/app/layouts/storage.cpp +++ b/app/layouts/storage.cpp @@ -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 importedViews = importLayoutFile(destination, temp2File);