mirror of
https://github.com/YACReader/yacreader
synced 2025-07-14 02:54:46 -04:00
Update QtWebapp to 1.7.11
This commit is contained in:
14
third_party/QtWebApp/templateengine/template.cpp
vendored
14
third_party/QtWebApp/templateengine/template.cpp
vendored
@ -6,14 +6,16 @@
|
||||
#include "template.h"
|
||||
#include <QFileInfo>
|
||||
|
||||
Template::Template(QString source, QString sourceName)
|
||||
using namespace stefanfrings;
|
||||
|
||||
Template::Template(const QString source, const QString sourceName)
|
||||
: QString(source)
|
||||
{
|
||||
this->sourceName=sourceName;
|
||||
this->warnings=false;
|
||||
}
|
||||
|
||||
Template::Template(QFile& file, QTextCodec* textCodec)
|
||||
Template::Template(QFile& file, const QTextCodec* textCodec)
|
||||
{
|
||||
this->warnings=false;
|
||||
sourceName=QFileInfo(file.fileName()).baseName();
|
||||
@ -34,7 +36,7 @@ Template::Template(QFile& file, QTextCodec* textCodec)
|
||||
}
|
||||
|
||||
|
||||
int Template::setVariable(QString name, QString value)
|
||||
int Template::setVariable(const QString name, const QString value)
|
||||
{
|
||||
int count=0;
|
||||
QString variable="{"+name+"}";
|
||||
@ -52,7 +54,7 @@ int Template::setVariable(QString name, QString value)
|
||||
return count;
|
||||
}
|
||||
|
||||
int Template::setCondition(QString name, bool value)
|
||||
int Template::setCondition(const QString name, const bool value)
|
||||
{
|
||||
int count=0;
|
||||
QString startTag=QString("{if %1}").arg(name);
|
||||
@ -150,7 +152,7 @@ int Template::setCondition(QString name, bool value)
|
||||
return count;
|
||||
}
|
||||
|
||||
int Template::loop(QString name, int repetitions)
|
||||
int Template::loop(const QString name, const int repetitions)
|
||||
{
|
||||
Q_ASSERT(repetitions>=0);
|
||||
int count=0;
|
||||
@ -234,7 +236,7 @@ int Template::loop(QString name, int repetitions)
|
||||
return count;
|
||||
}
|
||||
|
||||
void Template::enableWarnings(bool enable)
|
||||
void Template::enableWarnings(const bool enable)
|
||||
{
|
||||
warnings=enable;
|
||||
}
|
||||
|
Reference in New Issue
Block a user