mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
printing: make sure that exported templates are .html
Thus far the exported template did not had the .html extension. This patch makes sure that the extension is always added to the file if missing. Also handle the case where the user used ".htm" and replace that with ".html". Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
a2ec791f2f
commit
c57df085a4
1 changed files with 5 additions and 0 deletions
|
@ -163,6 +163,11 @@ void PrintOptions::on_exportButton_clicked()
|
|||
tr("HTML files") + " (*.html)");
|
||||
if (filename.isEmpty())
|
||||
return;
|
||||
const QString ext(".html");
|
||||
if (filename.endsWith(".htm", Qt::CaseInsensitive))
|
||||
filename += "l";
|
||||
else if (!filename.endsWith(ext, Qt::CaseInsensitive))
|
||||
filename += ext;
|
||||
QFile::copy(pathUser + QDir::separator() + getSelectedTemplate(), filename);
|
||||
QFile f(filename);
|
||||
if (!f.open(QFile::ReadWrite | QFile::Text))
|
||||
|
|
Loading…
Add table
Reference in a new issue