summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-04-26 17:51:25 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-04-29 13:03:31 -0700
commitaf00361929c00febea42d067785ea1a76c493e7b (patch)
tree785d1dab7514db82164c7be375ba69ecf0bd4992 /desktop-widgets
parent449dec82694aa1bc7fd1de56792ec7a0cf865bd0 (diff)
downloadsubsurface-af00361929c00febea42d067785ea1a76c493e7b.tar.gz
Cleanup: rename variable PrintOptions to printOptions
We're quite inconsistent when it comes to variable naming. The general usage is camelCase for Qt parts and snake_case for core code. Virtually nowhere do we start variable names with a capital letter. Therefore, turn this one weird case into camelCase. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/templatelayout.cpp18
-rw-r--r--desktop-widgets/templatelayout.h4
2 files changed, 11 insertions, 11 deletions
diff --git a/desktop-widgets/templatelayout.cpp b/desktop-widgets/templatelayout.cpp
index 21eac0c92..27afbac65 100644
--- a/desktop-widgets/templatelayout.cpp
+++ b/desktop-widgets/templatelayout.cpp
@@ -92,9 +92,9 @@ void copy_bundled_templates(QString src, QString dst, QStringList *templateBacku
}
}
-TemplateLayout::TemplateLayout(print_options *PrintOptions, template_options *templateOptions)
+TemplateLayout::TemplateLayout(print_options *printOptions, template_options *templateOptions)
{
- this->PrintOptions = PrintOptions;
+ this->printOptions = printOptions;
this->templateOptions = templateOptions;
}
@@ -134,7 +134,7 @@ static QString preprocessTemplate(const QString &in)
QString TemplateLayout::generate()
{
int progress = 0;
- int totalWork = getTotalWork(PrintOptions);
+ int totalWork = getTotalWork(printOptions);
QString htmlContent;
Grantlee::Engine engine(this);
@@ -152,7 +152,7 @@ QString TemplateLayout::generate()
int i;
for_each_dive (i, dive) {
//TODO check for exporting selected dives only
- if (!dive->selected && PrintOptions->print_selected)
+ if (!dive->selected && printOptions->print_selected)
continue;
DiveObjectHelper *d = new DiveObjectHelper(dive);
diveList.append(QVariant::fromValue(d));
@@ -163,14 +163,14 @@ QString TemplateLayout::generate()
Grantlee::Context c;
c.insert("dives", diveList);
c.insert("template_options", QVariant::fromValue(*templateOptions));
- c.insert("print_options", QVariant::fromValue(*PrintOptions));
+ c.insert("print_options", QVariant::fromValue(*printOptions));
/* don't use the Grantlee loader API */
- QString templateContents = readTemplate(PrintOptions->p_template);
+ QString templateContents = readTemplate(printOptions->p_template);
QString preprocessed = preprocessTemplate(templateContents);
/* create the template from QString; is this thing allocating memory? */
- Grantlee::Template t = engine.newTemplate(preprocessed, PrintOptions->p_template);
+ Grantlee::Template t = engine.newTemplate(preprocessed, printOptions->p_template);
if (!t || t->error()) {
qDebug() << "Can't load template";
return htmlContent;
@@ -212,9 +212,9 @@ QString TemplateLayout::generateStatistics()
Grantlee::Context c;
c.insert("years", years);
c.insert("template_options", QVariant::fromValue(*templateOptions));
- c.insert("print_options", QVariant::fromValue(*PrintOptions));
+ c.insert("print_options", QVariant::fromValue(*printOptions));
- Grantlee::Template t = engine.loadByName(PrintOptions->p_template);
+ Grantlee::Template t = engine.loadByName(printOptions->p_template);
if (!t || t->error()) {
qDebug() << "Can't load template";
return htmlContent;
diff --git a/desktop-widgets/templatelayout.h b/desktop-widgets/templatelayout.h
index da3dc177c..5fab95f44 100644
--- a/desktop-widgets/templatelayout.h
+++ b/desktop-widgets/templatelayout.h
@@ -20,14 +20,14 @@ extern QList<QString> grantlee_templates, grantlee_statistics_templates;
class TemplateLayout : public QObject {
Q_OBJECT
public:
- TemplateLayout(print_options *PrintOptions, template_options *templateOptions);
+ TemplateLayout(print_options *printOptions, template_options *templateOptions);
QString generate();
QString generateStatistics();
static QString readTemplate(QString template_name);
static void writeTemplate(QString template_name, QString grantlee_template);
private:
- print_options *PrintOptions;
+ print_options *printOptions;
template_options *templateOptions;
signals: