From 166b16689f54a0ed335bb14fa8c7fec9e08c4f1a Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Mon, 26 Oct 2020 15:59:38 +0100 Subject: [PATCH] Don't use deprecated QString::sprintf and qVariantFromValue --- libnymea/coap/coapobserveresource.cpp | 7 ------- libnymea/coap/coapobserveresource.h | 1 - server/nymeaapplication.cpp | 6 +++--- tests/utils/pushbuttonagent.cpp | 2 +- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/libnymea/coap/coapobserveresource.cpp b/libnymea/coap/coapobserveresource.cpp index ef2e5e1c..c141a5f1 100644 --- a/libnymea/coap/coapobserveresource.cpp +++ b/libnymea/coap/coapobserveresource.cpp @@ -55,13 +55,6 @@ CoapObserveResource::CoapObserveResource(const QUrl &url, const QByteArray &toke { } -/*! Constructs a copy of the given \a other \l{CoapObserveResource}. */ -CoapObserveResource::CoapObserveResource(const CoapObserveResource &other) -{ - m_url = other.url(); - m_token = other.token(); -} - /*! Returns the url of this \l{CoapObserveResource}. */ QUrl CoapObserveResource::url() const { diff --git a/libnymea/coap/coapobserveresource.h b/libnymea/coap/coapobserveresource.h index a5c2e9e9..cf792773 100644 --- a/libnymea/coap/coapobserveresource.h +++ b/libnymea/coap/coapobserveresource.h @@ -42,7 +42,6 @@ class LIBNYMEA_EXPORT CoapObserveResource public: CoapObserveResource(); CoapObserveResource(const QUrl &url, const QByteArray &token); - CoapObserveResource(const CoapObserveResource &other); QUrl url() const; QByteArray token() const; diff --git a/server/nymeaapplication.cpp b/server/nymeaapplication.cpp index 43627139..9f886c6d 100644 --- a/server/nymeaapplication.cpp +++ b/server/nymeaapplication.cpp @@ -76,7 +76,7 @@ static void printBacktrace() size_t funktionNameSize = 256; char* functionName = (char*)malloc(funktionNameSize); for (int i = 1; i < traceLength; i++) { - QString address = QString().sprintf("%p", trace[i]); + QString address = QString::asprintf("%p", trace[i]); QString fileName = QString(symbolList[i]); int fileIndex = fileName.indexOf("("); QString lineCommand = QString("addr2line %1 -e %2").arg(address).arg(fileName.left(fileIndex)); @@ -110,9 +110,9 @@ static void printBacktrace() char* ret = abi::__cxa_demangle(begin_name, functionName, &funktionNameSize, &status); if (status == 0) { functionName = ret; - functionString = QString(" %1").arg(QString().sprintf("%s+%s", functionName, begin_offset)); + functionString = QString(" %1").arg(QString::asprintf("%s+%s", functionName, begin_offset)); } else { - functionString = QString(" %1").arg(QString().sprintf("%s()+%s", begin_name, begin_offset)); + functionString = QString(" %1").arg(QString::asprintf("%s()+%s", begin_name, begin_offset)); } } diff --git a/tests/utils/pushbuttonagent.cpp b/tests/utils/pushbuttonagent.cpp index 87561ca7..fc3bd945 100644 --- a/tests/utils/pushbuttonagent.cpp +++ b/tests/utils/pushbuttonagent.cpp @@ -42,7 +42,7 @@ bool PushButtonAgent::init(QDBusConnection::BusType busType) } QDBusMessage message = QDBusMessage::createMethodCall("io.guh.nymead", "/io/guh/nymead/UserManager", "io.guh.nymead", "RegisterButtonAgent"); - message << qVariantFromValue(QDBusObjectPath("/nymea/pushbuttonhandler")); + message << QVariant::fromValue(QDBusObjectPath("/nymea/pushbuttonhandler")); QDBusMessage reply = bus.call(message); if (!reply.errorName().isEmpty()) { qCWarning(dcPushButtonAgent()) << "Error registering PushButton agent:" << reply.errorMessage();