Merge PR #487: Cleanup warnings

This commit is contained in:
Jenkins nymea 2021-03-24 17:53:59 +01:00
commit 761cb149a2
10 changed files with 27 additions and 30 deletions

View File

@ -88,6 +88,7 @@ DeviceControlApplication::DeviceControlApplication(int argc, char *argv[]) : QAp
void DeviceControlApplication::handleNdefMessage(QNdefMessage message, QNearFieldTarget *target) void DeviceControlApplication::handleNdefMessage(QNdefMessage message, QNearFieldTarget *target)
{ {
Q_UNUSED(target)
qDebug() << "************* NFC message!" << message.toByteArray(); qDebug() << "************* NFC message!" << message.toByteArray();
if (message.count() < 1) { if (message.count() < 1) {
qWarning() << "NFC message doesn't contain any records..."; qWarning() << "NFC message doesn't contain any records...";

View File

@ -1,10 +1,5 @@
CONFIG += c++11 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_srcdir=$$PWD
top_builddir=$$shadowed($$PWD) top_builddir=$$shadowed($$PWD)
@ -14,8 +9,19 @@ APP_REVISION=$$member(VERSION_INFO, 1)
DEFINES+=APP_VERSION=\\\"$${APP_VERSION}\\\" 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: { android: {
QMAKE_POST_LINK += cp $$top_srcdir/version.txt $$top_builddir/ QMAKE_CXXFLAGS += -Wno-deprecated-declarations
QMAKE_POST_LINK += $$QMAKE_COPY $$shell_path($$top_srcdir/version.txt) $$shell_path($$top_builddir/)
!equals(OVERLAY_PATH, ""):!equals(BRANDING, "") { !equals(OVERLAY_PATH, ""):!equals(BRANDING, "") {
ANDROID_PACKAGE_SOURCE_DIR = $${OVERLAY_PATH}/packaging/android_$$BRANDING ANDROID_PACKAGE_SOURCE_DIR = $${OVERLAY_PATH}/packaging/android_$$BRANDING

View File

@ -49,6 +49,9 @@
#include <QDir> #include <QDir>
#include <QStandardPaths> #include <QStandardPaths>
#include "logging.h"
NYMEA_LOGGING_CATEGORY(dcJsonRpc, "JsonRpc")
JsonRpcClient::JsonRpcClient(QObject *parent) : JsonRpcClient::JsonRpcClient(QObject *parent) :
JsonHandler(parent), JsonHandler(parent),
m_id(0) m_id(0)
@ -170,9 +173,9 @@ void JsonRpcClient::getCloudConnectionStatus()
sendRequest(reply->requestMap()); sendRequest(reply->requestMap());
} }
void JsonRpcClient::setNotificationsEnabledResponse(int /*commandId*/, const QVariantMap &params) void JsonRpcClient::setNotificationsEnabledResponse(int commandId, const QVariantMap &params)
{ {
// qDebug() << "Notifications enabled:" << params; qCDebug(dcJsonRpc()) << "Notification configuration response:" << commandId << qUtf8Printable(QJsonDocument::fromVariant(params).toJson());
if (!m_connected) { if (!m_connected) {
m_connected = true; m_connected = true;

View File

@ -44,6 +44,7 @@ class Engine;
class LogsModelNg : public QAbstractListModel, public QQmlParserStatus class LogsModelNg : public QAbstractListModel, public QQmlParserStatus
{ {
Q_OBJECT Q_OBJECT
Q_INTERFACES(QQmlParserStatus)
Q_PROPERTY(Engine* engine READ engine WRITE setEngine NOTIFY engineChanged) Q_PROPERTY(Engine* engine READ engine WRITE setEngine NOTIFY engineChanged)
Q_PROPERTY(bool busy READ busy NOTIFY busyChanged) Q_PROPERTY(bool busy READ busy NOTIFY busyChanged)
Q_PROPERTY(bool live READ live WRITE setLive NOTIFY liveChanged) Q_PROPERTY(bool live READ live WRITE setLive NOTIFY liveChanged)

View File

@ -62,13 +62,13 @@ void SortFilterProxyModel::setSortOrder(Qt::SortOrder sortOrder)
emit sortOrderChanged(); 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()); int roleId = roleNames().key(role.toUtf8());
return QSortFilterProxyModel::data(index(row, 0), roleId); 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(); return QSortFilterProxyModel::mapToSource(this->index(index, 0)).row();
} }

View File

@ -26,8 +26,8 @@ public:
void setSortOrder(Qt::SortOrder sortOrder); void setSortOrder(Qt::SortOrder sortOrder);
Q_INVOKABLE QVariant data(int row, const QString &role) const; Q_INVOKABLE QVariant modelData(int row, const QString &role) const;
Q_INVOKABLE int mapToSource(int index) const; Q_INVOKABLE int mapToSourceIndex(int index) const;
signals: signals:
void filterRoleNameChanged(); void filterRoleNameChanged();

View File

@ -14,16 +14,6 @@ ScriptAutoSaver::~ScriptAutoSaver()
storeContent(); storeContent();
} }
void ScriptAutoSaver::classBegin()
{
}
void ScriptAutoSaver::componentComplete()
{
}
bool ScriptAutoSaver::available() const bool ScriptAutoSaver::available() const
{ {
return m_cacheFile.isOpen(); return m_cacheFile.isOpen();

View File

@ -3,10 +3,9 @@
#include <QObject> #include <QObject>
#include <QUuid> #include <QUuid>
#include <QQmlParserStatus>
#include <QFile> #include <QFile>
class ScriptAutoSaver : public QObject, public QQmlParserStatus class ScriptAutoSaver : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(QUuid scriptId READ scriptId WRITE setScriptId NOTIFY scriptIdChanged) Q_PROPERTY(QUuid scriptId READ scriptId WRITE setScriptId NOTIFY scriptIdChanged)
@ -17,10 +16,7 @@ class ScriptAutoSaver : public QObject, public QQmlParserStatus
public: public:
explicit ScriptAutoSaver(QObject *parent = nullptr); explicit ScriptAutoSaver(QObject *parent = nullptr);
~ScriptAutoSaver(); ~ScriptAutoSaver() override;
void classBegin() override;
void componentComplete() override;
bool available() const; bool available() const;

View File

@ -53,7 +53,7 @@ public:
int rowCount(const QModelIndex &parent = QModelIndex()) const override; int rowCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role) const override; QVariant data(const QModelIndex &index, int role) const override;
QHash<int, QByteArray> roleNames() const; QHash<int, QByteArray> roleNames() const override;
void addIOConnection(IOConnection *ioConnection); void addIOConnection(IOConnection *ioConnection);
void removeIOConnection(const QUuid &ioConnectionId); void removeIOConnection(const QUuid &ioConnectionId);

View File

@ -68,7 +68,7 @@ Page {
color: Style.headerForegroundColor color: Style.headerForegroundColor
text: d.configOverlay !== null ? text: d.configOverlay !== null ?
qsTr("Configure main view") 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")
} }
} }
} }