diff --git a/androidservice/controlviews/devicecontrolapplication.cpp b/androidservice/controlviews/devicecontrolapplication.cpp index 466135b8..95408d9a 100644 --- a/androidservice/controlviews/devicecontrolapplication.cpp +++ b/androidservice/controlviews/devicecontrolapplication.cpp @@ -88,6 +88,7 @@ DeviceControlApplication::DeviceControlApplication(int argc, char *argv[]) : QAp void DeviceControlApplication::handleNdefMessage(QNdefMessage message, QNearFieldTarget *target) { + Q_UNUSED(target) qDebug() << "************* NFC message!" << message.toByteArray(); if (message.count() < 1) { qWarning() << "NFC message doesn't contain any records..."; diff --git a/config.pri b/config.pri index b9b40ac9..0ae78029 100644 --- a/config.pri +++ b/config.pri @@ -1,10 +1,5 @@ CONFIG += c++11 -# We want -Wall to keep the code clean and tidy, however: -# On Windows, -Wall goes mental, so not using it there -# As of Qt 5.15, lots of things are deprecated inside Qt in preparation for Qt6 but no replacement to actually fix those yet. -!win32:QMAKE_CXXFLAGS += -Wall -Wno-deprecated-declarations -Wno-deprecated-copy - top_srcdir=$$PWD top_builddir=$$shadowed($$PWD) @@ -14,7 +9,18 @@ APP_REVISION=$$member(VERSION_INFO, 1) DEFINES+=APP_VERSION=\\\"$${APP_VERSION}\\\" +# We want -Wall to keep the code clean and tidy, however: +# On Windows, -Wall goes mental, so not using it there +!win32:QMAKE_CXXFLAGS += -Wall + +# As of Qt 5.15, lots of things are deprecated inside Qt in preparation for Qt6 but no replacement to actually fix those yet. +linux:!android { + QMAKE_CXXFLAGS += -Wno-deprecated-declarations -Wno-deprecated-copy +} + android: { + QMAKE_CXXFLAGS += -Wno-deprecated-declarations + QMAKE_POST_LINK += cp $$top_srcdir/version.txt $$top_builddir/ !equals(OVERLAY_PATH, ""):!equals(BRANDING, "") { diff --git a/libnymea-app/jsonrpc/jsonrpcclient.cpp b/libnymea-app/jsonrpc/jsonrpcclient.cpp index b8e6e0cb..c29820a1 100644 --- a/libnymea-app/jsonrpc/jsonrpcclient.cpp +++ b/libnymea-app/jsonrpc/jsonrpcclient.cpp @@ -49,6 +49,9 @@ #include #include +#include "logging.h" +NYMEA_LOGGING_CATEGORY(dcJsonRpc, "JsonRpc") + JsonRpcClient::JsonRpcClient(QObject *parent) : JsonHandler(parent), m_id(0) @@ -170,9 +173,9 @@ void JsonRpcClient::getCloudConnectionStatus() sendRequest(reply->requestMap()); } -void JsonRpcClient::setNotificationsEnabledResponse(int /*commandId*/, const QVariantMap ¶ms) +void JsonRpcClient::setNotificationsEnabledResponse(int commandId, const QVariantMap ¶ms) { -// qDebug() << "Notifications enabled:" << params; + qCDebug(dcJsonRpc()) << "Notification configuration response:" << commandId << qUtf8Printable(QJsonDocument::fromVariant(params).toJson()); if (!m_connected) { m_connected = true; diff --git a/libnymea-app/models/logsmodelng.h b/libnymea-app/models/logsmodelng.h index f9b58998..667e7f60 100644 --- a/libnymea-app/models/logsmodelng.h +++ b/libnymea-app/models/logsmodelng.h @@ -44,6 +44,7 @@ class Engine; class LogsModelNg : public QAbstractListModel, public QQmlParserStatus { Q_OBJECT + Q_INTERFACES(QQmlParserStatus) Q_PROPERTY(Engine* engine READ engine WRITE setEngine NOTIFY engineChanged) Q_PROPERTY(bool busy READ busy NOTIFY busyChanged) Q_PROPERTY(bool live READ live WRITE setLive NOTIFY liveChanged) diff --git a/libnymea-app/models/sortfilterproxymodel.cpp b/libnymea-app/models/sortfilterproxymodel.cpp index 2f65fde5..1bc69840 100644 --- a/libnymea-app/models/sortfilterproxymodel.cpp +++ b/libnymea-app/models/sortfilterproxymodel.cpp @@ -62,13 +62,13 @@ void SortFilterProxyModel::setSortOrder(Qt::SortOrder sortOrder) emit sortOrderChanged(); } -QVariant SortFilterProxyModel::data(int row, const QString &role) const +QVariant SortFilterProxyModel::modelData(int row, const QString &role) const { int roleId = roleNames().key(role.toUtf8()); return QSortFilterProxyModel::data(index(row, 0), roleId); } -int SortFilterProxyModel::mapToSource(int index) const +int SortFilterProxyModel::mapToSourceIndex(int index) const { return QSortFilterProxyModel::mapToSource(this->index(index, 0)).row(); } diff --git a/libnymea-app/models/sortfilterproxymodel.h b/libnymea-app/models/sortfilterproxymodel.h index 1115f1f5..3da3506b 100644 --- a/libnymea-app/models/sortfilterproxymodel.h +++ b/libnymea-app/models/sortfilterproxymodel.h @@ -26,8 +26,8 @@ public: void setSortOrder(Qt::SortOrder sortOrder); - Q_INVOKABLE QVariant data(int row, const QString &role) const; - Q_INVOKABLE int mapToSource(int index) const; + Q_INVOKABLE QVariant modelData(int row, const QString &role) const; + Q_INVOKABLE int mapToSourceIndex(int index) const; signals: void filterRoleNameChanged(); diff --git a/libnymea-app/scripting/scriptautosaver.cpp b/libnymea-app/scripting/scriptautosaver.cpp index 449351a2..4b362ca4 100644 --- a/libnymea-app/scripting/scriptautosaver.cpp +++ b/libnymea-app/scripting/scriptautosaver.cpp @@ -14,16 +14,6 @@ ScriptAutoSaver::~ScriptAutoSaver() storeContent(); } -void ScriptAutoSaver::classBegin() -{ - -} - -void ScriptAutoSaver::componentComplete() -{ - -} - bool ScriptAutoSaver::available() const { return m_cacheFile.isOpen(); diff --git a/libnymea-app/scripting/scriptautosaver.h b/libnymea-app/scripting/scriptautosaver.h index bc4d482c..77ad6a42 100644 --- a/libnymea-app/scripting/scriptautosaver.h +++ b/libnymea-app/scripting/scriptautosaver.h @@ -3,10 +3,9 @@ #include #include -#include #include -class ScriptAutoSaver : public QObject, public QQmlParserStatus +class ScriptAutoSaver : public QObject { Q_OBJECT Q_PROPERTY(QUuid scriptId READ scriptId WRITE setScriptId NOTIFY scriptIdChanged) @@ -17,10 +16,7 @@ class ScriptAutoSaver : public QObject, public QQmlParserStatus public: explicit ScriptAutoSaver(QObject *parent = nullptr); - ~ScriptAutoSaver(); - - void classBegin() override; - void componentComplete() override; + ~ScriptAutoSaver() override; bool available() const; diff --git a/libnymea-app/types/ioconnections.h b/libnymea-app/types/ioconnections.h index 2c410ae1..355ff42c 100644 --- a/libnymea-app/types/ioconnections.h +++ b/libnymea-app/types/ioconnections.h @@ -53,7 +53,7 @@ public: int rowCount(const QModelIndex &parent = QModelIndex()) const override; QVariant data(const QModelIndex &index, int role) const override; - QHash roleNames() const; + QHash roleNames() const override; void addIOConnection(IOConnection *ioConnection); void removeIOConnection(const QUuid &ioConnectionId); diff --git a/nymea-app/ui/MainPage.qml b/nymea-app/ui/MainPage.qml index 3e2bacf1..129dce11 100644 --- a/nymea-app/ui/MainPage.qml +++ b/nymea-app/ui/MainPage.qml @@ -68,7 +68,7 @@ Page { color: Style.headerForegroundColor text: d.configOverlay !== null ? qsTr("Configure main view") - : swipeView.currentItem.item.title.length > 0 ? swipeView.currentItem.item.title : filteredContentModel.data(swipeView.currentIndex, "displayName") + : swipeView.currentItem.item.title.length > 0 ? swipeView.currentItem.item.title : filteredContentModel.modelData(swipeView.currentIndex, "displayName") } } }