/***************************************************************************
- * Copyright (C) 2005-2016 by the Quassel Project *
+ * Copyright (C) 2005-2018 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#include "quassel.h"
+#include <algorithm>
#include <iostream>
+
#include <signal.h>
#if !defined Q_OS_WIN && !defined Q_OS_MAC
# include <sys/types.h>
if (!QString(GIT_HEAD).isEmpty()) {
buildInfo.commitHash = GIT_HEAD;
QDateTime date;
- date.setTime_t(GIT_COMMIT_DATE);
+#if QT_VERSION >= 0x050800
+ date.setSecsSinceEpoch(GIT_COMMIT_DATE);
+#else
+ // toSecsSinceEpoch() was added in Qt 5.8. Manually downconvert to seconds for now.
+ // See https://doc.qt.io/qt-5/qdatetime.html#toMSecsSinceEpoch
+ // Warning generated if not converting the 1000 to a qint64 first.
+ date.setMSecsSinceEpoch(GIT_COMMIT_DATE * (qint64)1000);
+#endif
buildInfo.commitDate = date.toString();
}
else if (!QString(DIST_HASH).contains("Format")) {
QStringList Quassel::Features::toStringList(bool enabled) const
{
+ // Check if any feature is enabled
+ if (!enabled && std::all_of(_features.cbegin(), _features.cend(), [](bool feature) { return !feature; })) {
+ return QStringList{} << "NoFeatures";
+ }
+
QStringList result;
+
// TODO Qt5: Use QMetaEnum::fromType()
auto featureEnum = Quassel::staticMetaObject.enumerator(Quassel::staticMetaObject.indexOfEnumerator("Feature"));
for (quint32 i = 0; i < _features.size(); ++i) {