summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--templatelayout.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/templatelayout.cpp b/templatelayout.cpp
index b0098fbd9..2da048266 100644
--- a/templatelayout.cpp
+++ b/templatelayout.cpp
@@ -4,7 +4,7 @@
#include "helpers.h"
#include "display.h"
-QList<QString> grantlee_templates;
+QList<QString> grantlee_templates, grantlee_statistics_templates;
int getTotalWork(print_options *printOptions)
{
@@ -24,6 +24,7 @@ int getTotalWork(print_options *printOptions)
void find_all_templates()
{
grantlee_templates.clear();
+ grantlee_statistics_templates.clear();
QDir dir(getSubsurfaceDataPath("printing_templates"));
QFileInfoList list = dir.entryInfoList(QDir::Files | QDir::NoDotAndDotDot);
foreach (QFileInfo finfo, list) {
@@ -32,6 +33,15 @@ void find_all_templates()
grantlee_templates.append(finfo.fileName());
}
}
+ // find statistics templates
+ dir.setPath(getSubsurfaceDataPath("printing_templates") + QDir::separator() + "statistics");
+ list = dir.entryInfoList(QDir::Files | QDir::NoDotAndDotDot);
+ foreach (QFileInfo finfo, list) {
+ QString filename = finfo.fileName();
+ if (filename.at(filename.size() - 1) != '~') {
+ grantlee_statistics_templates.append(finfo.fileName());
+ }
+ }
}
TemplateLayout::TemplateLayout(print_options *PrintOptions, template_options *templateOptions) :