From 7113009b28ae5085c08ef4e128ccd96d71573ece Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Mon, 26 Oct 2020 19:11:31 +0100 Subject: [PATCH] Don't use API deprecated in Qt 5.14 --- datetime/integrationplugindatetime.cpp | 4 ++-- networkdetector/devicemonitor.cpp | 4 ++-- shelly/integrationpluginshelly.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/datetime/integrationplugindatetime.cpp b/datetime/integrationplugindatetime.cpp index eea8db8c..b99c614f 100644 --- a/datetime/integrationplugindatetime.cpp +++ b/datetime/integrationplugindatetime.cpp @@ -415,8 +415,8 @@ void IntegrationPluginDateTime::onDayChanged(const QDateTime &dateTime) m_todayDevice->setStateValue(todayMonthStateTypeId, dateTime.date().month()); m_todayDevice->setStateValue(todayYearStateTypeId, dateTime.date().year()); m_todayDevice->setStateValue(todayWeekdayStateTypeId, dateTime.date().dayOfWeek()); - m_todayDevice->setStateValue(todayWeekdayNameStateTypeId, dateTime.date().longDayName(dateTime.date().dayOfWeek())); - m_todayDevice->setStateValue(todayMonthNameStateTypeId, dateTime.date().longMonthName(dateTime.date().month())); + m_todayDevice->setStateValue(todayWeekdayNameStateTypeId, QLocale().dayName(dateTime.date().dayOfWeek())); + m_todayDevice->setStateValue(todayMonthNameStateTypeId, QLocale().monthName(dateTime.date().month())); if(dateTime.date().dayOfWeek() == 6 || dateTime.date().dayOfWeek() == 7){ m_todayDevice->setStateValue(todayWeekendStateTypeId, true); }else{ diff --git a/networkdetector/devicemonitor.cpp b/networkdetector/devicemonitor.cpp index 48e7c9b6..5c3ad603 100644 --- a/networkdetector/devicemonitor.cpp +++ b/networkdetector/devicemonitor.cpp @@ -45,7 +45,7 @@ DeviceMonitor::DeviceMonitor(const QString &name, const QString &macAddress, con connect(m_arpLookupProcess, SIGNAL(finished(int)), this, SLOT(arpLookupFinished(int))); m_arpingProcess = new QProcess(this); - m_arpingProcess->setReadChannelMode(QProcess::MergedChannels); + m_arpingProcess->setProcessChannelMode(QProcess::MergedChannels); #if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) // Actually we'd need this fix on older platforms too, but it's hard to figure this out without this API... connect(m_arpingProcess, &QProcess::errorOccurred, this, [this](QProcess::ProcessError error) { @@ -58,7 +58,7 @@ DeviceMonitor::DeviceMonitor(const QString &name, const QString &macAddress, con connect(m_arpingProcess, SIGNAL(finished(int)), this, SLOT(arpingFinished(int))); m_pingProcess = new QProcess(this); - m_pingProcess->setReadChannelMode(QProcess::MergedChannels); + m_pingProcess->setProcessChannelMode(QProcess::MergedChannels); connect(m_pingProcess, SIGNAL(finished(int)), this, SLOT(pingFinished(int))); } diff --git a/shelly/integrationpluginshelly.cpp b/shelly/integrationpluginshelly.cpp index 4d0132cb..7ffef99d 100644 --- a/shelly/integrationpluginshelly.cpp +++ b/shelly/integrationpluginshelly.cpp @@ -624,11 +624,11 @@ void IntegrationPluginShelly::setupShellyGateway(ThingSetupInfo *info) QHostAddress address; pluginStorage()->beginGroup(info->thing()->id().toString()); if (zeroConfEntry.isValid()) { - address = zeroConfEntry.hostAddress().toString(); + address = zeroConfEntry.hostAddress(); pluginStorage()->setValue("cachedAddress", address.toString()); } else { qCWarning(dcShelly()) << "Could not find Shelly thing on zeroconf. Trying cached address."; - address = pluginStorage()->value("cachedAddress").toString(); + address = QHostAddress(pluginStorage()->value("cachedAddress").toString()); } pluginStorage()->endGroup();