summaryrefslogtreecommitdiffstats
path: root/templatelayout.cpp
diff options
context:
space:
mode:
authorGravatar Gehad elrobey <gehadelrobey@gmail.com>2015-07-07 03:12:36 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2015-07-20 15:26:41 +0300
commitc56b1c1114015c6b83852ecdcdb21b03f41e594b (patch)
tree3640adcd3f919929944134fc28a5970a4b4f12f3 /templatelayout.cpp
parent05109b2d6c7e8ef816b1290c583492dec78b3f07 (diff)
downloadsubsurface-c56b1c1114015c6b83852ecdcdb21b03f41e594b.tar.gz
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>
Diffstat (limited to 'templatelayout.cpp')
-rw-r--r--templatelayout.cpp1
1 files changed, 1 insertions, 0 deletions
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();
}
}