From 16fa5ea8fac6473013a2d429f7f91af36184107f Mon Sep 17 00:00:00 2001 From: Sverrir Valgeirsson Date: Thu, 1 Apr 2021 23:16:01 +0200 Subject: [PATCH] Fix build issues on older versions of Qt5 --- CHANGELOG | 1 + def.h | 10 ++++++++++ mainwindow.cpp | 6 +++--- todotxt.cpp | 22 +++++++++++----------- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1e52b6c..30d5053 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ * Fixed a bug where the check for new version would basically always find a new version * Fixed bug introduced in 2.20 with automatically adding due: or t: when using rec: +* Fixed building issues for older versions of Qt5 New in 2.20 diff --git a/def.h b/def.h index e9610c5..d4a1007 100644 --- a/def.h +++ b/def.h @@ -1,6 +1,16 @@ #ifndef DEF_H #define DEF_H +/* Workaround for the Qt::endl not existing before 5.14.something */ +#include +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) +#define endline endl +#else +#define endline Qt::endl +#endif + + + // Defaults and definitions for settings #define DEFAULT_HOTKEY "Ctrl+Alt+t" #define DEFAULT_HOTKEY_ENABLE false diff --git a/mainwindow.cpp b/mainwindow.cpp index f3db128..2198a4d 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -58,7 +58,7 @@ MainWindow::MainWindow(QWidget *parent) : if(QCoreApplication::arguments().contains("-portable")){ QSettings::setDefaultFormat(QSettings::IniFormat); QSettings::setPath(QSettings::IniFormat,QSettings::UserScope,QDir::currentPath()); - qDebug()<<"Setting ini file path to: "<readAll(); double latest_version = replyText.toDouble(); double this_version = QString(VER).toDouble(); - qDebug()<<"Checked version - Latest: "<this_version || forced_check_version){ if(latest_version > this_version){ ui->lbl_newVersion->show(); diff --git a/todotxt.cpp b/todotxt.cpp index be562cc..0b42564 100644 --- a/todotxt.cpp +++ b/todotxt.cpp @@ -24,9 +24,9 @@ todotxt::todotxt() undoDir = new QTemporaryDir(); if(!undoDir->isValid()){ - qDebug()<<"Could not create undo dir"<path()<path()<