Printing: overwrite the old custom template file
Change the new file size after inserting the new template to overwrite the old one. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
05109b2d6c
commit
c56b1c1114
@ -104,6 +104,7 @@ void TemplateLayout::writeTemplate(QString template_name, QString grantlee_templ
|
||||
QFile qfile(getSubsurfaceDataPath("printing_templates") + QDir::separator() + template_name);
|
||||
if (qfile.open(QFile::ReadWrite | QFile::Text)) {
|
||||
qfile.write(grantlee_template.toUtf8().data());
|
||||
qfile.resize(qfile.pos());
|
||||
qfile.close();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user