diff options
author | Andreas Sturmlechner <asturm@gentoo.org> | 2021-11-15 15:29:24 +0100 |
---|---|---|
committer | Andreas Sturmlechner <asturm@gentoo.org> | 2021-11-23 15:59:15 +0100 |
commit | e4d3f8da14ece852be3a05d8ac0984e3c46905f5 (patch) | |
tree | c914d62cd5ec58e6eb9d0e6d8f8bc38a74340336 /kde-plasma/powerdevil | |
parent | kde-plasma/plasma-workspace: Drop 5.23.3-r1 (diff) | |
download | gentoo-e4d3f8da14ece852be3a05d8ac0984e3c46905f5.tar.gz gentoo-e4d3f8da14ece852be3a05d8ac0984e3c46905f5.tar.bz2 gentoo-e4d3f8da14ece852be3a05d8ac0984e3c46905f5.zip |
kde-plasma/powerdevil: Always dismiss critical battery notification
Upstream commit d8c5490c99bae9f979f6483dc7b0381121a4f997
KDE-bug: https://bugs.kde.org/show_bug.cgi?id=445171
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'kde-plasma/powerdevil')
-rw-r--r-- | kde-plasma/powerdevil/files/powerdevil-5.23.3-dismiss-battery-notifications.patch | 71 | ||||
-rw-r--r-- | kde-plasma/powerdevil/powerdevil-5.23.3-r1.ebuild | 71 |
2 files changed, 142 insertions, 0 deletions
diff --git a/kde-plasma/powerdevil/files/powerdevil-5.23.3-dismiss-battery-notifications.patch b/kde-plasma/powerdevil/files/powerdevil-5.23.3-dismiss-battery-notifications.patch new file mode 100644 index 000000000000..997807a2214a --- /dev/null +++ b/kde-plasma/powerdevil/files/powerdevil-5.23.3-dismiss-battery-notifications.patch @@ -0,0 +1,71 @@ +From d8c5490c99bae9f979f6483dc7b0381121a4f997 Mon Sep 17 00:00:00 2001 +From: Kai Uwe Broulik <kde@privat.broulik.de> +Date: Mon, 8 Nov 2021 20:02:33 +0100 +Subject: [PATCH] Always dismiss critical battery notification + +The timer isn't running when user chose "Do nothing" on critical battery + +BUG: 445171 +FIXED-IN: 5.23.4 + + +(cherry picked from commit 5668ded34f928ffce43ebe1defb775e70bbbb3b7) +--- + daemon/powerdevilcore.cpp | 22 +++++++++++++--------- + 1 file changed, 13 insertions(+), 9 deletions(-) + +diff --git a/daemon/powerdevilcore.cpp b/daemon/powerdevilcore.cpp +index 040dd6b6..c5ba3e54 100644 +--- a/daemon/powerdevilcore.cpp ++++ b/daemon/powerdevilcore.cpp +@@ -259,7 +259,7 @@ void Core::reparseConfiguration() + Q_EMIT configurationReloaded(); + + // Check if critical threshold might have changed and cancel the timer if necessary. +- if (m_criticalBatteryTimer->isActive() && currentChargePercent() > PowerDevilSettings::batteryCriticalLevel()) { ++ if (currentChargePercent() > PowerDevilSettings::batteryCriticalLevel()) { + m_criticalBatteryTimer->stop(); + if (m_criticalBatteryNotification) { + m_criticalBatteryNotification->close(); +@@ -494,14 +494,17 @@ void Core::onDeviceAdded(const QString &udi) + m_lowBatteryNotification->close(); + } + +- if (m_criticalBatteryTimer->isActive() && currentChargePercent() > PowerDevilSettings::batteryCriticalLevel()) { +- m_criticalBatteryTimer->stop(); ++ if (currentChargePercent() > PowerDevilSettings::batteryCriticalLevel()) { + if (m_criticalBatteryNotification) { + m_criticalBatteryNotification->close(); + } +- emitRichNotification(QStringLiteral("pluggedin"), +- i18n("Extra Battery Added"), +- i18n("The computer will no longer go to sleep.")); ++ ++ if (m_criticalBatteryTimer->isActive()) { ++ m_criticalBatteryTimer->stop(); ++ emitRichNotification(QStringLiteral("pluggedin"), ++ i18n("Extra Battery Added"), ++ i18n("The computer will no longer go to sleep.")); ++ } + } + } + +@@ -692,11 +695,12 @@ void Core::onAcAdapterStateChanged(PowerDevil::BackendInterface::AcAdapterState + m_lowBatteryNotification->close(); + } + ++ if (m_criticalBatteryNotification) { ++ m_criticalBatteryNotification->close(); ++ } ++ + if (m_criticalBatteryTimer->isActive()) { + m_criticalBatteryTimer->stop(); +- if (m_criticalBatteryNotification) { +- m_criticalBatteryNotification->close(); +- } + emitRichNotification(QStringLiteral("pluggedin"), + i18n("AC Adapter Plugged In"), + i18n("The computer will no longer go to sleep.")); +-- +GitLab + diff --git a/kde-plasma/powerdevil/powerdevil-5.23.3-r1.ebuild b/kde-plasma/powerdevil/powerdevil-5.23.3-r1.ebuild new file mode 100644 index 000000000000..a6c9f5612a36 --- /dev/null +++ b/kde-plasma/powerdevil/powerdevil-5.23.3-r1.ebuild @@ -0,0 +1,71 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ECM_HANDBOOK="forceoptional" +KFMIN=5.86.0 +PVCUT=$(ver_cut 1-3) +QTMIN=5.15.2 +inherit ecm kde.org + +DESCRIPTION="Power management for KDE Plasma Shell" +HOMEPAGE="https://invent.kde.org/plasma/powerdevil" + +LICENSE="GPL-2" # TODO: CHECK +SLOT="5" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86" +IUSE="brightness-control caps +wireless" + +DEPEND=" + >=dev-qt/qtdbus-${QTMIN}:5 + >=dev-qt/qtgui-${QTMIN}:5 + >=dev-qt/qtwidgets-${QTMIN}:5 + >=dev-qt/qtx11extras-${QTMIN}:5 + >=kde-frameworks/kactivities-${KFMIN}:5 + >=kde-frameworks/kauth-${KFMIN}:5[policykit] + >=kde-frameworks/kcompletion-${KFMIN}:5 + >=kde-frameworks/kconfig-${KFMIN}:5 + >=kde-frameworks/kconfigwidgets-${KFMIN}:5 + >=kde-frameworks/kcoreaddons-${KFMIN}:5 + >=kde-frameworks/kcrash-${KFMIN}:5 + >=kde-frameworks/kdbusaddons-${KFMIN}:5 + >=kde-frameworks/kglobalaccel-${KFMIN}:5 + >=kde-frameworks/ki18n-${KFMIN}:5 + >=kde-frameworks/kidletime-${KFMIN}:5 + >=kde-frameworks/kio-${KFMIN}:5 + >=kde-frameworks/knotifications-${KFMIN}:5 + >=kde-frameworks/knotifyconfig-${KFMIN}:5 + >=kde-frameworks/kservice-${KFMIN}:5 + >=kde-frameworks/kwayland-${KFMIN}:5 + >=kde-frameworks/kwidgetsaddons-${KFMIN}:5 + >=kde-frameworks/kxmlgui-${KFMIN}:5 + >=kde-frameworks/solid-${KFMIN}:5 + >=kde-plasma/libkscreen-${PVCUT}:5 + >=kde-plasma/libkworkspace-${PVCUT}:5 + virtual/libudev:= + x11-libs/libxcb + brightness-control? ( app-misc/ddcutil ) + caps? ( sys-libs/libcap ) + wireless? ( + >=kde-frameworks/bluez-qt-${KFMIN}:5 + >=kde-frameworks/networkmanager-qt-${KFMIN}:5 + ) +" +RDEPEND="${DEPEND} + >=kde-plasma/kde-cli-tools-${PVCUT}:5 + >=sys-power/upower-0.9.23 +" + +PATCHES=( "${FILESDIR}"/${P}-dismiss-battery-notifications.patch ) + +src_configure() { + local mycmakeargs=( + -DHAVE_DDCUTIL=$(usex brightness-control) + $(cmake_use_find_package caps Libcap) + $(cmake_use_find_package wireless KF5BluezQt) + $(cmake_use_find_package wireless KF5NetworkManagerQt) + ) + + ecm_src_configure +} |