OSDN Git Service

plasma: do not warn from KWeatherData::fromString() when the data is empty
authorIvailo Monev <xakepa10@gmail.com>
Sun, 24 Sep 2023 08:51:24 +0000 (11:51 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Sun, 24 Sep 2023 08:51:24 +0000 (11:51 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
plasma/applets/weather/weather.cpp

index 94c2017..a5a5e2c 100644 (file)
@@ -273,6 +273,10 @@ bool KWeatherData::isValid() const
 KWeatherData KWeatherData::fromString(const QString &data)
 {
     KWeatherData result;
+    if (data.isEmpty()) {
+        // no warning for when there was no saved data
+        return result;
+    }
     const QStringList splitdata = data.split(s_weatherdataseparator);
     if (splitdata.size() != 5) {
         kWarning() << "invalid KWeatherData" << data;