rpms/kdebase-workspace/F-9 kdebase-workspace-4.2.3-weather-dataengine-nm.patch, NONE, 1.1 kdebase-workspace.spec, 1.150, 1.151

Kevin Kofler kkofler at fedoraproject.org
Thu May 14 02:54:08 UTC 2009


Author: kkofler

Update of /cvs/pkgs/rpms/kdebase-workspace/F-9
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv18288/F-9

Modified Files:
	kdebase-workspace.spec 
Added Files:
	kdebase-workspace-4.2.3-weather-dataengine-nm.patch 
Log Message:
Sync from F-11:
* Thu May 14 2009 Kevin Kofler <Kevin at tigcc.ticalc.org> - 4.2.3-3
- check for network availability through Solid/NM in the weather dataengine

kdebase-workspace-4.2.3-weather-dataengine-nm.patch:

--- NEW FILE kdebase-workspace-4.2.3-weather-dataengine-nm.patch ---
diff -ur kdebase-workspace-4.2.3/plasma/dataengines/weather/CMakeLists.txt kdebase-workspace-4.2.3-weather-dataengine-nm/plasma/dataengines/weather/CMakeLists.txt
--- kdebase-workspace-4.2.3/plasma/dataengines/weather/CMakeLists.txt	2008-11-04 21:25:02.000000000 +0100
+++ kdebase-workspace-4.2.3-weather-dataengine-nm/plasma/dataengines/weather/CMakeLists.txt	2009-05-14 04:20:00.000000000 +0200
@@ -2,6 +2,6 @@
 
 SET(weather_SRCS weatherengine.cpp)
 kde4_add_plugin(plasma_engine_weather ${weather_SRCS})
-TARGET_LINK_LIBRARIES (plasma_engine_weather ${KDE4_KIO_LIBS} ${KDE4_PLASMA_LIBS} weather_ion)
+TARGET_LINK_LIBRARIES (plasma_engine_weather ${KDE4_KIO_LIBS} ${KDE4_SOLID_LIBS} ${KDE4_PLASMA_LIBS} weather_ion)
 INSTALL (TARGETS plasma_engine_weather DESTINATION ${PLUGIN_INSTALL_DIR})
 INSTALL (FILES plasma-dataengine-weather.desktop DESTINATION ${SERVICES_INSTALL_DIR})
diff -ur kdebase-workspace-4.2.3/plasma/dataengines/weather/weatherengine.cpp kdebase-workspace-4.2.3-weather-dataengine-nm/plasma/dataengines/weather/weatherengine.cpp
--- kdebase-workspace-4.2.3/plasma/dataengines/weather/weatherengine.cpp	2008-11-12 17:37:22.000000000 +0100
+++ kdebase-workspace-4.2.3-weather-dataengine-nm/plasma/dataengines/weather/weatherengine.cpp	2009-05-14 04:28:53.000000000 +0200
@@ -26,7 +26,7 @@
 class WeatherEngine::Private
 {
 public:
-    Private() {}
+    Private() : m_networkAvailable(false) {}
     ~Private() {
         qDeleteAll(m_ions);
     }
@@ -68,6 +68,7 @@
     KService::List m_ionServices;
     IonInterface::IonDict m_ions;
     KDateTime m_localTime;
+    bool m_networkAvailable;
 };
 
 /**
@@ -235,6 +236,12 @@
 
     // Globally notify all plugins to remove their sources (and unload plugin)
     connect(this, SIGNAL(sourceRemoved(QString)), this, SLOT(removeIonSource(QString)));
+
+    Solid::Networking::Status status = Solid::Networking::status();
+    d->m_networkAvailable = (status == Solid::Networking::Connected ||
+                             status == Solid::Networking::Unknown);
+    connect(Solid::Networking::notifier(), SIGNAL(statusChanged(Solid::Networking::Status)),
+            this, SLOT(networkStatusChanged(Solid::Networking::Status)));
 }
 
 // Destructor
@@ -260,6 +267,11 @@
         }
     }
 
+    if (!d->m_networkAvailable) {
+        setData(source, Data());
+        return true;
+    }
+
     QByteArray str = source.toLocal8Bit();
 
     ion->connectSource(source, this);
@@ -280,18 +292,27 @@
 
     QByteArray str = source.toLocal8Bit();
 
-    kDebug() << "updateSourceEvent()";
+    kDebug() << "updateSourceEvent()" << ion << d->m_networkAvailable;
     if (!ion) {
         return false;
     }
 
+    if (!d->m_networkAvailable) {
+        return false;
+    }
+
     ion->setProperty("timezone", d->m_localTime.isUtc());
     ion->setProperty("unit", KGlobal::locale()->measureSystem());
+    return ion->updateSourceEvent(source);
+}
 
-    if (ion->updateSourceEvent(source)) {
-        return true;
-    } else {
-        return false;
+void WeatherEngine::networkStatusChanged(Solid::Networking::Status status)
+{
+    d->m_networkAvailable = (status == Solid::Networking::Connected || status == Solid::Networking::Unknown);
+    //kDebug() << "status changed" << d->m_networkAvailable;
+
+    if (d->m_networkAvailable) {
+        updateAllSources();
     }
 }
 
diff -ur kdebase-workspace-4.2.3/plasma/dataengines/weather/weatherengine.h kdebase-workspace-4.2.3-weather-dataengine-nm/plasma/dataengines/weather/weatherengine.h
--- kdebase-workspace-4.2.3/plasma/dataengines/weather/weatherengine.h	2008-11-04 18:12:33.000000000 +0100
+++ kdebase-workspace-4.2.3-weather-dataengine-nm/plasma/dataengines/weather/weatherengine.h	2009-05-14 04:20:00.000000000 +0200
@@ -22,7 +22,11 @@
 
 #include <KService>
 #include <KGenericFactory>
+
+#include <Solid/Networking>
+
 #include <Plasma/DataEngine>
+
 #include "ions/ion.h"
 
 class QTimer;
@@ -100,6 +104,11 @@
      */
     bool updateSourceEvent(const QString& source);
 
+    /**
+     * Whenever networking changes, take action
+     */
+    void networkStatusChanged(Solid::Networking::Status);
+
 private:
     class Private;
     Private *const d;


Index: kdebase-workspace.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kdebase-workspace/F-9/kdebase-workspace.spec,v
retrieving revision 1.150
retrieving revision 1.151
diff -u -p -r1.150 -r1.151
--- kdebase-workspace.spec	7 May 2009 10:41:22 -0000	1.150
+++ kdebase-workspace.spec	14 May 2009 02:53:38 -0000	1.151
@@ -8,7 +8,7 @@ Summary: K Desktop Environment - Workspa
 Name: kdebase-workspace
 Version: 4.2.3
 
-Release: 2%{?dist}
+Release: 3%{?dist}
 Source0: ftp://ftp.kde.org/pub/kde/stable/%{version}/src/kdebase-workspace-%{version}.tar.bz2
 License: GPLv2
 Group: User Interface/Desktops
@@ -44,6 +44,8 @@ Patch102: kdebase-workspace-4.2.0-blueto
 Patch103: kdebase-workspace-4.2.0-kde#180576.patch
 # 4.3, https://bugs.kde.org/show_bug.cgi?id=184152
 Patch105: kdebase-workspace-4.3.0-desktopnumbers.patch
+# from 4.3: check for network avail. through Solid/NM in the weather dataengine
+Patch106: kdebase-workspace-4.2.3-weather-dataengine-nm.patch
 
 
 # FIXME: Should we restore this now that kdebase no longer depends on kdebase-workspace?
@@ -239,6 +241,7 @@ popd
 %endif
 %patch103 -p1 -b .kde#180576
 %patch105 -p0 -b .desktopnumbers
+%patch106 -p1 -b .weather-dataengine-nm
 
 %build
 
@@ -513,6 +516,9 @@ fi
 
 
 %changelog
+* Thu May 14 2009 Kevin Kofler <Kevin at tigcc.ticalc.org> - 4.2.3-3
+- check for network availability through Solid/NM in the weather dataengine
+
 * Wed May 06 2009 Than Ngo <than at redhat.com> - 4.2.3-2
 - Requires: oxygen-icon-theme >= 4.2.2
 - fix oxygen-cursor-themes noarch'ness




More information about the fedora-extras-commits mailing list