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:
Gehad elrobey 2015-07-07 03:12:36 +02:00 committed by Lubomir I. Ivanov
parent 05109b2d6c
commit c56b1c1114

View file

@ -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();
}
}