From c56b1c1114015c6b83852ecdcdb21b03f41e594b Mon Sep 17 00:00:00 2001 From: Gehad elrobey Date: Tue, 7 Jul 2015 03:12:36 +0200 Subject: 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 Signed-off-by: Lubomir I. Ivanov --- templatelayout.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'templatelayout.cpp') diff --git a/templatelayout.cpp b/templatelayout.cpp index 9a9dc9656..79508d6db 100644 --- a/templatelayout.cpp +++ b/templatelayout.cpp @@ -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(); } } -- cgit v1.2.3-70-g09d2