Skip to content

Commit

Permalink
fix qt 5.12 & 5.13 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jkarneges committed Nov 1, 2023
1 parent aa2a75e commit 045cae3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
12 changes: 9 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,12 @@ arg: logdir=[path],Directory for log files. Default: /var/log
#include <QDateTime>
#include <QSettings>
#if QT_VERSION >= 0x050e00
#define ENDL Qt::endl
#else
#define ENDL endl
#endif
static QString getVersion()
{
QSettings settings("Cargo.toml", QSettings::IniFormat);
Expand Down Expand Up @@ -494,9 +500,9 @@ public:
if(file.open(QIODevice::WriteOnly | QIODevice::Text))
{
QTextStream stream( &file );
stream << "#define VERSION \\"" << version << "\\"" << Qt::endl;
stream << "#define LIBDIR \\"" << libdir << "/pushpin\\"" << Qt::endl;
stream << "#define CONFIGDIR \\"" << configdir << "/pushpin\\"" << Qt::endl;
stream << "#define VERSION \\"" << version << "\\"" << ENDL;
stream << "#define LIBDIR \\"" << libdir << "/pushpin\\"" << ENDL;
stream << "#define CONFIGDIR \\"" << configdir << "/pushpin\\"" << ENDL;
}
conf->addDefine("HAVE_CONFIG");
Expand Down
12 changes: 9 additions & 3 deletions qcm/conf.qcm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ arg: logdir=[path],Directory for log files. Default: /var/log
#include <QDateTime>
#include <QSettings>

#if QT_VERSION >= 0x050e00
#define ENDL Qt::endl
#else
#define ENDL endl
#endif

static QString getVersion()
{
QSettings settings("Cargo.toml", QSettings::IniFormat);
Expand Down Expand Up @@ -74,9 +80,9 @@ public:
if(file.open(QIODevice::WriteOnly | QIODevice::Text))
{
QTextStream stream( &file );
stream << "#define VERSION \"" << version << "\"" << Qt::endl;
stream << "#define LIBDIR \"" << libdir << "/pushpin\"" << Qt::endl;
stream << "#define CONFIGDIR \"" << configdir << "/pushpin\"" << Qt::endl;
stream << "#define VERSION \"" << version << "\"" << ENDL;
stream << "#define LIBDIR \"" << libdir << "/pushpin\"" << ENDL;
stream << "#define CONFIGDIR \"" << configdir << "/pushpin\"" << ENDL;
}

conf->addDefine("HAVE_CONFIG");
Expand Down

0 comments on commit 045cae3

Please sign in to comment.