mirror of
https://github.com/KDE/latte-dock.git
synced 2024-12-23 13:33:50 +03:00
custom templates in FullBackupConfiguration
This commit is contained in:
parent
440b4b5736
commit
c7404e55a9
@ -404,6 +404,26 @@ bool Importer::exportFullConfiguration(QString file)
|
||||
archive.addLocalFile(layoutUserFilePath(layoutName), QString("latte/" + layoutName + ".layout.latte"));
|
||||
}
|
||||
|
||||
//! custom templates
|
||||
QDir templatesDir(Latte::configPath() + "/latte/templates");
|
||||
QStringList filters;
|
||||
filters.append(QString("*.layout.latte"));
|
||||
QStringList templates = templatesDir.entryList(filters, QDir::Files | QDir::Hidden | QDir::NoSymLinks);
|
||||
|
||||
for (int i=0; i<templates.count(); ++i) {
|
||||
QString templatePath = templatesDir.path() + "/" + templates[i];
|
||||
archive.addLocalFile(templatePath, QString("latte/templates/" + templates[i]));
|
||||
}
|
||||
|
||||
filters.clear();
|
||||
filters.append(QString("*.view.latte"));
|
||||
templates = templatesDir.entryList(filters, QDir::Files | QDir::Hidden | QDir::NoSymLinks);
|
||||
|
||||
for (int i=0; i<templates.count(); ++i) {
|
||||
QString templatePath = templatesDir.path() + "/" + templates[i];
|
||||
archive.addLocalFile(templatePath, QString("latte/templates/" + templates[i]));
|
||||
}
|
||||
|
||||
archive.close();
|
||||
|
||||
return true;
|
||||
|
@ -107,6 +107,13 @@ void Manager::init()
|
||||
}
|
||||
}
|
||||
|
||||
//! Custom Templates path creation
|
||||
QDir localTemplatesDir(Latte::configPath() + "/latte/templates");
|
||||
|
||||
if (!localTemplatesDir.exists()) {
|
||||
QDir(Latte::configPath() + "/latte").mkdir("templates");
|
||||
}
|
||||
|
||||
//! Check if the multiple-layouts hidden file is present, add it if it isnt
|
||||
if (!QFile(Layouts::Importer::layoutUserFilePath(Layout::MULTIPLELAYOUTSHIDDENNAME)).exists()) {
|
||||
m_corona->templatesManager()->newLayout("", Layout::MULTIPLELAYOUTSHIDDENNAME);
|
||||
|
@ -51,12 +51,6 @@ Manager::~Manager()
|
||||
|
||||
void Manager::init()
|
||||
{
|
||||
//! Local Templates
|
||||
QDir localTemplatesDir(Latte::configPath() + "/latte/templates");
|
||||
if (!localTemplatesDir.exists()) {
|
||||
QDir(Latte::configPath() + "/latte").mkdir("templates");
|
||||
}
|
||||
|
||||
initLayoutTemplates();
|
||||
initViewTemplates();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user