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.
work/m_edgeslide
Michail Vourlakos 3 years ago
parent 4de51de221
commit 7d180f8dd6

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

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

@ -214,10 +214,10 @@ QString Manager::proposedTemplateAbsolutePath(QString templateFilename)
QString tempfilename = templateFilename;
if (tempfilename.endsWith(".layout.latte")) {
QString clearedname = QFileInfo(tempfilename).baseName();
QString clearedname = tempfilename.chopped(QString(".layout.latte").size());
tempfilename = uniqueLayoutTemplateName(clearedname) + ".layout.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";
}

Loading…
Cancel
Save