diff --git a/kdelibs-4.7.5-batteryplasmoid.patch b/kdelibs-4.7.5-batteryplasmoid.patch deleted file mode 100644 index fcaf0fa..0000000 --- a/kdelibs-4.7.5-batteryplasmoid.patch +++ /dev/null @@ -1,57 +0,0 @@ -commit 1b6f332c3c539a45f6ed5a85897ecf8a65fbb216 -Author: Lukas Tinkl -Date: Mon Dec 12 20:03:43 2011 +0100 - - disconnect the battery signals when it gets removed - - see https://bugzilla.redhat.com/show_bug.cgi?id=753429 and - https://bugzilla.redhat.com/show_bug.cgi?id=766399 - -diff --git a/plasma/generic/dataengines/powermanagement/powermanagementengine.cpp b/plasma/generic/dataengines/powermanagement/powermanagementengine.cpp -index a5344da..2bee9a7 100644 ---- a/plasma/generic/dataengines/powermanagement/powermanagementengine.cpp -+++ b/plasma/generic/dataengines/powermanagement/powermanagementengine.cpp -@@ -105,8 +105,7 @@ QStringList PowermanagementEngine::sources() const - bool PowermanagementEngine::sourceRequestEvent(const QString &name) - { - if (name == "Battery") { -- const QList listBattery = -- Solid::Device::listFromType(Solid::DeviceInterface::Battery, QString()); -+ const QList listBattery = Solid::Device::listFromType(Solid::DeviceInterface::Battery); - m_batterySources.clear(); - - if (listBattery.isEmpty()) { -@@ -160,7 +159,7 @@ bool PowermanagementEngine::sourceRequestEvent(const QString &name) - } else if (name == "AC Adapter") { - bool isPlugged = false; - -- const QList list_ac = Solid::Device::listFromType(Solid::DeviceInterface::AcAdapter, QString()); -+ const QList list_ac = Solid::Device::listFromType(Solid::DeviceInterface::AcAdapter); - foreach (Solid::Device device_ac, list_ac) { - Solid::AcAdapter* acadapter = device_ac.as(); - isPlugged |= acadapter->isPlugged(); -@@ -232,6 +231,11 @@ void PowermanagementEngine::updateAcPlugState(bool newState) - void PowermanagementEngine::deviceRemoved(const QString& udi) - { - if (m_batterySources.contains(udi)) { -+ Solid::Device device(udi); -+ Solid::Battery* battery = device.as(); -+ if (battery) -+ battery->disconnect(); -+ - const QString source = m_batterySources[udi]; - m_batterySources.remove(udi); - removeSource(source); -diff --git a/plasma/generic/dataengines/powermanagement/powermanagementengine.h b/plasma/generic/dataengines/powermanagement/powermanagementengine.h -index 4dcc0d9..96ffd45 100644 ---- a/plasma/generic/dataengines/powermanagement/powermanagementengine.h -+++ b/plasma/generic/dataengines/powermanagement/powermanagementengine.h -@@ -63,7 +63,7 @@ private: - - QStringList m_sources; - -- QHash m_batterySources; -+ QHash m_batterySources; // - - }; - diff --git a/kdelibs-4.7.5-dataengine-source-removed.patch b/kdelibs-4.7.5-dataengine-source-removed.patch new file mode 100644 index 0000000..0579847 --- /dev/null +++ b/kdelibs-4.7.5-dataengine-source-removed.patch @@ -0,0 +1,33 @@ +commit a8b49bc65afb1d05e7de0148c3116f2f6a1f98de +Author: Aaron Seigo +Date: Wed Nov 30 09:17:01 2011 +0100 + + grab the source name before removing the iterator + + the previous fix, which i accidentally reverted while cleaning up this code, + was actually wrong (so in a way i'm glad i caught it): the signal MUST be emitted + AFTER the item is removed from the collection otherwise any code that checks to + see if that source exists will see that it does still exist even though it was + just signaled as being removed. order sometimes really matters :) + + CCMAIL:kde@rusu.info + BUG:287795 + +diff --git a/plasma/dataengine.cpp b/plasma/dataengine.cpp +index 718dfba..364b15e 100644 +--- a/plasma/dataengine.cpp ++++ b/plasma/dataengine.cpp +@@ -331,10 +331,11 @@ void DataEngine::removeAllSources() + while (it.hasNext()) { + it.next(); + Plasma::DataContainer *s = it.value(); ++ const QString &source = it.key(); ++ it.remove(); + s->disconnect(this); + s->deleteLater(); +- emit sourceRemoved(it.key()); +- it.remove(); ++ emit sourceRemoved(source); + } + } + diff --git a/kdelibs.spec b/kdelibs.spec index 745e967..db2a286 100644 --- a/kdelibs.spec +++ b/kdelibs.spec @@ -131,7 +131,7 @@ Patch52: kdelibs-4.7.4-SOLID_UPNP.patch Patch53: kdelibs-4.7.2-kjs-s390.patch ## upstream -Patch100: kdelibs-4.7.5-batteryplasmoid.patch +Patch100: kdelibs-4.7.5-dataengine-source-removed.patch ## security fix # Not Upstreamed? why not ? -- Rex @@ -323,7 +323,7 @@ sed -i -e "s|@@VERSION_RELEASE@@|%{version}-%{release}|" kio/kio/kprotocolmanage %endif # upstream patches -%patch100 -p1 -b .batteryplasmoid +%patch100 -p1 -b .dataengine-source-removed # upstreamable patches %patch50 -p1 -b .knewstuff2_gpg2