Index | Thread | Search

From:
Rafael Sadowski <rafael@sizeofvoid.org>
Subject:
KDE Plasma: fix WeatherEngine
To:
ports@openbsd.org
Cc:
Rafael Sadowski <rsadowski@openbsd.org>
Date:
Fri, 1 Aug 2025 18:49:16 +0200

Download raw body.

Thread
QNetworkInformation::Reachability is not available on OpenBSD,
stop using it and fallback to the default one. Tested on amd64.
OK?

Cheers Rafael

Index: Makefile
===================================================================
RCS file: /cvs/ports/x11/kde-plasma/plasma-workspace/Makefile,v
diff -u -p -u -p -r1.24 Makefile
--- Makefile	16 Jul 2025 18:41:20 -0000	1.24
+++ Makefile	1 Aug 2025 16:47:39 -0000
@@ -1,5 +1,6 @@
 COMMENT =	various components needed to run a Plasma-based environment
 DISTNAME =	plasma-workspace-${VERSION}
+REVISION =	0
 
 SHARED_LIBS +=  colorcorrect              1.0 # 0.0
 SHARED_LIBS +=  kfontinst                 1.0 # 0.0
Index: patches/patch-dataengines_weather_weatherengine_cpp
===================================================================
RCS file: patches/patch-dataengines_weather_weatherengine_cpp
diff -N patches/patch-dataengines_weather_weatherengine_cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-dataengines_weather_weatherengine_cpp	1 Aug 2025 16:47:39 -0000
@@ -0,0 +1,18 @@
+QNetworkInformation::Reachability is not available on OpenBSD, stop using it
+and fallback to the default one.
+
+Index: dataengines/weather/weatherengine.cpp
+--- dataengines/weather/weatherengine.cpp.orig
++++ dataengines/weather/weatherengine.cpp
+@@ -25,7 +25,10 @@ WeatherEngine::WeatherEngine(QObject *parent)
+     // Globally notify all plugins to remove their sources (and unload plugin)
+     connect(this, &Plasma5Support::DataEngine::sourceRemoved, this, &WeatherEngine::removeIonSource);
+ 
+-    QNetworkInformation::load(QNetworkInformation::Feature::Reachability);
++    if (!QNetworkInformation::load(QNetworkInformation::Feature::Reachability)) {
++         // Fallback
++         QNetworkInformation::loadDefaultBackend();
++    }
+     connect(QNetworkInformation::instance(), &QNetworkInformation::reachabilityChanged, this, &WeatherEngine::onOnlineStateChanged);
+ 
+     // Get the list of available plugins but don't load them