1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-05 01:18:02 +03:00

ignore layout/view extensions properly

--remove them manually and do not use baseName()
because it might take into account dots that are
part of the name.
This commit is contained in:
Michail Vourlakos 2022-01-04 10:12:30 +02:00
parent 4de51de221
commit 7d180f8dd6
3 changed files with 4 additions and 4 deletions

View File

@ -193,7 +193,7 @@ void ExportTemplateHandler::chooseFileDialog()
}); });
chooseFileDlg->open(); chooseFileDlg->open();
chooseFileDlg->selectFile(currentFile.baseName()); chooseFileDlg->selectFile(currentFile.fileName());
} }
void ExportTemplateHandler::onExport() void ExportTemplateHandler::onExport()

View File

@ -712,7 +712,7 @@ void TabLayouts::exportLayoutForBackup()
}); });
exportFileDialog->open(); exportFileDialog->open();
exportFileDialog->selectFile(selectedLayout.name); exportFileDialog->selectFile(selectedLayout.name + ".layout.latte");
} }
void TabLayouts::showDetailsDialog() void TabLayouts::showDetailsDialog()

View File

@ -214,10 +214,10 @@ QString Manager::proposedTemplateAbsolutePath(QString templateFilename)
QString tempfilename = templateFilename; QString tempfilename = templateFilename;
if (tempfilename.endsWith(".layout.latte")) { if (tempfilename.endsWith(".layout.latte")) {
QString clearedname = QFileInfo(tempfilename).baseName(); QString clearedname = tempfilename.chopped(QString(".layout.latte").size());
tempfilename = uniqueLayoutTemplateName(clearedname) + ".layout.latte"; tempfilename = uniqueLayoutTemplateName(clearedname) + ".layout.latte";
} else if (tempfilename.endsWith(".view.latte")) { } else if (tempfilename.endsWith(".view.latte")) {
QString clearedname = QFileInfo(tempfilename).baseName(); QString clearedname = tempfilename.chopped(QString(".view.latte").size());
tempfilename = uniqueViewTemplateName(clearedname) + ".view.latte"; tempfilename = uniqueViewTemplateName(clearedname) + ".view.latte";
} }