added translations from anonsvn.kde.org [release 0.3.2.20200829git-2mamba;Thu Sep 10 2020]

This commit is contained in:
Silvan Calarco 2024-01-06 10:15:51 +01:00
parent f9698a9d90
commit 82f102f449
2 changed files with 151 additions and 3 deletions

View File

@ -0,0 +1,126 @@
From 6cff71f9dab014e1ea824e334ee029a5c62c35fa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Fri, 21 Jun 2019 01:08:28 +0200
Subject: Port away from KDELibs4Support, use Solid::Power interface
Summary:
The Solid::Power implementation does not track the state itself (to
avoid querying the initial state even when it is not used), so track
the state inside PkUpdates and query the initial state from the interface
asynchronously.
Test Plan:
The initial state is printed correctly in the debug output, same for
change notifications.
Depends on D21975
Reviewers: lukas, jgrulich
Reviewed By: jgrulich
Differential Revision: https://phabricator.kde.org/D21976
---
CMakeLists.txt | 2 +-
src/declarative/CMakeLists.txt | 4 ++--
src/declarative/pkupdates.cpp | 29 ++++++++++++++++++++++-------
src/declarative/pkupdates.h | 1 +
4 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d2dd2cb..48c4013 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,7 +26,7 @@ find_package(KF5 REQUIRED
I18n
CoreAddons # KFormat
Notifications
- KDELibs4Support #Solid::Power
+ Solid # Solid::Power
)
find_package(packagekitqt5 REQUIRED)
diff --git a/src/declarative/CMakeLists.txt b/src/declarative/CMakeLists.txt
index bdeb5b1..183a8d0 100644
--- a/src/declarative/CMakeLists.txt
+++ b/src/declarative/CMakeLists.txt
@@ -16,7 +16,7 @@ target_link_libraries(plasmapk_qmlplugins
KF5::CoreAddons
KF5::Notifications
KF5::ConfigCore
- KF5::KDELibs4Support
+ KF5::Solid
PK::packagekitqt5
)
@@ -38,7 +38,7 @@ target_link_libraries(plasmapk-console
KF5::I18n
KF5::CoreAddons
KF5::ConfigCore
- KF5::KDELibs4Support
+ KF5::Solid
KF5::Notifications
PK::packagekitqt5
)
diff --git a/src/declarative/pkupdates.cpp b/src/declarative/pkupdates.cpp
index ffccff7..db85eb1 100644
--- a/src/declarative/pkupdates.cpp
+++ b/src/declarative/pkupdates.cpp
@@ -27,7 +27,8 @@
#include <KLocalizedString>
#include <KFormat>
#include <KNotification>
-#include <Solid/PowerManagement>
+#include <Solid/Power>
+#include <Solid/AcPluggedJob>
#include <KConfigGroup>
#include <KSharedConfig>
@@ -47,18 +48,32 @@ namespace
} // namespace {
PkUpdates::PkUpdates(QObject *parent) :
- QObject(parent)
+ QObject(parent),
+ m_isOnBattery(true)
{
setStatusMessage(i18n("Idle"));
connect(PackageKit::Daemon::global(), &PackageKit::Daemon::changed, this, &PkUpdates::onChanged);
connect(PackageKit::Daemon::global(), &PackageKit::Daemon::updatesChanged, this, &PkUpdates::onUpdatesChanged);
connect(PackageKit::Daemon::global(), &PackageKit::Daemon::networkStateChanged, this, &PkUpdates::networkStateChanged);
- connect(Solid::PowerManagement::notifier(), &Solid::PowerManagement::Notifier::resumingFromSuspend, this,
+ connect(Solid::Power::self(), &Solid::Power::resumeFromSuspend, this,
[this] {PackageKit::Daemon::stateHasChanged(QStringLiteral("resume"));});
- connect(Solid::PowerManagement::notifier(), &Solid::PowerManagement::Notifier::appShouldConserveResourcesChanged,
- this, &PkUpdates::isOnBatteryChanged);
+ connect(Solid::Power::self(), &Solid::Power::acPluggedChanged, this, [this] (bool acPlugged) {
+ qCDebug(PLASMA_PK_UPDATES) << "acPluggedChanged onBattery:" << m_isOnBattery << "->" << !acPlugged;
+ if (!acPlugged != m_isOnBattery) {
+ m_isOnBattery = !acPlugged;
+ emit PkUpdates::isOnBatteryChanged();
+ }
+ });
+ auto acPluggedJob = Solid::Power::self()->isAcPlugged(this);
+ connect(acPluggedJob , &Solid::Job::result, this, [this] (Solid::Job* job) {
+ bool acPlugged = static_cast<Solid::AcPluggedJob*>(job)->isPlugged();
+ qCDebug(PLASMA_PK_UPDATES) << "acPlugged initial state" << acPlugged;
+ m_isOnBattery = !acPlugged;
+ emit PkUpdates::isOnBatteryChanged();
+ });
+ acPluggedJob->start();
connect(PackageKit::Daemon::global(), &PackageKit::Daemon::networkStateChanged, this, &PkUpdates::doDelayedCheckUpdates);
connect(this, &PkUpdates::isActiveChanged, this, &PkUpdates::messageChanged);
@@ -194,8 +209,8 @@ bool PkUpdates::isNetworkMobile() const
bool PkUpdates::isOnBattery() const
{
- qCDebug(PLASMA_PK_UPDATES) << "Is on battery:" << Solid::PowerManagement::appShouldConserveResources();
- return Solid::PowerManagement::appShouldConserveResources();
+ qCDebug(PLASMA_PK_UPDATES) << "Is on battery:" << m_isOnBattery;
+ return m_isOnBattery;
}
void PkUpdates::getUpdateDetails(const QString &pkgID)

View File

@ -1,16 +1,18 @@
%define majver %(echo %version | cut -d. -f1-2)
Name: plasma-pk-updates
Version: 0.3.2
Release: 1mamba
Version: 0.3.2.20200829git
Release: 2mamba
Summary: Plasma applet for software updates using PackageKit
Group: Graphical Desktop/Applications/Administration
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://devhub.io/zh/repos/caybro-plasma-pk-updates
Source: https://download.kde.org/stable/plasma-pk-updates/%{version}/plasma-pk-updates-%{version}.tar.xz
#Source: https://download.kde.org/stable/plasma-pk-updates/%{version}/plasma-pk-updates-%{version}.tar.xz
Source: https://anongit.kde.org/plasma-pk-updates.git/master/plasma-pk-updates-%{version}.tar.bz2
# Source: http://download.kde.org/stable/frameworks/%{majver}/...-%{version}.tar.xz
Patch0: plasma-pk-updates-0.3.2.20190908git-kde4libssupport.patch
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
@ -56,6 +58,16 @@ Plasma applet for software updates using PackageKit.
%prep
%setup -q
%patch0 -p1 -R
# Get translations
for l in ca ca@valencia cs da de en_GB es fi fr gl he it ja lt nl nn pl pt pt_BR ru sk sv tr uk zh_CN zh_TW; do
svn co svn://anonsvn.kde.org/home/kde/trunk/l10n-kf5/$l/messages/plasma-pk-updates po/$l
done
cat >> CMakeLists.txt << _EOF
ki18n_install(po)
_EOF
%build
%cmake_kde5 -d build
@ -74,6 +86,7 @@ Plasma applet for software updates using PackageKit.
%defattr(-,root,root)
%{_libdir}/qt5/qml/org/kde/plasma/PackageKit/libplasmapk_qmlplugins.so
%{_libdir}/qt5/qml/org/kde/plasma/PackageKit/qmldir
%{_datadir}/knotifications5/plasma_pk_updates.notifyrc
%{_datadir}/kservices5/plasma-applet-org.kde.plasma.pkupdates.desktop
%{_datadir}/metainfo/org.kde.plasma.pkupdates.appdata.xml
%dir %{_datadir}/plasma/plasmoids/org.kde.plasma.pkupdates
@ -88,5 +101,14 @@ Plasma applet for software updates using PackageKit.
%doc LICENSE
%changelog
* Thu Sep 10 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 0.3.2.20200829git-2mamba
- added translations from anonsvn.kde.org
* Sat Aug 29 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 0.3.2.20200829git-1mamba
- update to 0.3.2.20200829git
* Sun Sep 08 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 0.3.2.20190908git-1mamba
- update to 0.3.2.20190908git
* Thu Aug 15 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 0.3.2-1mamba
- package created using the webbuild interface