- Add a new Log() function to replace ad-hoc std::cout calls wrapped in debugMode checks

- Remove debugMode from classes that don't need it (i.e all of them)
This commit is contained in:
Alfred Reynolds
2021-08-26 12:13:09 +12:00
parent 833e7ef915
commit be8f615c21
16 changed files with 105 additions and 131 deletions

View File

@@ -1,4 +1,5 @@
#include "overlay.h"
#include "logger.h"
#include <QString>
#include <QDateTime>
#include <libexif/exif-data.h>
@@ -19,11 +20,6 @@ Overlay::Overlay(const std::string overlayInput):
Overlay::~Overlay() {}
void Overlay::setDebugMode(const bool debugModeIn)
{
debugMode = debugModeIn;
}
void Overlay::parseInput() {
QString str = QString(overlayInput.c_str());
QStringList corners = str.split(QLatin1Char(';'));
@@ -55,10 +51,7 @@ void Overlay::parseInput() {
QString Overlay::getTemplate(QStringList components){
if (components.size()>3) {
if(debugMode)
{
std::cout << "template: " << components[3].toStdString() << std::endl;
}
Log("template: ", components[3].toStdString());
return components[3];
}
return "";
@@ -66,10 +59,7 @@ QString Overlay::getTemplate(QStringList components){
int Overlay::getMargin(QStringList components){
if (components.size()>1) {
if(debugMode)
{
std::cout << "margin: " << components[1].toStdString() << std::endl;
}
Log("margin: ", components[1].toStdString());
int num = components[1].toInt();
if (num > 0) {
return num;
@@ -81,10 +71,7 @@ int Overlay::getMargin(QStringList components){
int Overlay::getFontsize(QStringList components){
if (components.size()>2) {
if(debugMode)
{
std::cout << "fontsize: " << components[2].toStdString() << std::endl;
}
Log("fontsize: ", components[2].toStdString());
int num = components[2].toInt();
if (num > 0) {
return num;