Debian

Available patches from Ubuntu

To see Ubuntu differences wrt. to Debian, write down a grep-dctrl query identifying the packages you're interested in:
grep-dctrl -n -sPackage Sources.Debian
(e.g. -FPackage linux-ntfs or linux-ntfs)

Modified packages are listed below:

Debian ( Changelog | PTS | Bugs ) Ubuntu ( Changelog | txt | LP | Bugs ) | Diff from Ubuntu

Source: fwupd

fwupd (1.2.10-1ubuntu2) eoan; urgency=medium * Backport a patch from upstream to relax expired cert checks in self tests to fix FTBFS (LP: #184375) * Add a patch to skip some self tests if /etc/machine-id exists but is empty (LP: #184375) -- Mario Limonciello <mario.limonciello@dell.com> Tue, 24 Sep 2019 09:24:22 -0500 fwupd (1.2.10-1ubuntu1) eoan; urgency=medium * Merge with debian unstable. - Remainining changes: downgrade tpm2-tools/tpm2-abrmd to Suggests. -- Mario Limonciello <mario.limonciello@dell.com> Mon, 15 Jul 2019 14:13:33 -0500

Modifications :
  1. Download patch debian/control

    --- 1.2.10-1/debian/control 2019-07-15 19:11:29.000000000 +0000 +++ 1.2.10-1ubuntu2/debian/control 2019-09-24 15:36:25.000000000 +0000 @@ -84,9 +84,9 @@ Depends: ${misc:Depends}, shared-mime-info Recommends: python3, bolt, - tpm2-tools, - tpm2-abrmd, fwupd-signed +Suggests: tpm2-tools, + tpm2-abrmd, Breaks: gir1.2-dfu-1.0 (<< 0.9.7-1), libdfu1 (<< 0.9.7-1), libdfu-dev (<< 0.9.7-1)
  2. Download patch debian/control.in

    --- 1.2.10-1/debian/control.in 2019-07-15 18:58:31.000000000 +0000 +++ 1.2.10-1ubuntu2/debian/control.in 2019-07-15 19:12:57.000000000 +0000 @@ -34,9 +34,9 @@ Depends: ${misc:Depends}, shared-mime-info Recommends: python3, bolt, - tpm2-tools, - tpm2-abrmd, fwupd-signed +Suggests: tpm2-tools, + tpm2-abrmd, Breaks: gir1.2-dfu-1.0 (<< 0.9.7-1), libdfu1 (<< 0.9.7-1), libdfu-dev (<< 0.9.7-1)
  3. Download patch debian/patches/0001-trivial-libfwupd-skip-tests-if-machine-id-is-empty-t.patch

    --- 1.2.10-1/debian/patches/0001-trivial-libfwupd-skip-tests-if-machine-id-is-empty-t.patch 1970-01-01 00:00:00.000000000 +0000 +++ 1.2.10-1ubuntu2/debian/patches/0001-trivial-libfwupd-skip-tests-if-machine-id-is-empty-t.patch 2019-09-24 15:35:45.000000000 +0000 @@ -0,0 +1,38 @@ +From d0fd614bb9023ea7c8f831fc6bfe122a3dbc9032 Mon Sep 17 00:00:00 2001 +From: Mario Limonciello <mario.limonciello@dell.com> +Date: Tue, 24 Sep 2019 10:29:22 -0500 +Subject: [PATCH] trivial: libfwupd: skip tests if machine-id is empty too + +Ubuntu's buildds seem to have changed and this is causing test suite +failures. +--- + libfwupd/fwupd-self-test.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +Index: fwupd-1.2.10/libfwupd/fwupd-self-test.c +=================================================================== +--- fwupd-1.2.10.orig/libfwupd/fwupd-self-test.c ++++ fwupd-1.2.10/libfwupd/fwupd-self-test.c +@@ -504,6 +504,8 @@ fwupd_has_system_bus (void) + static void + fwupd_common_machine_hash_func (void) + { ++ gsize sz = 0; ++ g_autofree gchar *buf = NULL; + g_autofree gchar *mhash1 = NULL; + g_autofree gchar *mhash2 = NULL; + g_autoptr(GError) error = NULL; +@@ -512,6 +514,13 @@ fwupd_common_machine_hash_func (void) + g_test_skip ("Missing /etc/machine-id"); + return; + } ++ if (!g_file_get_contents ("/etc/machine-id", &buf, &sz, &error)) ++ return; ++ ++ if (sz == 0) { ++ g_test_skip ("Empty /etc/machine-id"); ++ return; ++ } + + mhash1 = fwupd_build_machine_id ("salt1", &error); + g_assert_no_error (error);
  4. Download patch debian/patches/series

    --- 1.2.10-1/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ 1.2.10-1ubuntu2/debian/patches/series 2019-09-24 15:35:28.000000000 +0000 @@ -0,0 +1,2 @@ +0001-Relax-the-certificate-time-checks-in-the-self-tests-.patch +0001-trivial-libfwupd-skip-tests-if-machine-id-is-empty-t.patch
  5. Download patch debian/patches/0001-Relax-the-certificate-time-checks-in-the-self-tests-.patch

    --- 1.2.10-1/debian/patches/0001-Relax-the-certificate-time-checks-in-the-self-tests-.patch 1970-01-01 00:00:00.000000000 +0000 +++ 1.2.10-1ubuntu2/debian/patches/0001-Relax-the-certificate-time-checks-in-the-self-tests-.patch 2019-09-24 14:22:20.000000000 +0000 @@ -0,0 +1,86 @@ +From b4627629cdaadd1a75d7c650b7c5973fcd18dfb0 Mon Sep 17 00:00:00 2001 +From: Richard Hughes <richard@hughsie.com> +Date: Thu, 1 Aug 2019 09:45:25 +0100 +Subject: [PATCH] Relax the certificate time checks in the self tests for the + legacy certificate + +One test verifies a firmware with a signature from the old LVFS which was +hosted on secure-lvfs.rhcloud.com and used the original PKCS-7 key. This key +had a two year validity (expiring today, ohh the naivety...) rather than the +newer fwupd.org key which expires in the year 2058. + +For this specific test only, disable the certificate time checks to fix CI. + +Fixes https://github.com/hughsie/fwupd/issues/1264 +--- + src/fu-keyring-pkcs7.c | 10 +++++++++- + src/fu-keyring.h | 6 ++++-- + src/fu-self-test.c | 3 ++- + 3 files changed, 15 insertions(+), 4 deletions(-) + +diff --git a/src/fu-keyring-pkcs7.c b/src/fu-keyring-pkcs7.c +index 6dc944ed..a42feaa7 100644 +--- a/src/fu-keyring-pkcs7.c ++++ b/src/fu-keyring-pkcs7.c +@@ -642,6 +642,14 @@ fu_keyring_pkcs7_verify_data (FuKeyring *keyring, + for (gint i = 0; i < count; i++) { + gnutls_pkcs7_signature_info_st info; + gint64 signing_time = 0; ++ gnutls_certificate_verify_flags verify_flags = 0; ++ ++ /* use with care */ ++ if (flags & FU_KEYRING_VERIFY_FLAG_DISABLE_TIME_CHECKS) { ++ g_debug ("WARNING: disabling time checks"); ++ verify_flags |= GNUTLS_VERIFY_DISABLE_TIME_CHECKS; ++ verify_flags |= GNUTLS_VERIFY_DISABLE_TRUSTED_TIME_CHECKS; ++ } + + /* verify the data against the detached signature */ + if (flags & FU_KEYRING_VERIFY_FLAG_USE_CLIENT_CERT) { +@@ -652,7 +660,7 @@ fu_keyring_pkcs7_verify_data (FuKeyring *keyring, + 0, /* vdata_size */ + i, /* index */ + &datum, /* data */ +- 0); /* flags */ ++ verify_flags); + } + if (rc < 0) { + g_set_error (error, +diff --git a/src/fu-keyring.h b/src/fu-keyring.h +index 39819ca4..2f20e35e 100644 +--- a/src/fu-keyring.h ++++ b/src/fu-keyring.h +@@ -20,12 +20,14 @@ G_DECLARE_DERIVABLE_TYPE (FuKeyring, fu_keyring, FU, KEYRING, GObject) + * FuKeyringVerifyFlags: + * @FU_KEYRING_VERIFY_FLAG_NONE: No flags set + * @FU_KEYRING_VERIFY_FLAG_USE_CLIENT_CERT: Use client certificate to verify ++ * @FU_KEYRING_VERIFY_FLAG_DISABLE_TIME_CHECKS: Disable checking of validity periods + * + * The flags to use when interacting with a keyring + **/ + typedef enum { +- FU_KEYRING_VERIFY_FLAG_NONE = 0, +- FU_KEYRING_VERIFY_FLAG_USE_CLIENT_CERT = 1 << 1, ++ FU_KEYRING_VERIFY_FLAG_NONE = 0, ++ FU_KEYRING_VERIFY_FLAG_USE_CLIENT_CERT = 1 << 1, ++ FU_KEYRING_VERIFY_FLAG_DISABLE_TIME_CHECKS = 1 << 2, + /*< private >*/ + FU_KEYRING_VERIFY_FLAG_LAST + } FuKeyringVerifyFlags; +diff --git a/src/fu-self-test.c b/src/fu-self-test.c +index 363f644e..24b12110 100644 +--- a/src/fu-self-test.c ++++ b/src/fu-self-test.c +@@ -2628,7 +2628,8 @@ fu_keyring_pkcs7_func (void) + g_assert_no_error (error); + g_assert_nonnull (blob_sig); + result_pass = fu_keyring_verify_data (keyring, blob_pass, blob_sig, +- FU_KEYRING_VERIFY_FLAG_NONE, &error); ++ FU_KEYRING_VERIFY_FLAG_DISABLE_TIME_CHECKS, ++ &error); + g_assert_no_error (error); + g_assert_nonnull (result_pass); + g_assert_cmpint (fu_keyring_result_get_timestamp (result_pass), >= , 1502871248); +-- +2.20.1 +
  6. Download patch debian/gbp.conf

    --- 1.2.10-1/debian/gbp.conf 2019-07-15 18:58:31.000000000 +0000 +++ 1.2.10-1ubuntu2/debian/gbp.conf 2019-07-15 19:12:57.000000000 +0000 @@ -1,5 +1,5 @@ [DEFAULT] -debian-branch = debian +debian-branch = ubuntu upstream-tag = %(version)s [buildpackage]

Debian ( Changelog | PTS | Bugs ) Ubuntu ( Changelog | txt | LP | Bugs ) | Diff from Ubuntu

Source: plasma-discover

plasma-discover (5.17.3-0ubuntu1) focal; urgency=medium * New upstream release (5.17.3) -- Rik Mills <rikmills@kde.org> Tue, 12 Nov 2019 17:03:55 +0000 plasma-discover (5.17.2-0ubuntu1) focal; urgency=medium * Move qdebug categories file to new location. * Update install files. * Update lintian overrides. * New upstream (beta) release (5.16.90) * New upstream release (5.17.0) * New upstream release (5.17.1) * New upstream release (5.17.2) -- Rik Mills <rikmills@kde.org> Thu, 31 Oct 2019 17:49:08 +0000 plasma-discover (5.16.5-0ubuntu1) eoan; urgency=medium * New upstream release (5.16.5) -- Rik Mills <rikmills@kubuntu.org> Wed, 04 Sep 2019 09:23:19 +0100 plasma-discover (5.16.4-0ubuntu1) eoan; urgency=medium [ José Manuel Santamaría Lema ] * Prepare the packaging for package renaming, following debian names: - add "new" package plasma-discover-backend-flatpak - add "new" package plasma-discover-backend-snap - add transitional dummy package plasma-discover-flatpak-backend - add transitional dummy package plasma-discover-snap-backend - adjust debian/rules for the renaming [ Rik Mills ] * New upstream release (5.16.4) * Update Breaks/Replaces. -- Rik Mills <rikmills@kubuntu.org> Tue, 30 Jul 2019 18:44:07 +0100 plasma-discover (5.16.3-0ubuntu1) eoan; urgency=medium * New upstream release (5.16.3) * debian/patches: fix-appstream-data.patch - Drop, applied upstream. -- Rik Mills <rikmills@kubuntu.org> Tue, 09 Jul 2019 22:21:28 +0100 plasma-discover (5.16.2-0ubuntu1) eoan; urgency=medium * Tweak appstream dependencies as latest is not required. * New upstream release (5.16.2) * debian/patches: fix-appstream-data.patch - Add to fix mistakenly malformed data in this release. -- Rik Mills <rikmills@kubuntu.org> Tue, 25 Jun 2019 18:22:21 +0100 plasma-discover (5.16.1-0ubuntu1) eoan; urgency=medium * New upstream release (5.16.1) -- Rik Mills <rikmills@kubuntu.org> Tue, 18 Jun 2019 22:22:45 +0100 plasma-discover (5.16.0-0ubuntu2) eoan; urgency=medium * No-change rebuild against flatpak v1.4.1, following reversion of ABI break. -- Rik Mills <rikmills@kubuntu.org> Fri, 14 Jun 2019 05:08:19 +0100 plasma-discover (5.16.0-0ubuntu1) eoan; urgency=medium * New upstream release (5.16.0) -- Rik Mills <rikmills@kubuntu.org> Tue, 11 Jun 2019 11:35:08 +0100 plasma-discover (5.15.90-0ubuntu2) eoan; urgency=medium * Move dbus policy file to new location. -- Rik Mills <rikmills@kubuntu.org> Sat, 08 Jun 2019 21:44:56 +0100 plasma-discover (5.15.90-0ubuntu1) eoan; urgency=medium * New upstream (beta) release (5.15.90) -- Rik Mills <rikmills@kubuntu.org> Sat, 18 May 2019 08:48:14 +0100 plasma-discover (5.15.5-0ubuntu1) eoan; urgency=medium * New upstream release (5.15.5) -- Rik Mills <rikmills@kubuntu.org> Fri, 10 May 2019 13:47:10 +0100 plasma-discover (5.15.4-0ubuntu1) disco; urgency=medium * New upstream bugfix release (5.15.4) -- Rik Mills <rikmills@kubuntu.org> Thu, 04 Apr 2019 17:08:40 +0100 plasma-discover (5.15.3-0ubuntu1) disco; urgency=medium * New upstream release (5.15.3) -- Rik Mills <rikmills@kubuntu.org> Wed, 13 Mar 2019 09:08:08 +0000 plasma-discover (5.15.2-0ubuntu1) disco; urgency=medium * New upstream release (5.15.2) -- Rik Mills <rikmills@kubuntu.org> Tue, 26 Feb 2019 19:11:41 +0000 plasma-discover (5.15.1-0ubuntu1) disco; urgency=medium * New upstream release (5.15.1) -- Rik Mills <rikmills@kubuntu.org> Tue, 19 Feb 2019 21:32:39 +0000 plasma-discover (5.15.0-0ubuntu1) disco; urgency=medium * New upstream release (5.15.0) -- Rik Mills <rikmills@kubuntu.org> Tue, 12 Feb 2019 09:52:12 +0000 plasma-discover (5.14.90-0ubuntu1) disco; urgency=medium * New upstream (beta) release (5.14.90) -- Rik Mills <rikmills@kubuntu.org> Sat, 19 Jan 2019 08:23:30 +0000 plasma-discover (5.14.5-0ubuntu1) disco; urgency=medium * New upstream release (5.14.5) -- Rik Mills <rikmills@kubuntu.org> Tue, 08 Jan 2019 23:47:32 +0000 plasma-discover (5.14.4-0ubuntu1) disco; urgency=medium * Install debug categories file. * Don't build FwupdBackend for backports until better tested. * New upstream release (5.13.90) * Drop upstream applied patches: - upstream_fix-sources-editor-menu.patch - upstream_software-properties-qt.patch - upstream_fix-showing-update-notification.patch - upstream_fix-missing-backends.patch * New upstream release (5.14.0) * New upstream release (5.14.1) * Install flatpak-discover.svgz to its backend package. * New upstream release (5.14.2) * New upstream release (5.14.3) * New upstream release (5.14.4) -- Rik Mills <rikmills@kubuntu.org> Tue, 27 Nov 2018 23:14:36 +0000 plasma-discover (5.13.5-1ubuntu7) disco; urgency=medium * Backport upstream patch ensuring that snap installation transactions correctly register as finished in the UI. (LP: #1801863) -- Rik Mills <rikmills@kubuntu.org> Thu, 08 Nov 2018 11:02:49 +0000 plasma-discover (5.13.5-1ubuntu6) cosmic; urgency=medium * Backport upstream patch to include the repository name for a PPA in the settings page source list. Currently the description is blank, so requires guesswork or trial and error to work out which entry is which. KDE BUG: 390569 - debian/patches:upstream_include-repo-name-for-ubuntu-ppa.patch -- Rik Mills <rikmills@kubuntu.org> Mon, 08 Oct 2018 16:33:31 +0100 plasma-discover (5.13.5-1ubuntu5) cosmic; urgency=medium * Add upstream patch to fix enabling and disabling source entries in the main settings page. KDE Bug: 398587 - debian/patches: upstream_fix-enabling-disabling-sources.patch -- Rik Mills <rikmills@kubuntu.org> Fri, 05 Oct 2018 16:57:46 +0100 plasma-discover (5.13.5-1ubuntu4) cosmic; urgency=medium * Add upstream patch to fix Discover showing installed backends as missing on settings page. - debian/patches: upstream_fix-missing-backends.patch -- Rik Mills <rikmills@kubuntu.org> Thu, 04 Oct 2018 13:41:52 +0100 plasma-discover (5.13.5-1ubuntu3) cosmic; urgency=medium * debian/watch: Update to work with Kubuntu automation tooling. * Add upstream patch to fix showing update notifications. - debian/patches/upstream_fix-showing-update-notification.patch -- Rik Mills <rikmills@kubuntu.org> Mon, 24 Sep 2018 08:48:43 +0100 plasma-discover (5.13.5-1ubuntu2) cosmic; urgency=medium * Add patches with upstream changes to fix missing menu item for software-properties (Software Sources) in settings page. - debian/patches/upstream_software-properties-qt.patch - debian/patches/upstream_fix-sources-editor-menu.patch -- Rik Mills <rikmills@kubuntu.org> Sat, 22 Sep 2018 14:16:14 +0100 plasma-discover (5.13.5-1ubuntu1) cosmic; urgency=medium * Merge from Debian unstable. Remaining changes: - debian/control: + Kubuntu packaging Vcs fields. + Bumped Frameworks and Plasma build deps. + Add apt-config-icons* to depends to ensure we have all app icons, as recommended by KDE developers. + Depends on ubuntu-release-upgrader-qt. + Depends on xdg-desktop-portal-kde for snap and flatpak backends, as requested by upstream KDE. + Keep our snap and flatpak backend package names for now. - Keep install files and lintian-overrides changes. -- Rik Mills <rikmills@kubuntu.org> Mon, 10 Sep 2018 10:55:25 +0100

Modifications :
  1. Download patch libdiscover/backends/FlatpakBackend/FlatpakTransactionThread.h

    --- 5.14.5.1-2/libdiscover/backends/FlatpakBackend/FlatpakTransactionThread.h 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/FlatpakBackend/FlatpakTransactionThread.h 2019-11-12 10:10:38.000000000 +0000 @@ -35,31 +35,31 @@ class FlatpakTransactionThread : public { Q_OBJECT public: - FlatpakTransactionThread(FlatpakResource *app, const QPair<QString, uint> &relatedRef, Transaction::Role role); + FlatpakTransactionThread(FlatpakResource *app, Transaction::Role role); ~FlatpakTransactionThread() override; void cancel(); void run() override; - FlatpakResource * app() const; - - bool isRelated() const; - - int progress() const; + int progress() const { return m_progress; } void setProgress(int progress); + void setSpeed(quint64 speed); QString errorMessage() const; bool result() const; Q_SIGNALS: void progressChanged(int progress); + void speedChanged(quint64 speed); + void passiveMessage(const QString &msg); private: - bool m_result; - int m_progress; + FlatpakTransaction* m_transaction; + + bool m_result = false; + int m_progress = 0; + quint64 m_speed = 0; QString m_errorMessage; - QString m_relatedRef; - uint m_relatedRefKind; GCancellable *m_cancellable; FlatpakResource *m_app; Transaction::Role m_role;
  2. Download patch discover/CMakeLists.txt

    --- 5.14.5.1-2/discover/CMakeLists.txt 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/CMakeLists.txt 2019-11-12 10:10:38.000000000 +0000 @@ -6,6 +6,7 @@ endif() include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/..) ecm_qt_declare_logging_category(plasma_discover_SRCS HEADER discover_debug.h IDENTIFIER DISCOVER_LOG CATEGORY_NAME org.kde.plasma.discover) +kconfig_add_kcfg_files(plasma_discover_SRCS discoversettings.kcfgc GENERATE_MOC) add_executable(plasma-discover ${plasma_discover_SRCS} main.cpp @@ -30,11 +31,12 @@ target_link_libraries(plasma-discover PU KF5::XmlGui KF5::ItemModels KF5::KIOWidgets + KF5::QuickAddons Qt5::Quick Discover::Common ) -install(TARGETS plasma-discover ${INSTALL_TARGETS_DEFAULT_ARGS} ) +install(TARGETS plasma-discover ${INSTALL_TARGETS_DEFAULT_ARGS}) # if (BUILD_DummyBackend) # target_compile_definitions(plasma-discover PRIVATE $<$<CONFIG:Debug>:QT_QML_DEBUG=1>) @@ -51,6 +53,9 @@ endif() if(RPM) set(DesktopMimeType "${DesktopMimeType}application/x-rpm;") endif() +if(Flatpak_FOUND) + set(DesktopMimeType "${DesktopMimeType}application/vnd.flatpak;application/vnd.flatpak.repo;application/vnd.flatpak.ref;") +endif() set(DesktopExec "plasma-discover %F") configure_file(org.kde.discover.desktop.cmake ${CMAKE_CURRENT_BINARY_DIR}/org.kde.discover.desktop) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.discover.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
  3. Download patch debian/plasma-discover-common.maintscript

    --- 5.14.5.1-2/debian/plasma-discover-common.maintscript 1970-01-01 00:00:00.000000000 +0000 +++ 5.17.3-0ubuntu1/debian/plasma-discover-common.maintscript 2019-11-12 17:03:55.000000000 +0000 @@ -0,0 +1,2 @@ +# KNSRC files are now in /usr/share, where they should have belonged all along. +rm_conffile /etc/xdg/discover_ktexteditor_codesnippets_core.knsrc
  4. Download patch libdiscover/backends/FlatpakBackend/FlatpakFetchDataJob.cpp

    --- 5.14.5.1-2/libdiscover/backends/FlatpakBackend/FlatpakFetchDataJob.cpp 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/FlatpakBackend/FlatpakFetchDataJob.cpp 2019-11-12 10:10:38.000000000 +0000 @@ -28,7 +28,7 @@ static FlatpakRef * createFakeRef(Flatpa FlatpakRef *ref = nullptr; g_autoptr(GError) localError = nullptr; - const QString id = QStringLiteral("%1/%2/%3/%4").arg(resource->typeAsString(), resource->flatpakName(), resource->arch(), resource->branch()); + const auto id = resource->ref(); ref = flatpak_ref_parse(id.toUtf8().constData(), &localError); if (!ref) {
  5. Download patch discover/DiscoverObject.h

    --- 5.14.5.1-2/discover/DiscoverObject.h 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/DiscoverObject.h 2019-11-12 10:10:38.000000000 +0000 @@ -17,10 +17,10 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef MUONDISCOVERMAINWINDOW_H -#define MUONDISCOVERMAINWINDOW_H +#ifndef DISCOVEROBJECT_H +#define DISCOVEROBJECT_H -#include <QtCore/QUrl> +#include <QUrl> #include <QQuickView> @@ -29,13 +29,14 @@ class Category; class QWindow; class QQmlApplicationEngine; class CachedNetworkAccessManagerFactory; -class ResourcesProxyModel; class DiscoverObject : public QObject { Q_OBJECT Q_PROPERTY(CompactMode compactMode READ compactMode WRITE setCompactMode NOTIFY compactModeChanged) Q_PROPERTY(bool isRoot READ isRoot CONSTANT) + Q_PROPERTY(QRect initialGeometry READ initialGeometry CONSTANT) + public: enum CompactMode { Auto, Compact, Full }; Q_ENUM(CompactMode) @@ -59,6 +60,7 @@ class DiscoverObject : public QObject static bool isRoot(); QWindow* rootObject() const; void showPassiveNotification(const QString &msg); + QRect initialGeometry() const; public Q_SLOTS: void openApplication(const QUrl& app); @@ -69,6 +71,8 @@ class DiscoverObject : public QObject void copyTextToClipboard(const QString &text); + void reboot(); + private Q_SLOTS: void reportBug(); void switchApplicationLanguage(); @@ -97,4 +101,4 @@ class DiscoverObject : public QObject QScopedPointer<CachedNetworkAccessManagerFactory> m_networkAccessManagerFactory; }; -#endif // MUONINSTALLERDECLARATIVEVIEW_H +#endif // DISCOVEROBJECT_H
  6. Download patch discover/qml/UpdatesPage.qml
  7. Download patch discover/qml/ActionBridge.qml

    --- 5.14.5.1-2/discover/qml/ActionBridge.qml 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/qml/ActionBridge.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -/*************************************************************************** - * Copyright © 2015 Aleix Pol Gonzalez <aleixpol@blue-systems.com> * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License as * - * published by the Free Software Foundation; either version 2 of * - * the License or (at your option) version 3 or any later version * - * accepted by the membership of KDE e.V. (or its successor approved * - * by the membership of KDE e.V.), which shall act as a proxy * - * defined in Section 14 of version 3 of the license. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see <http://www.gnu.org/licenses/>. * - ***************************************************************************/ - -import QtQml 2.0 -import QtQuick.Controls 2.3 - -Action -{ - property QtObject action: null - - function removeAmpersand(text) { - return text.replace("&", ""); - } - text: action ? removeAmpersand(action.text) : "<null>" - checked: action && action.checked - enabled: action && action.enabled - icon.name: action ? app.iconName(action.icon) : "" - shortcut: action ? action.shortcut : undefined - - onTriggered: action.trigger() -}
  8. Download patch discover/autotests/PaginateModelTest.cpp

    --- 5.14.5.1-2/discover/autotests/PaginateModelTest.cpp 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/autotests/PaginateModelTest.cpp 2019-11-12 10:10:38.000000000 +0000 @@ -19,7 +19,7 @@ #include <QtTest> #include "../PaginateModel.h" -#include <tests/modeltest.h> +#include <QAbstractItemModelTester> #include <QStandardItemModel> class PaginateModelTest : public QObject @@ -37,7 +37,7 @@ public: private Q_SLOTS: void testPages() { PaginateModel pm; - new ModelTest(&pm, &pm); + new QAbstractItemModelTester(&pm, &pm); pm.setSourceModel(m_testModel); pm.setPageSize(5); QCOMPARE(pm.pageCount(), 3); @@ -63,7 +63,7 @@ private Q_SLOTS: void testPageSize() { PaginateModel pm; - new ModelTest(&pm, &pm); + new QAbstractItemModelTester(&pm, &pm); pm.setSourceModel(m_testModel); pm.setPageSize(5); QCOMPARE(pm.pageCount(), 3); @@ -75,7 +75,7 @@ private Q_SLOTS: void testItemAdded() { PaginateModel pm; - new ModelTest(&pm, &pm); + new QAbstractItemModelTester(&pm, &pm); pm.setSourceModel(m_testModel); pm.setPageSize(5); QCOMPARE(pm.pageCount(), 3); @@ -100,7 +100,7 @@ private Q_SLOTS: QStandardItemModel smallerModel; PaginateModel pm; - new ModelTest(&pm, &pm); + new QAbstractItemModelTester(&pm, &pm); pm.setSourceModel(&smallerModel); pm.setPageSize(5); QCOMPARE(pm.pageCount(), 1); @@ -115,7 +115,7 @@ private Q_SLOTS: void testItemRemoved() { PaginateModel pm; - new ModelTest(&pm, &pm); + new QAbstractItemModelTester(&pm, &pm); pm.setSourceModel(m_testModel); pm.setPageSize(5); QCOMPARE(pm.pageCount(), 5); @@ -131,7 +131,7 @@ private Q_SLOTS: void testMove() { PaginateModel pm; - new ModelTest(&pm, &pm); + new QAbstractItemModelTester(&pm, &pm); pm.setSourceModel(m_testModel); pm.setPageSize(5); m_testModel->moveRow({}, 0, {}, 3);
  9. Download patch libdiscover/appstream/AppStreamIntegration.h

    --- 5.14.5.1-2/libdiscover/appstream/AppStreamIntegration.h 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/appstream/AppStreamIntegration.h 2019-11-12 10:10:38.000000000 +0000 @@ -23,6 +23,7 @@ #include "discovercommon_export.h" #include <QObject> +#include <KOSRelease> #include "OdrsReviewsBackend.h" class DISCOVERCOMMON_EXPORT AppStreamIntegration : public QObject @@ -32,9 +33,11 @@ public: static AppStreamIntegration* global(); QSharedPointer<OdrsReviewsBackend> reviews(); + KOSRelease* osRelease() { return &m_osrelease; } private: QWeakPointer<OdrsReviewsBackend> m_reviews; + KOSRelease m_osrelease; AppStreamIntegration() {} };
  10. Download patch discover/qml/ApplicationPage.qml
  11. Download patch discover/qml/DiscoverDrawer.qml

    --- 5.14.5.1-2/discover/qml/DiscoverDrawer.qml 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/qml/DiscoverDrawer.qml 2019-11-12 10:10:38.000000000 +0000 @@ -23,27 +23,31 @@ import QtQuick.Layouts 1.1 import QtQuick.Controls 2.1 import org.kde.discover 2.0 import org.kde.discover.app 1.0 -import org.kde.kirigami 2.0 as Kirigami +import org.kde.kirigami 2.8 as Kirigami import "navigation.js" as Navigation Kirigami.GlobalDrawer { id: drawer + leftPadding: 0 + rightPadding: 0 + topPadding: 0 + bottomPadding: 0 + // FIXME: Dirty workaround for 385992 width: Kirigami.Units.gridUnit * 14 property bool wideScreen: false - bannerImageSource: "qrc:/banners/banner.svg" - //make the left and bottom margins for search field the same - topPadding: drawer.wideScreen ? -toploader.height - leftPadding : 0 - bottomPadding: 0 + bannerImageSource: modal ? "qrc:/banners/banner.svg" : "" + + // In desktop view, it's a sidebar, and sidebars get the view BG color + Kirigami.Theme.colorSet: modal ? Kirigami.Theme.Window : Kirigami.Theme.View resetMenuOnTriggered: false onBannerClicked: { Navigation.openHome(); - if (modal) - drawerOpen = false + drawerOpen = false } property string currentSearchText @@ -63,34 +67,57 @@ Kirigami.GlobalDrawer { } topContent: ConditionalLoader { id: toploader - condition: drawer.wideScreen + condition: !modal Layout.fillWidth: true componentFalse: Item { Layout.minimumHeight: 1 } - componentTrue: SearchField { - id: searchField + componentTrue: Kirigami.AbstractApplicationHeader { + preferredHeight: 40 // Match Kirigami.ToolBarApplicationHeader, which is hardcoded to this - visible: window.leftPage && (window.leftPage.searchFor != null || window.leftPage.hasOwnProperty("search")) + RowLayout { + width: parent.width + anchors.centerIn: parent - page: window.leftPage + ToolButton { + Layout.leftMargin: Kirigami.Units.smallSpacing - onCurrentSearchTextChanged: { - var curr = window.leftPage; + icon.name: "go-home" + onClicked: Navigation.openHome() + + ToolTip { + text: i18n("Return to the Featured page") + } + } - if (pageStack.depth>1) - pageStack.pop() + SearchField { + id: searchField - if (currentSearchText === "" && window.currentTopLevel === "" && !window.leftPage.category) { - Navigation.openHome() - } else if (!curr.hasOwnProperty("search")) { - if (currentSearchText) { - Navigation.clearStack() - Navigation.openApplicationList( { search: currentSearchText }) + Layout.fillWidth: true + Layout.rightMargin: Kirigami.Units.smallSpacing + + visible: window.leftPage && (window.leftPage.searchFor !== null || window.leftPage.hasOwnProperty("search")) + + page: window.leftPage + + onCurrentSearchTextChanged: { + var curr = window.leftPage; + + if (pageStack.depth>1) + pageStack.pop() + + if (currentSearchText === "" && window.currentTopLevel === "" && !window.leftPage.category) { + Navigation.openHome() + } else if (!curr.hasOwnProperty("search")) { + if (currentSearchText) { + Navigation.clearStack() + Navigation.openApplicationList( { search: currentSearchText }) + } + } else { + curr.search = currentSearchText; + curr.forceActiveFocus() + } } - } else { - curr.search = currentSearchText; - curr.forceActiveFocus() } } } @@ -117,13 +144,18 @@ Kirigami.GlobalDrawer { action: installedAction } ActionListItem { - action: settingsAction + action: sourcesAction + } + + ActionListItem { + action: aboutAction } + ActionListItem { objectName: "updateButton" action: updateAction - backgroundColor: ResourcesModel.updatesCount>0 ? "orange" : Kirigami.Theme.viewBackgroundColor + backgroundColor: ResourcesModel.updatesCount>0 ? "orange" : Kirigami.Theme.backgroundColor } states: [ @@ -144,8 +176,9 @@ Kirigami.GlobalDrawer { id: categoryActionComponent Kirigami.Action { property QtObject category - readonly property bool itsMe: window.leftPage && window.leftPage.hasOwnProperty("category") && (window.leftPage.category == category) + readonly property bool itsMe: window.leftPage && window.leftPage.hasOwnProperty("category") && (window.leftPage.category === category) text: category ? category.name : "" + iconName: category ? category.icon : "" checked: itsMe visible: (!window.leftPage || !window.leftPage.subcategories @@ -170,8 +203,7 @@ Kirigami.GlobalDrawer { var actions = [] for(var i in categories) { var cat = categories[i]; - var catAction = categoryActionComponent.createObject(drawer, {category: cat}); - catAction.children = createCategoryActions(cat.subcategories); + var catAction = categoryActionComponent.createObject(drawer, {category: cat, children: createCategoryActions(cat.subcategories)}); actions.push(catAction) } return actions;
  12. Download patch libdiscover/appstream/AppStreamIntegration.cpp

    --- 5.14.5.1-2/libdiscover/appstream/AppStreamIntegration.cpp 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/appstream/AppStreamIntegration.cpp 2019-11-12 10:10:38.000000000 +0000 @@ -19,6 +19,7 @@ ***************************************************************************/ #include "AppStreamIntegration.h" +#include <KOSRelease> AppStreamIntegration * AppStreamIntegration::global() { @@ -36,7 +37,7 @@ QSharedPointer<OdrsReviewsBackend> AppSt if (m_reviews) { ret = m_reviews; } else { - ret = QSharedPointer<OdrsReviewsBackend>(new OdrsReviewsBackend(nullptr)); + ret = QSharedPointer<OdrsReviewsBackend>(new OdrsReviewsBackend()); m_reviews = ret; } return ret;
  13. Download patch discover/qml/LabelBackground.qml

    --- 5.14.5.1-2/discover/qml/LabelBackground.qml 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/qml/LabelBackground.qml 2019-11-12 10:10:38.000000000 +0000 @@ -23,34 +23,36 @@ import QtQuick.Layouts 1.1 import org.kde.discover.app 1.0 import org.kde.kirigami 2.0 as Kirigami -Item +Control { + id: root property alias text: theLabel.text property real progress: 1. - readonly property real margin: Kirigami.Units.smallSpacing * 1.5 - implicitWidth: theLabel.implicitWidth + margin*2 - implicitHeight: theLabel.implicitHeight + margin*2 - width: implicitWidth - height: implicitHeight + padding: Kirigami.Units.smallSpacing * 1.5 - Rectangle { - color: Kirigami.Theme.disabledTextColor - anchors.fill: parent - radius: parent.margin - } + background: Item { + Rectangle { + color: Kirigami.Theme.disabledTextColor + anchors.fill: parent + radius: root.padding + } - Rectangle { - anchors { - fill: parent - rightMargin: (1-parent.progress) * parent.width + Rectangle { + anchors { + fill: parent + rightMargin: (1-root.progress) * parent.width + } + color: Kirigami.Theme.highlightColor + radius: root.padding } - color: Kirigami.Theme.highlightColor - radius: parent.margin } - Label { + contentItem: Label { id: theLabel - anchors.centerIn: parent + horizontalAlignment: Text.AlignHCenter color: Kirigami.Theme.highlightedTextColor } + + ToolTip.visible: hovered + ToolTip.text: theLabel.text }
  14. Download patch debian/rules

    --- 5.14.5.1-2/debian/rules 2019-10-04 08:04:41.000000000 +0000 +++ 5.17.3-0ubuntu1/debian/rules 2019-11-12 17:03:55.000000000 +0000 @@ -23,6 +23,11 @@ override_dh_auto_configure: override_dh_makeshlibs: dh_makeshlibs -Xusr/lib/$(DEB_HOST_MULTIARCH)/qt5/plugins/discover* -V +override_dh_shlibdeps: + dh_shlibdeps -pplasma-discover -- -xlibappstreamqt2 + dh_shlibdeps -pplasma-discover-backend-flatpak -- -xlibappstreamqt2 + dh_shlibdeps --remaining-packages + override_dh_missing: dh_missing --fail-missing
  15. Download patch debian/plasma-discover.lintian-overrides

    --- 5.14.5.1-2/debian/plasma-discover.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ 5.17.3-0ubuntu1/debian/plasma-discover.lintian-overrides 2019-11-12 17:03:55.000000000 +0000 @@ -0,0 +1 @@ +plasma-discover: executable-not-elf-or-script etc/xdg/autostart/org.kde.discover.notifier.desktop
  16. Download patch libdiscover/backends/FlatpakBackend/FlatpakSourcesBackend.cpp

    --- 5.14.5.1-2/libdiscover/backends/FlatpakBackend/FlatpakSourcesBackend.cpp 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/FlatpakBackend/FlatpakSourcesBackend.cpp 2019-11-12 10:10:38.000000000 +0000 @@ -95,24 +95,22 @@ bool FlatpakSourcesBackend::addSource(co if (id.isEmpty() || !flatpakrepoUrl.isValid()) return false; - if (flatpakrepoUrl.isLocalFile()) { - auto res = backend->addSourceFromFlatpakRepo(flatpakrepoUrl); + auto addSource = [=](AbstractResource* res) { if (res) backend->installApplication(res); else - backend->passiveMessage(i18n("Could not add the source %1", flatpakrepoUrl.toDisplayString())); + Q_EMIT backend->passiveMessage(i18n("Could not add the source %1", flatpakrepoUrl.toDisplayString())); + }; + + if (flatpakrepoUrl.isLocalFile()) { + addSource(backend->addSourceFromFlatpakRepo(flatpakrepoUrl)); } else { AbstractResourcesBackend::Filters filter; filter.resourceUrl = flatpakrepoUrl; auto stream = new StoredResultsStream ({backend->search(filter)}); - connect(stream, &StoredResultsStream::finished, this, [backend, stream, flatpakrepoUrl]() { + connect(stream, &StoredResultsStream::finished, this, [addSource, stream]() { const auto res = stream->resources(); - if (!res.isEmpty()) { - Q_ASSERT(res.count() == 1); - backend->installApplication(res.first()); - } else { - backend->passiveMessage(i18n("Could not add the source %1", flatpakrepoUrl.toDisplayString())); - } + addSource(res.value(0)); }); } return true; @@ -131,6 +129,21 @@ QStandardItem * FlatpakSourcesBackend::s return sourceIt; } +QStandardItem * FlatpakSourcesBackend::sourceByUrl(const QString& _url) const +{ + QUrl url(_url); + + QStandardItem* sourceIt = nullptr; + for (int i = 0, c = m_sources->rowCount(); i<c && !sourceIt; ++i) { + auto it = m_sources->item(i); + if (url.matches(it->data(Qt::StatusTipRole).toUrl(), QUrl::StripTrailingSlash)) { + sourceIt = it; + break; + } + } + return sourceIt; +} + bool FlatpakSourcesBackend::removeSource(const QString &id) { auto sourceIt = sourceById(id); @@ -192,7 +205,7 @@ FlatpakRemote * FlatpakSourcesBackend::i auto remote = flatpak_installation_get_remote_by_name(m_preferredInstallation, resource->flatpakName().toUtf8().constData(), cancellable, nullptr); if (remote) { - qWarning() << "Source " << resource->flatpakName() << " already exists"; + qWarning() << "Source " << resource->flatpakName() << " already exists in" << flatpak_installation_get_path(m_preferredInstallation); return nullptr; } @@ -234,7 +247,8 @@ void FlatpakSourcesBackend::addRemote(Fl const QString title = QString::fromUtf8(flatpak_remote_get_title(remote)); const QUrl remoteUrl(QString::fromUtf8(flatpak_remote_get_url(remote))); - for(QAction *action: actions()) { + const auto theActions = actions(); + for(QAction *action: theActions) { if (action->toolTip() == id) { action->setEnabled(false); action->setVisible(false); @@ -242,8 +256,8 @@ void FlatpakSourcesBackend::addRemote(Fl } FlatpakSourceItem *it = new FlatpakSourceItem(!title.isEmpty() ? title : id); - it->setCheckState(flatpak_remote_get_disabled(remote) ? Qt::Unchecked : Qt::Checked); it->setData(remoteUrl.isLocalFile() ? remoteUrl.toLocalFile() : remoteUrl.host(), Qt::ToolTipRole); + it->setData(remoteUrl, Qt::StatusTipRole); it->setData(id, IdRole); it->setFlatpakInstallation(installation);
  17. Download patch discover/discoversettings.kcfgc

    --- 5.14.5.1-2/discover/discoversettings.kcfgc 1970-01-01 00:00:00.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/discoversettings.kcfgc 2019-11-12 10:10:38.000000000 +0000 @@ -0,0 +1,5 @@ +File=discoversettings.kcfg +ClassName=DiscoverSettings +GenerateProperties=true +Mutators=true +IncludeFiles=resources/ResourcesProxyModel.h
  18. Download patch debian/plasma-discover-backend-snap.lintian-overrides

    --- 5.14.5.1-2/debian/plasma-discover-backend-snap.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ 5.17.3-0ubuntu1/debian/plasma-discover-backend-snap.lintian-overrides 2019-11-12 17:03:55.000000000 +0000 @@ -0,0 +1 @@ +plasma-discover-backend-snap: desktop-command-not-in-package usr/share/applications/org.kde.discover.snap.urlhandler.desktop plasma-discover
  19. Download patch libdiscover/backends/FlatpakBackend/FlatpakJobTransaction.h

    --- 5.14.5.1-2/libdiscover/backends/FlatpakBackend/FlatpakJobTransaction.h 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/FlatpakBackend/FlatpakJobTransaction.h 2019-11-12 10:10:38.000000000 +0000 @@ -38,27 +38,20 @@ class FlatpakJobTransaction : public Tra Q_OBJECT public: FlatpakJobTransaction(FlatpakResource *app, Role role, bool delayStart = false); - FlatpakJobTransaction(FlatpakResource *app, FlatpakResource *runtime, Role role, bool delayStart = false); ~FlatpakJobTransaction(); void cancel() override; - void setRuntime(FlatpakResource *runtime); public Q_SLOTS: - void onJobFinished(); - void onJobProgressChanged(int progress); void finishTransaction(); void start(); private: - void processRelatedRefs(FlatpakResource *resource); void updateProgress(); QPointer<FlatpakResource> m_app; - QPointer<FlatpakResource> m_runtime; QPointer<FlatpakTransactionThread> m_appJob; - QList<QPointer<FlatpakTransactionThread> > m_jobs; }; #endif // FLATPAKJOBTRANSACTION_H
  20. Download patch debian/compat

    --- 5.14.5.1-2/debian/compat 2019-10-04 08:04:41.000000000 +0000 +++ 5.17.3-0ubuntu1/debian/compat 2019-11-12 17:03:55.000000000 +0000 @@ -1 +1 @@ -12 +11
  21. Download patch libdiscover/backends/FlatpakBackend/FlatpakJobTransaction.cpp

    --- 5.14.5.1-2/libdiscover/backends/FlatpakBackend/FlatpakJobTransaction.cpp 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/FlatpakBackend/FlatpakJobTransaction.cpp 2019-11-12 10:10:38.000000000 +0000 @@ -34,14 +34,8 @@ extern "C" { } FlatpakJobTransaction::FlatpakJobTransaction(FlatpakResource *app, Role role, bool delayStart) - : FlatpakJobTransaction(app, nullptr, role, delayStart) -{ -} - -FlatpakJobTransaction::FlatpakJobTransaction(FlatpakResource *app, FlatpakResource *runtime, Transaction::Role role, bool delayStart) : Transaction(app->backend(), app, role, {}) , m_app(app) - , m_runtime(runtime) { setCancellable(true); setStatus(QueuedStatus); @@ -51,143 +45,26 @@ FlatpakJobTransaction::FlatpakJobTransac } } -FlatpakJobTransaction::~FlatpakJobTransaction() -{ - for(auto job : m_jobs) { - if (!job->isFinished()) { - connect(job, &QThread::finished, job, &QObject::deleteLater); - } else - delete job; - } -} +FlatpakJobTransaction::~FlatpakJobTransaction() = default; void FlatpakJobTransaction::cancel() { - //note it's possible to have a job cancelled before it ever started as - //sometimes we're delaying the start until we have the runtime - foreach (const QPointer<FlatpakTransactionThread> &job, m_jobs) { - job->cancel(); - } + m_appJob->cancel(); setStatus(CancelledStatus); } -void FlatpakJobTransaction::setRuntime(FlatpakResource *runtime) -{ - m_runtime = runtime; -} - void FlatpakJobTransaction::start() { setStatus(CommittingStatus); - if (m_runtime) { - QPointer<FlatpakTransactionThread> job = new FlatpakTransactionThread(m_runtime, {}, role()); - connect(job, &FlatpakTransactionThread::finished, this, &FlatpakJobTransaction::onJobFinished); - connect(job, &FlatpakTransactionThread::progressChanged, this, &FlatpakJobTransaction::onJobProgressChanged); - m_jobs << job; - - processRelatedRefs(m_runtime); - } - - // App job will be added everytime - m_appJob = new FlatpakTransactionThread(m_app, {}, role()); - connect(m_appJob, &FlatpakTransactionThread::finished, this, &FlatpakJobTransaction::onJobFinished); - connect(m_appJob, &FlatpakTransactionThread::progressChanged, this, &FlatpakJobTransaction::onJobProgressChanged); - m_jobs << m_appJob; - - processRelatedRefs(m_app); - - - // Now start all the jobs together - foreach (const QPointer<FlatpakTransactionThread> &job, m_jobs) { - job->start(); - } -} - -void FlatpakJobTransaction::processRelatedRefs(FlatpakResource* resource) -{ - g_autoptr(GPtrArray) refs = nullptr; - g_autoptr(GError) error = nullptr; - g_autoptr(GCancellable) cancellable = g_cancellable_new();; - QList<FlatpakResource> additionalResources; - - g_autofree gchar *ref = g_strdup_printf ("%s/%s/%s/%s", - resource->typeAsString().toUtf8().constData(), - resource->flatpakName().toUtf8().constData(), - resource->arch().toUtf8().constData(), - resource->branch().toUtf8().constData()); - - if (role() == Transaction::Role::InstallRole) { - if (resource->state() == AbstractResource::Upgradeable) { - refs = flatpak_installation_list_installed_related_refs_sync(resource->installation(), resource->origin().toUtf8().constData(), ref, cancellable, &error); - if (error) { - qWarning() << "Failed to list installed related refs for update: " << error->message; - } - } else { - refs = flatpak_installation_list_remote_related_refs_sync(resource->installation(), resource->origin().toUtf8().constData(), ref, cancellable, &error); - if (error) { - qWarning() << "Failed to list related refs for installation: " << error->message; - } - } - } else if (role() == Transaction::Role::RemoveRole) { - refs = flatpak_installation_list_installed_related_refs_sync(resource->installation(), resource->origin().toUtf8().constData(), ref, cancellable, &error); - if (error) { - qWarning() << "Failed to list installed related refs for removal: " << error->message; - } - } - if (refs) { - for (uint i = 0; i < refs->len; i++) { - FlatpakRef *flatpakRef = FLATPAK_REF(g_ptr_array_index(refs, i)); - if (flatpak_related_ref_should_download(FLATPAK_RELATED_REF(flatpakRef))) { - QPointer<FlatpakTransactionThread> job = new FlatpakTransactionThread(resource, QPair<QString, uint>(QString::fromUtf8(flatpak_ref_get_name(flatpakRef)), flatpak_ref_get_kind(flatpakRef)), role()); - connect(job, &FlatpakTransactionThread::finished, this, &FlatpakJobTransaction::onJobFinished); - connect(job, &FlatpakTransactionThread::progressChanged, this, &FlatpakJobTransaction::onJobProgressChanged); - // Add to the list of all jobs - m_jobs << job; - } - } - } -} - -void FlatpakJobTransaction::onJobFinished() -{ - FlatpakTransactionThread *job = static_cast<FlatpakTransactionThread*>(sender()); - - if (job != m_appJob) { - if (!job->result()) { - Q_EMIT passiveMessage(job->errorMessage()); - } - - // Mark runtime as installed - if (m_runtime && job->app()->flatpakName() == m_runtime->flatpakName() && !job->isRelated() && role() != Transaction::Role::RemoveRole) { - if (job->result()) { - m_runtime->setState(AbstractResource::Installed); - } - } - } - - foreach (const QPointer<FlatpakTransactionThread> &job, m_jobs) { - if (job->isRunning()) { - return; - } - } + // App job will be added every time + m_appJob = new FlatpakTransactionThread(m_app, role()); + connect(m_appJob, &FlatpakTransactionThread::finished, this, &FlatpakJobTransaction::finishTransaction); + connect(m_appJob, &FlatpakTransactionThread::progressChanged, this, &FlatpakJobTransaction::setProgress); + connect(m_appJob, &FlatpakTransactionThread::speedChanged, this, &FlatpakJobTransaction::setDownloadSpeed); + connect(m_appJob, &FlatpakTransactionThread::passiveMessage, this, &FlatpakJobTransaction::passiveMessage); - // No other job is running → finish transaction - finishTransaction(); -} - -void FlatpakJobTransaction::onJobProgressChanged(int progress) -{ - Q_UNUSED(progress); - - int total = 0; - - // Count progress from all the jobs - foreach (const QPointer<FlatpakTransactionThread> &job, m_jobs) { - total += job->progress(); - } - - setProgress(total / m_jobs.count()); + m_appJob->start(); } void FlatpakJobTransaction::finishTransaction() @@ -208,6 +85,10 @@ void FlatpakJobTransaction::finishTransa setStatus(DoneStatus); } else { + if (!m_appJob->errorMessage().isEmpty()) { + Q_EMIT passiveMessage(m_appJob->errorMessage()); + } setStatus(DoneWithErrorStatus); } + }
  22. Download patch libdiscover/ActionsModel.cpp

    --- 5.14.5.1-2/libdiscover/ActionsModel.cpp 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/ActionsModel.cpp 2019-11-12 10:10:38.000000000 +0000 @@ -89,5 +89,6 @@ void ActionsModel::setFilterPriority(int if (m_priority != p) { m_priority = p; reload(); + Q_EMIT filterPriorityChanged(); } }
  23. Download patch discover/qml/LoadingPage.qml

    --- 5.14.5.1-2/discover/qml/LoadingPage.qml 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/qml/LoadingPage.qml 2019-11-12 10:10:38.000000000 +0000 @@ -1,12 +1,10 @@ import org.kde.kirigami 2.0 as Kirigami -import QtQuick.Controls 2.1 as QQC2 Kirigami.Page { title: label.text - QQC2.Label { + Kirigami.Heading { id: label text: i18n("Loading...") - font.pointSize: 52 anchors.centerIn: parent } }
  24. Download patch discover/DiscoverDeclarativePlugin.h

    --- 5.14.5.1-2/discover/DiscoverDeclarativePlugin.h 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/DiscoverDeclarativePlugin.h 2019-11-12 10:10:38.000000000 +0000 @@ -20,7 +20,7 @@ #ifndef DISCOVERDECLARATIVEPLUGIN_H #define DISCOVERDECLARATIVEPLUGIN_H -#include <QtQml/QQmlExtensionPlugin> +#include <QQmlExtensionPlugin> class DiscoverDeclarativePlugin : public QQmlExtensionPlugin {
  25. Download patch libdiscover/backends/DummyBackend/DummyTransaction.cpp

    --- 5.14.5.1-2/libdiscover/backends/DummyBackend/DummyTransaction.cpp 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/DummyBackend/DummyTransaction.cpp 2019-11-12 10:10:38.000000000 +0000 @@ -37,6 +37,8 @@ DummyTransaction::DummyTransaction(Dummy , m_app(app) { setCancellable(true); + setStatus(DownloadingStatus); + iterateTransaction(); } @@ -45,10 +47,12 @@ void DummyTransaction::iterateTransactio if (!m_iterate) return; - setStatus(CommittingStatus); if(progress()<100) { setProgress(qBound(0, progress()+(KRandom::random()%30), 100)); QTimer::singleShot(/*KRandom::random()%*/100, this, &DummyTransaction::iterateTransaction); + } else if (status() == DownloadingStatus) { + setStatus(CommittingStatus); + QTimer::singleShot(/*KRandom::random()%*/100, this, &DummyTransaction::iterateTransaction); } else #ifdef TEST_PROCEED Q_EMIT proceedRequest(QStringLiteral("yadda yadda"), QStringLiteral("Biii BOooo<ul><li>A</li><li>A</li><li>A</li><li>A</li></ul>"));
  26. Download patch discover/qml/ApplicationDelegate.qml

    --- 5.14.5.1-2/discover/qml/ApplicationDelegate.qml 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/qml/ApplicationDelegate.qml 2019-11-12 10:10:38.000000000 +0000 @@ -22,7 +22,7 @@ import QtQuick.Controls 2.1 import QtQuick.Layouts 1.1 import QtQuick.Window 2.1 import "navigation.js" as Navigation -import org.kde.kirigami 2.4 as Kirigami +import org.kde.kirigami 2.6 as Kirigami Kirigami.AbstractCard { @@ -31,14 +31,13 @@ Kirigami.AbstractCard property bool compact: false property bool showRating: true showClickFeedback: true - property var view: null function trigger() { - if (view) - view.currentIndex = index + if (delegateRecycler.ListView.view) + delegateRecycler.ListView.view.currentIndex = index Navigation.openApplication(application) } - highlighted: ListView.isCurrentItem + highlighted: delegateRecycler && delegateRecycler.ListView.isCurrentItem Keys.onReturnPressed: trigger() onClicked: trigger()
  27. Download patch debian/upstream/signing-key.asc
  28. Download patch debian/control

    --- 5.14.5.1-2/debian/control 2019-10-04 08:04:41.000000000 +0000 +++ 5.17.3-0ubuntu1/debian/control 2019-11-12 17:03:55.000000000 +0000 @@ -5,51 +5,55 @@ Maintainer: Debian/Kubuntu Qt/KDE Mainta Uploaders: Maximiliano Curia <maxy@debian.org>, Matthias Klumpp <mak@debian.org>, Build-Depends: cmake (>= 2.8.12), - debhelper (>= 12~), - extra-cmake-modules (>= 5.50.0~), - kirigami2-dev (>= 5.42), + debhelper (>= 11~), + extra-cmake-modules (>= 5.62.0~), + kirigami2-dev (>= 5.62.0~), libappstreamqt-dev (>= 0.10.3), libdebconf-kde-dev (>= 1.0.0), libflatpak-dev (>= 0.10.2), - libkf5archive-dev (>= 5.50.0~), - libkf5attica-dev (>= 5.23~), - libkf5config-dev (>= 5.50.0~), - libkf5configwidgets-dev (>= 5.16.0~), - libkf5coreaddons-dev (>= 5.50.0~), - libkf5crash-dev (>= 5.50.0~), - libkf5dbusaddons-dev (>= 5.50.0~), - libkf5declarative-dev (>= 5.42~), - libkf5i18n-dev (>= 5.50.0~), - libkf5iconthemes-dev (>= 5.16.0~), - libkf5itemmodels-dev (>= 5.50.0~), - libkf5itemviews-dev (>= 5.16.0~), - libkf5kdelibs4support-dev (>= 5.34.0~), - libkf5kio-dev (>= 5.50.0~), - libkf5newstuff-dev (>= 5.23~), - libkf5notifications-dev (>= 5.16.0~), - libkf5plasma-dev (>= 5.16.0~), - libkf5solid-dev (>= 5.16.0~), - libkf5textwidgets-dev, - libkf5wallet-dev (>= 5.16.0~), - libkf5widgetsaddons-dev (>= 5.16.0~), - libkf5xmlgui-dev (>= 5.50.0~), + libkf5archive-dev (>= 5.62.0~), + libkf5attica-dev (>= 5.62.0~), + libkf5config-dev (>= 5.62.0~), + libkf5configwidgets-dev (>= 5.62.0~), + libkf5coreaddons-dev (>= 5.62.0~), + libkf5crash-dev (>= 5.62.0~), + libkf5dbusaddons-dev (>= 5.62.0~), + libkf5declarative-dev (>= 5.62.0~), + libkf5i18n-dev (>= 5.62.0~), + libkf5iconthemes-dev (>= 5.62.0~), + libkf5itemmodels-dev (>= 5.62.0~), + libkf5itemviews-dev (>= 5.62.0~), + libkf5kdelibs4support-dev (>= 5.62.0~), + libkf5kio-dev (>= 5.62.0~), + libkf5newstuff-dev (>= 5.62.0~), + libkf5notifications-dev (>= 5.62.0~), + libkf5plasma-dev (>= 5.62.0~), + libkf5solid-dev (>= 5.62.0~), + libkf5textwidgets-dev (>= 5.62.0~), + libkf5wallet-dev (>= 5.62.0~), + libkf5widgetsaddons-dev (>= 5.62.0~), + libkf5xmlgui-dev (>= 5.62.0~), libpackagekitqt5-dev (>= 1.0.1), libqca-qt5-2-dev, - libqt5svg5-dev (>= 5.4.0~), + libqt5svg5-dev (>= 5.6.1~), libsnapd-qt-dev (>= 1.30), pkg-config, pkg-kde-tools (>= 0.15.16), - qtbase5-dev (>= 5.11.0~), - qtdeclarative5-dev (>= 5.11.0~), -Standards-Version: 4.4.1 + qtbase5-dev (>= 5.10.0~), + qtdeclarative5-dev (>= 5.10.0~), +Standards-Version: 4.1.4 Homepage: https://projects.kde.org/projects/kde/workspace/discover -Vcs-Browser: https://salsa.debian.org/qt-kde-team/kde/plasma-discover -Vcs-Git: https://salsa.debian.org/qt-kde-team/kde/plasma-discover.git +Vcs-Browser: https://code.launchpad.net/~kubuntu-packagers/kubuntu-packaging/+git/discover +Vcs-Git: https://git.launchpad.net/~kubuntu-packagers/kubuntu-packaging/+git/discover Package: plasma-discover Architecture: any Depends: appstream (>= 0.8), apt-config-icons, + apt-config-icons-hidpi, + apt-config-icons-large, + apt-config-icons-large-hidpi, + libappstreamqt2, packagekit (>= 1.0), plasma-discover-common (= ${source:Version}), qml-module-org-kde-kcoreaddons, @@ -58,13 +62,24 @@ Depends: appstream (>= 0.8), qml-module-org-kde-kquickcontrolsaddons, qml-module-org-kde-qqc2desktopstyle, qml-module-qtquick-dialogs, + ubuntu-release-upgrader-qt, ${misc:Depends}, ${shlibs:Depends}, -Recommends: apt-config-icons-hidpi, - apt-config-icons-large, - apt-config-icons-large-hidpi, - software-properties-kde, -Suggests: plasma-discover-backend-flatpak +Recommends: plasma-discover-backend-snap, software-properties-qt +Breaks: libmuon (<< 4:5.6), + muon-discover (<< 4:5.5.3a), + muon-notifier (<< 4:5.5.3a), + muon-updater (<< 4:5.5.3a), + plasma-discover-common (<< 5.7.0), + plasma-discover-private (<< 5.7.0), + plasma-discover-updater (<< 5.7.0), +Replaces: libmuon (<< 4:5.6), + muon-discover (<< 4:5.5.3a), + muon-notifier (<< 4:5.5.3a), + muon-updater (<< 4:5.5.3a), + plasma-discover-common (<< 5.7.0), + plasma-discover-private (<< 5.7.0), + plasma-discover-updater (<< 5.7.0), Description: Discover software management suite Discover is a graphical software manager for the Plasma workspace. It helps users easily and quickly find applications and other software @@ -81,8 +96,11 @@ Package: plasma-discover-backend-flatpak Architecture: any Depends: flatpak, plasma-discover (= ${binary:Version}), + xdg-desktop-portal-kde, ${misc:Depends}, ${shlibs:Depends}, +Breaks: plasma-discover-flatpak-backend (<< 5.16.4~) +Replaces: plasma-discover-flatpak-backend (<< 5.16.4~) Description: Discover software management suite - Flatpak backend Discover is a graphical software manager for the Plasma workspace. It helps users easily and quickly find applications and other software @@ -94,9 +112,12 @@ Description: Discover software managemen Package: plasma-discover-backend-snap Architecture: any Depends: plasma-discover (= ${binary:Version}), + snapd, + xdg-desktop-portal-kde, ${misc:Depends}, ${shlibs:Depends}, -Recommends: snapd +Breaks: plasma-discover-snap-backend (<< 5.16.4~) +Replaces: plasma-discover-snap-backend (<< 5.16.4~) Description: Discover software management suite - Snap backend Discover is a graphical software manager for the Plasma workspace. It helps users easily and quickly find applications and other software @@ -108,8 +129,38 @@ Description: Discover software managemen Package: plasma-discover-common Architecture: all Depends: ${misc:Depends} +Breaks: muon-common (<< 4:5.5.3a), + plasma-discover (<< 5.7.0-2), + plasma-discover-private (<< 5.7.0), + plasma-discover-updater (<< 5.7.0), +Replaces: muon-common (<< 4:5.5.3a), + plasma-discover (<< 5.7.0-2), + plasma-discover-private (<< 5.7.0), + plasma-discover-updater (<< 5.7.0), Description: Discover software manager suite (common data files) Discover is a graphical software manager for the Plasma workspace. . This package contains data files shared by various parts of the Discover suite. + +Package: plasma-discover-flatpak-backend +Architecture: all +Section: oldlibs +Priority: optional +Depends: plasma-discover-backend-flatpak, ${misc:Depends} +Description: Discover Flatpak backend - transitional package + This transitional package allows one to migrate to the renamed package + providing the Plasma Discover Flatpak backend. + . + It can be safely removed after the installation. + +Package: plasma-discover-snap-backend +Architecture: all +Section: oldlibs +Priority: optional +Depends: plasma-discover-backend-snap, ${misc:Depends} +Description: Discover Flatpak backend - transitional package + This transitional package allows one to migrate to the renamed package + providing the Plasma Discover Snap backend. + . + It can be safely removed after the installation.
  29. Download patch discover/qml/ApplicationsListPage.qml

    --- 5.14.5.1-2/discover/qml/ApplicationsListPage.qml 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/qml/ApplicationsListPage.qml 2019-11-12 10:10:38.000000000 +0000 @@ -43,12 +43,30 @@ DiscoverPage { property alias count: apps.count property alias listHeader: apps.header property alias listHeaderPositioning: apps.headerPositioning + property alias sortProperty: saveChanges.property property bool compact: page.width < 550 || !applicationWindow().wideScreen property bool showRating: true property bool canNavigate: true readonly property alias subcategories: appsModel.subcategories - title: category ? category.name : "" + + function escapeHtml(unsafe) { + return unsafe + .replace(/&/g, "&amp;") + .replace(/</g, "&lt;") + .replace(/>/g, "&gt;") + .replace(/"/g, "&quot;") + .replace(/'/g, "&#039;"); + } + + background: Rectangle { + color: Kirigami.Theme.backgroundColor + Kirigami.Theme.colorSet: Kirigami.Theme.Window + Kirigami.Theme.inherit: false + } + + title: search.length>0 ? i18n("Search: %1", escapeHtml(search)) + : category ? category.name : "" signal clearSearch() @@ -63,6 +81,13 @@ DiscoverPage { exclusive: true } + Binding { + id: saveChanges + target: DiscoverSettings + property: "appsListPageSorting" + value: appsModel.sortRole + } + contextualActions: [ Kirigami.Action { visible: !appsModel.sortByRelevancy @@ -72,40 +97,36 @@ DiscoverPage { text: i18n("Name") onTriggered: { appsModel.sortRole = ResourcesProxyModel.NameRole - appsModel.sortOrder = Qt.AscendingOrder } checkable: true - checked: appsModel.sortRole == ResourcesProxyModel.NameRole + checked: appsModel.sortRole === ResourcesProxyModel.NameRole } Action { ActionGroup.group: sortGroup text: i18n("Rating") onTriggered: { appsModel.sortRole = ResourcesProxyModel.SortableRatingRole - appsModel.sortOrder = Qt.DescendingOrder } checkable: true - checked: appsModel.sortRole == ResourcesProxyModel.SortableRatingRole + checked: appsModel.sortRole === ResourcesProxyModel.SortableRatingRole } Action { ActionGroup.group: sortGroup text: i18n("Size") onTriggered: { appsModel.sortRole = ResourcesProxyModel.SizeRole - appsModel.sortOrder = Qt.AscendingOrder } checkable: true - checked: appsModel.sortRole == ResourcesProxyModel.SizeRole + checked: appsModel.sortRole === ResourcesProxyModel.SizeRole } Action { ActionGroup.group: sortGroup text: i18n("Release Date") onTriggered: { appsModel.sortRole = ResourcesProxyModel.ReleaseDateRole - appsModel.sortOrder = Qt.DescendingOrder } checkable: true - checked: appsModel.sortRole == ResourcesProxyModel.ReleaseDateRole + checked: appsModel.sortRole === ResourcesProxyModel.ReleaseDateRole } } ] @@ -122,8 +143,9 @@ DiscoverPage { model: ResourcesProxyModel { id: appsModel - sortRole: ResourcesProxyModel.SortableRatingRole - sortOrder: Qt.DescendingOrder + sortRole: DiscoverSettings.appsListPageSorting + sortOrder: sortRole === ResourcesProxyModel.SortableRatingRole || sortRole === ResourcesProxyModel.ReleaseDateRole ? Qt.DescendingOrder : Qt.AscendingOrder + onBusyChanged: if (isBusy) { apps.currentIndex = -1 } @@ -133,77 +155,29 @@ DiscoverPage { application: model.application compact: page.compact showRating: page.showRating - view: apps } Label { anchors.centerIn: parent opacity: apps.count == 0 && !appsModel.isBusy ? 0.3 : 0 - Behavior on opacity { PropertyAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad; } } + Behavior on opacity { PropertyAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad } } text: i18n("Sorry, nothing found...") } - BusyIndicator { - id: busyIndicator - anchors { - top: parent.bottom - horizontalCenter: parent.horizontalCenter - margins: Kirigami.Units.largeSpacing - } - running: false - opacity: 0 - states: [ - State { - name: "running"; - when: appsModel.isBusy - PropertyChanges { target: busyIndicator; opacity: 1; running: true; } - AnchorChanges { target: busyIndicator; anchors.bottom: parent.bottom; anchors.top: undefined; } - } - ] - transitions: [ - Transition { - from: "" - to: "running" - SequentialAnimation { - PauseAnimation { duration: Kirigami.Units.longDuration * 5; } - ParallelAnimation { - AnchorAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad; } - PropertyAnimation { property: "opacity"; duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad; } - } - } - }, - Transition { - from: "running" - to: "" - ParallelAnimation { - AnchorAnimation { duration: Kirigami.Units.shortDuration; easing.type: Easing.InOutQuad; } - PropertyAnimation { property: "opacity"; duration: Kirigami.Units.shortDuration; easing.type: Easing.InOutQuad; } - } - } - ] + footer: BusyIndicator { + anchors.horizontalCenter: parent.horizontalCenter + visible: appsModel.isBusy && apps.atYEnd + running: visible + opacity: visible ? 1 : 0 + Behavior on opacity { + PropertyAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad } + } Label { - id: busyLabel anchors { horizontalCenter: parent.horizontalCenter bottom: parent.top } text: i18n("Still looking...") - opacity: 0 - states: [ - State { - name: "running"; - when: busyIndicator.opacity === 1; - PropertyChanges { target: busyLabel; opacity: 1; } - } - ] - transitions: Transition { - from: "" - to: "running" - SequentialAnimation { - PauseAnimation { duration: Kirigami.Units.longDuration * 5; } - PropertyAnimation { property: "opacity"; duration: Kirigami.Units.longDuration * 10; easing.type: Easing.InOutCubic; } - } - } } } }
  30. Download patch discover/autotests/DiscoverTest.qml

    --- 5.14.5.1-2/discover/autotests/DiscoverTest.qml 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/autotests/DiscoverTest.qml 2019-11-12 10:10:38.000000000 +0000 @@ -34,7 +34,7 @@ Item } function isType(obj, typename) { - return obj && obj.toString().indexOf(typename+"_QMLTYPE_") == 0 + return obj && obj.toString().indexOf(typename+"_QMLTYPE_") === 0 } function chooseChild(obj, validator) { @@ -101,13 +101,14 @@ Item done = true; for(var v in testRoot) { - if (v.indexOf("test_") == 0) { + if (v.indexOf("test_") === 0) { testRoot.currentTest = v; testRoot.reset(); testRoot[v](); } } - Qt.quit(); + console.log("done") + appRoot.close() } } }
  31. Download patch debian/plasma-discover.install

    --- 5.14.5.1-2/debian/plasma-discover.install 2019-10-04 08:04:41.000000000 +0000 +++ 5.17.3-0ubuntu1/debian/plasma-discover.install 2019-11-12 17:03:55.000000000 +0000 @@ -1,17 +1,18 @@ -etc/xdg/discover.categories +etc/xdg/autostart/org.kde.discover.notifier.desktop +#usr/lib/*/qt5/plugins/discover/fwupd-backend.so usr/bin/plasma-discover +usr/lib/*/libexec/DiscoverNotifier usr/lib/*/libexec/kf5/discover/runservice -usr/lib/*/plasma-discover/* +usr/lib/*/plasma-discover/libDiscoverCommon.so +usr/lib/*/plasma-discover/libDiscoverNotifiers.so usr/lib/*/qt5/plugins/discover-notifier/DiscoverPackageKitNotifier.so usr/lib/*/qt5/plugins/discover/kns-backend.so usr/lib/*/qt5/plugins/discover/packagekit-backend.so -usr/lib/*/qt5/qml/org/kde/discovernotifier/libDiscoverNotifierDeclarativePlugin.so -usr/lib/*/qt5/qml/org/kde/discovernotifier/qmldir usr/share/applications/org.kde.discover.apt.urlhandler.desktop usr/share/applications/org.kde.discover.desktop -usr/share/applications/org.kde.discover.snap.urlhandler.desktop +usr/share/applications/org.kde.discover.notifier.desktop usr/share/applications/org.kde.discover.urlhandler.desktop -usr/share/knotifications5/* -usr/share/kservices5/* -usr/share/metainfo/* -usr/share/plasma/plasmoids/* +usr/share/knotifications5/discoverabstractnotifier.notifyrc +usr/share/metainfo/org.kde.discover.appdata.xml +usr/share/metainfo/org.kde.discover.packagekit.appdata.xml +usr/share/qlogging-categories5/discover.categories
  32. Download patch libdiscover/backends/DummyBackend/DummyNotifier.cpp

    --- 5.14.5.1-2/libdiscover/backends/DummyBackend/DummyNotifier.cpp 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/DummyBackend/DummyNotifier.cpp 2019-11-12 10:10:38.000000000 +0000 @@ -35,12 +35,3 @@ void DummyNotifier::recheckSystemUpdateN emit foundUpdates(); } -uint DummyNotifier::securityUpdatesCount() -{ - return 0; -} - -uint DummyNotifier::updatesCount() -{ - return 0; -}
  33. Download patch debian/plasma-discover-backend-snap.install

    --- 5.14.5.1-2/debian/plasma-discover-backend-snap.install 2019-10-04 08:04:41.000000000 +0000 +++ 5.17.3-0ubuntu1/debian/plasma-discover-backend-snap.install 2019-11-12 17:03:55.000000000 +0000 @@ -1,7 +1,9 @@ usr/lib/*/libexec/discover/SnapMacaroonDialog usr/lib/*/qt5/plugins/discover/snap-backend.so usr/lib/kauth/libexec/libsnap_helper +usr/share/applications/org.kde.discover.snap.urlhandler.desktop usr/share/dbus-1/system-services/org.kde.discover.libsnapclient.service usr/share/dbus-1/system.d/org.kde.discover.libsnapclient.conf usr/share/libdiscover/categories/snap-backend-categories.xml +usr/share/metainfo/org.kde.discover.snap.appdata.xml usr/share/polkit-1/actions/org.kde.discover.libsnapclient.policy
  34. Download patch discover/qml/Shadow.qml

    --- 5.14.5.1-2/discover/qml/Shadow.qml 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/qml/Shadow.qml 2019-11-12 10:10:38.000000000 +0000 @@ -28,8 +28,8 @@ LinearGradient { width: Units.gridUnit/2 height: Units.gridUnit/2 - start: Qt.point((edge != Qt.RightEdge ? 0 : width), (edge != Qt.BottomEdge ? 0 : height)) - end: Qt.point((edge != Qt.LeftEdge ? 0 : width), (edge != Qt.TopEdge ? 0 : height)) + start: Qt.point((edge !== Qt.RightEdge ? 0 : width), (edge !== Qt.BottomEdge ? 0 : height)) + end: Qt.point((edge !== Qt.LeftEdge ? 0 : width), (edge !== Qt.TopEdge ? 0 : height)) gradient: Gradient { GradientStop { position: 0.0
  35. Download patch debian/plasma-discover-backend-flatpak.install

    --- 5.14.5.1-2/debian/plasma-discover-backend-flatpak.install 2019-10-04 08:04:41.000000000 +0000 +++ 5.17.3-0ubuntu1/debian/plasma-discover-backend-flatpak.install 2019-11-12 17:03:55.000000000 +0000 @@ -3,3 +3,4 @@ usr/lib/*/qt5/plugins/discover/flatpak-b usr/share/applications/org.kde.discover-flatpak.desktop usr/share/icons/hicolor/scalable/apps/flatpak-discover.svg usr/share/libdiscover/categories/flatpak-backend-categories.xml +usr/share/metainfo/org.kde.discover.flatpak.appdata.xml
  36. Download patch libdiscover/backends/DummyBackend/tests/UpdateDummyTest.cpp

    --- 5.14.5.1-2/libdiscover/backends/DummyBackend/tests/UpdateDummyTest.cpp 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/DummyBackend/tests/UpdateDummyTest.cpp 2019-11-12 10:10:38.000000000 +0000 @@ -19,7 +19,7 @@ ***************************************************************************/ #include "DummyTest.h" -#include <tests/modeltest.h> +#include <QAbstractItemModelTester> #include <KFormat> #include <resources/ResourcesModel.h> #include <resources/ResourcesProxyModel.h> @@ -69,19 +69,19 @@ private Q_SLOTS: void testInformation() { ResourcesUpdatesModel* rum = new ResourcesUpdatesModel(this); - new ModelTest(rum, rum); + new QAbstractItemModelTester(rum, rum); UpdateModel* m = new UpdateModel(this); - new ModelTest(m, m); + new QAbstractItemModelTester(m, m); m->setBackend(rum); rum->prepare(); QSignalSpy spySetup(m_appBackend->backendUpdater(), &AbstractBackendUpdater::progressingChanged); QVERIFY(!m_appBackend->backendUpdater()->isProgressing() || spySetup.wait()); - QCOMPARE(m_appBackend->updatesCount(), m_appBackend->property("startElements").toInt()*2/3); + QCOMPARE(m_appBackend->updatesCount(), m_appBackend->property("startElements").toInt()); QCOMPARE(m->hasUpdates(), true); - QCOMPARE(m->index(0,0).data(UpdateModel::ChangelogRole).toString(), {}); + QCOMPARE(m->index(0,0).data(UpdateModel::ChangelogRole).toString(), QString{}); QSignalSpy spy(m, &QAbstractItemModel::dataChanged); m->fetchUpdateDetails(0); @@ -93,16 +93,16 @@ private Q_SLOTS: void testUpdate() { ResourcesUpdatesModel* rum = new ResourcesUpdatesModel(this); - new ModelTest(rum, rum); + new QAbstractItemModelTester(rum, rum); UpdateModel* m = new UpdateModel(this); - new ModelTest(m, m); + new QAbstractItemModelTester(m, m); m->setBackend(rum); rum->prepare(); QSignalSpy spySetup(m_appBackend->backendUpdater(), &AbstractBackendUpdater::progressingChanged); QVERIFY(!m_appBackend->backendUpdater()->isProgressing() || spySetup.wait()); - QCOMPARE(m_appBackend->updatesCount(), m_appBackend->property("startElements").toInt()*2/3); + QCOMPARE(m_appBackend->updatesCount(), m_appBackend->property("startElements").toInt()); QCOMPARE(m->hasUpdates(), true); for(int i=0, c=m->rowCount(); i<c; ++i) { @@ -147,10 +147,10 @@ private Q_SLOTS: QTest::qWait(20); QScopedPointer<ResourcesUpdatesModel> rum2(new ResourcesUpdatesModel(this)); - new ModelTest(rum2.data(), rum2.data()); + new QAbstractItemModelTester(rum2.data(), rum2.data()); QScopedPointer<UpdateModel> m2(new UpdateModel(this)); - new ModelTest(m2.data(), m2.data()); + new QAbstractItemModelTester(m2.data(), m2.data()); m->setBackend(rum2.data()); QCOMPARE(rum->isProgressing(), true);
  37. Download patch libdiscover/appstream/OdrsReviewsBackend.h

    --- 5.14.5.1-2/libdiscover/appstream/OdrsReviewsBackend.h 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/appstream/OdrsReviewsBackend.h 2019-11-12 10:10:38.000000000 +0000 @@ -31,11 +31,13 @@ class KJob; class AbstractResourcesBackend; +class CachedNetworkAccessManager; + class DISCOVERCOMMON_EXPORT OdrsReviewsBackend : public AbstractReviewsBackend { Q_OBJECT public: - explicit OdrsReviewsBackend(AbstractResourcesBackend *parent = nullptr); + explicit OdrsReviewsBackend(); QString userName() const override; void login() override {} @@ -50,8 +52,8 @@ public: void submitReview(AbstractResource *, const QString &summary, const QString &description, const QString &rating) override; void flagReview(Review *, const QString &, const QString &) override {} void submitUsefulness(Review *review, bool useful) override; - QStringList appstreamIds() const { return m_ratings.keys(); } bool isResourceSupported(AbstractResource * res) const override; + void emitRatingFetched(AbstractResourcesBackend* backend, const QList<AbstractResource*>& res) const; private Q_SLOTS: void ratingsFetched(KJob *job); @@ -63,12 +65,13 @@ Q_SIGNALS: void ratingsReady(); private: + QNetworkAccessManager* nam(); void parseRatings(); void parseReviews(const QJsonDocument &document, AbstractResource *resource); QHash<QString, Rating*> m_ratings; bool m_isFetching; - QNetworkAccessManager* const m_nam; + CachedNetworkAccessManager* m_delayedNam = nullptr; }; #endif // ODRSREVIEWSBACKEND_H
  38. Download patch discover/qml/InstalledPage.qml

    --- 5.14.5.1-2/discover/qml/InstalledPage.qml 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/qml/InstalledPage.qml 2019-11-12 10:10:38.000000000 +0000 @@ -8,9 +8,10 @@ import org.kde.kirigami 2.1 as Kirigami ApplicationsListPage { id: page stateFilter: AbstractResource.Installed - sortRole: ResourcesProxyModel.NameRole sortOrder: Qt.AscendingOrder allBackends: true + sortProperty: "installedPageSorting" + sortRole: DiscoverSettings.installedPageSorting title: i18n("Installed") compact: true
  39. Download patch CMakeLists.txt

    --- 5.14.5.1-2/CMakeLists.txt 2019-01-08 10:58:18.000000000 +0000 +++ 5.17.3-0ubuntu1/CMakeLists.txt 2019-11-12 10:11:17.000000000 +0000 @@ -1,11 +1,11 @@ project(discover) -set(PROJECT_VERSION "5.14.5") +set(PROJECT_VERSION "5.17.3") set(PROJECT_VERSION_MAJOR 5) cmake_minimum_required(VERSION 2.8.12) -set(QT_MIN_VERSION "5.11.0") -set(KF5_MIN_VERSION "5.50.0") +set(QT_MIN_VERSION "5.12.0") +set(KF5_MIN_VERSION "5.62.0") find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) @@ -23,18 +23,19 @@ include(ECMQtDeclareLoggingCategory) find_package(PkgConfig REQUIRED) -find_package(KF5 ${KF5_MIN_VERSION} REQUIRED CoreAddons Config Crash DBusAddons I18n Archive XmlGui ItemModels KIO) -find_package(KF5Kirigami2 2.1.0) +find_package(KF5 ${KF5_MIN_VERSION} REQUIRED CoreAddons Config Crash DBusAddons I18n Archive XmlGui ItemModels KIO Declarative) +find_package(KF5Kirigami2 2.7.0) -find_package(packagekitqt5 CONFIG) +find_package(packagekitqt5 1.0.1 CONFIG) find_package(AppStreamQt 0.11.1 CONFIG) find_package(KF5Attica 5.23 CONFIG) -find_package(KF5NewStuff 5.23 CONFIG) +find_package(KF5NewStuff 5.53 CONFIG) set(CMAKE_AUTORCC ON) -pkg_check_modules(Flatpak IMPORTED_TARGET flatpak>=0.6.12) +pkg_check_modules(Flatpak IMPORTED_TARGET flatpak>=0.11.8) pkg_check_modules(Fwupd IMPORTED_TARGET fwupd>=1.0.6) +pkg_check_modules(Markdown IMPORTED_TARGET libmarkdown) if(NOT CMAKE_VERSION VERSION_LESS "3.10.0") # CMake 3.9+ warns about automoc on files without Q_OBJECT, and doesn't know about other macros. @@ -69,28 +70,28 @@ set_package_properties(KF5NewStuff PROPE TYPE OPTIONAL) set_package_properties(packagekitqt5 PROPERTIES DESCRIPTION "Library that exposes PackageKit resources" - URL "http://www.packagekit.org" + URL "https://www.freedesktop.org/software/PackageKit/" PURPOSE "Required to build the PackageKit backend" TYPE OPTIONAL) set_package_properties(AppStreamQt PROPERTIES DESCRIPTION "Library that lists Appstream resources" - URL "http://www.freedesktop.org" - PURPOSE "Required to build the PackageKit backend" + URL "https://www.freedesktop.org" + PURPOSE "Required to build the PackageKit and Flatpak backends" TYPE OPTIONAL) set_package_properties(FLATPAK PROPERTIES DESCRIPTION "Library that exposes flatpak repositories" - URL "http://www.freedesktop.org" + URL "https://www.freedesktop.org" PURPOSE "Required to build the Flatpak backend" TYPE OPTIONAL) set_package_properties(LIBFWUPD PROPERTIES DESCRIPTION "Library that exposes fwupd" - URL "http://www.fwupd.org" + URL "https://www.fwupd.org" PURPOSE "Required to build the Fwupd backend" TYPE OPTIONAL) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) -install( FILES discover.categories DESTINATION ${KDE_INSTALL_CONFDIR} ) +install(FILES discover.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}) find_package(KF5I18n CONFIG REQUIRED) ki18n_install(po)
  40. Download patch libdiscover/backends/FwupdBackend/FwupdBackend.cpp

    --- 5.14.5.1-2/libdiscover/backends/FwupdBackend/FwupdBackend.cpp 2019-02-13 13:39:58.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/FwupdBackend/FwupdBackend.cpp 2019-11-12 10:10:38.000000000 +0000 @@ -63,7 +63,8 @@ QMap<GChecksumType, QCryptographicHash:: FwupdBackend::~FwupdBackend() { g_cancellable_cancel(m_cancellable); - m_threadPool.waitForDone(200); + if (!m_threadPool.waitForDone(200)) + qWarning("Could not stop all fwupd threads"); m_threadPool.clear(); g_object_unref(m_cancellable); @@ -231,8 +232,7 @@ FwupdResource* FwupdBackend::createApp(F } } - if (!app->needsReboot()) - app->setState(AbstractResource::Upgradeable); + app->setState(AbstractResource::Upgradeable); return app.take(); } @@ -346,7 +346,7 @@ void FwupdBackend::refreshRemote(FwupdBa void FwupdBackend::handleError(GError *perror) { //TODO: localise the error message - if (!g_error_matches(perror, FWUPD_ERROR, FWUPD_ERROR_INVALID_FILE) && !g_error_matches(perror, FWUPD_ERROR, FWUPD_ERROR_NOTHING_TO_DO)) { + if (perror && !g_error_matches(perror, FWUPD_ERROR, FWUPD_ERROR_INVALID_FILE) && !g_error_matches(perror, FWUPD_ERROR, FWUPD_ERROR_NOTHING_TO_DO)) { const QString msg = QString::fromUtf8(perror->message); QTimer::singleShot(0, this, [this, msg](){ Q_EMIT passiveMessage(msg); @@ -454,7 +454,7 @@ ResultsStream* FwupdBackend::search(cons if (filter.resourceUrl.scheme() == QLatin1String("fwupd")) { return findResourceByPackageName(filter.resourceUrl); } else if (!filter.resourceUrl.isEmpty()) { - return new ResultsStream(QStringLiteral("FwupdStream-void"), {}); + return resourceForFile(filter.resourceUrl); } auto stream = new ResultsStream(QStringLiteral("FwupdStream")); @@ -518,7 +518,7 @@ Transaction* FwupdBackend::removeApplica return nullptr; } -AbstractResource * FwupdBackend::resourceForFile(const QUrl& path) +ResultsStream* FwupdBackend::resourceForFile(const QUrl& path) { g_autoptr(GError) error = nullptr; @@ -544,13 +544,14 @@ AbstractResource * FwupdBackend::resourc } addResourceToList(app); connect(app, &FwupdResource::stateChanged, this, &FwupdBackend::updatesCountChanged); + return new ResultsStream(QStringLiteral("FwupdStream-file"), {app}); } else { handleError(error); } } - return app; + return new ResultsStream(QStringLiteral("FwupdStream-void"), {}); } QString FwupdBackend::displayName() const
  41. Download patch libdiscover/backends/FlatpakBackend/FlatpakBackend.h

    --- 5.14.5.1-2/libdiscover/backends/FlatpakBackend/FlatpakBackend.h 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/FlatpakBackend/FlatpakBackend.h 2019-11-12 10:10:38.000000000 +0000 @@ -35,7 +35,6 @@ extern "C" { #include <flatpak.h> } -class QAction; class FlatpakSourcesBackend; class StandardBackendUpdater; class OdrsReviewsBackend; @@ -58,11 +57,14 @@ public: Transaction* installApplication(AbstractResource* app, const AddonList& addons) override; Transaction* removeApplication(AbstractResource* app) override; bool isFetching() const override { return m_isFetching>0; } - AbstractResource * resourceForFile(const QUrl & ) override; void checkForUpdates() override; QString displayName() const override; bool hasApplications() const override { return true; } FlatpakResource * addSourceFromFlatpakRepo(const QUrl &url); + QStringList extends() const override { return m_extends; } + + FlatpakResource * addAppFromFlatpakBundle(const QUrl &url); + FlatpakResource * addAppFromFlatpakRef(const QUrl &url); private Q_SLOTS: void onFetchMetadataFinished(FlatpakInstallation *flatpakInstallation, FlatpakResource *resource, const QByteArray &metadata); @@ -73,6 +75,7 @@ Q_SIGNALS: //for tests void initialized(); private: + void metadataRefreshed(); bool flatpakResourceLessThan(AbstractResource* l, AbstractResource* r) const; void announceRatingsReady(); FlatpakInstallation * preferredInstallation() const { return m_installations.constFirst(); } @@ -82,8 +85,6 @@ private: FlatpakResource * getAppForInstalledRef(FlatpakInstallation *flatpakInstallation, FlatpakInstalledRef *ref) const; FlatpakResource * getRuntimeForApp(FlatpakResource *resource) const; - FlatpakResource * addAppFromFlatpakBundle(const QUrl &url); - FlatpakResource * addAppFromFlatpakRef(const QUrl &url); void addResource(FlatpakResource *resource); void loadAppsFromAppstreamData(); bool loadAppsFromAppstreamData(FlatpakInstallation *flatpakInstallation); @@ -111,6 +112,7 @@ private: QSharedPointer<OdrsReviewsBackend> m_reviews; uint m_isFetching = 0; uint m_refreshAppstreamMetadataJobs; + QStringList m_extends; GCancellable *m_cancellable; QVector<FlatpakInstallation *> m_installations;
  42. Download patch discover/PaginateModel.cpp
  43. Download patch libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp
  44. Download patch .gitignore

    --- 5.14.5.1-2/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ 5.17.3-0ubuntu1/.gitignore 2019-11-12 10:10:38.000000000 +0000 @@ -0,0 +1 @@ +*.kdev4
  45. Download patch discover/FeaturedModel.cpp

    --- 5.14.5.1-2/discover/FeaturedModel.cpp 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/FeaturedModel.cpp 2019-11-12 10:10:38.000000000 +0000 @@ -43,17 +43,23 @@ FeaturedModel::FeaturedModel() const QString dir = QStandardPaths::writableLocation(QStandardPaths::CacheLocation); QDir().mkpath(dir); - *featuredCache = dir+QLatin1String("/featured-5.9.json"); - const QUrl featuredUrl(QStringLiteral("https://autoconfig.kde.org/discover/featured-5.9.json")); - auto *getJob = KIO::storedGet(featuredUrl, KIO::NoReload, KIO::HideProgressInfo); - connect(getJob, &KIO::StoredTransferJob::result, this, [this, getJob](){ + const bool isMobile = QByteArrayList{"1", "true"}.contains(qgetenv("QT_QUICK_CONTROLS_MOBILE")); + auto fileName = isMobile ? QLatin1String("/featured-mobile-5.9.json") : QLatin1String("/featured-5.9.json"); + *featuredCache = dir + fileName; + const QUrl featuredUrl(QStringLiteral("https://autoconfig.kde.org/discover") + fileName); + auto *fetchJob = KIO::storedGet(featuredUrl, KIO::NoReload, KIO::HideProgressInfo); + acquireFetching(true); + connect(fetchJob, &KIO::StoredTransferJob::result, this, [this, fetchJob](){ QFile f(*featuredCache); if (!f.open(QIODevice::WriteOnly)) qCWarning(DISCOVER_LOG) << "could not open" << *featuredCache << f.errorString(); - f.write(getJob->data()); + f.write(fetchJob->data()); f.close(); refresh(); + acquireFetching(false); + + Q_EMIT isFetchingChanged(); }); if (!ResourcesModel::global()->backends().isEmpty() && QFile::exists(*featuredCache)) @@ -62,6 +68,7 @@ FeaturedModel::FeaturedModel() void FeaturedModel::refresh() { + acquireFetching(true); QFile f(*featuredCache); if (!f.open(QIODevice::ReadOnly)) { qCWarning(DISCOVER_LOG) << "couldn't open file" << *featuredCache << f.errorString(); @@ -80,6 +87,7 @@ void FeaturedModel::refresh() void FeaturedModel::setUris(const QVector<QUrl>& uris) { + acquireFetching(false); auto backend = ResourcesModel::global()->currentApplicationBackend(); if (uris == m_uris || !backend) return; @@ -111,6 +119,19 @@ static void filterDupes(QVector<Abstract } } +void FeaturedModel::acquireFetching(bool f) +{ + if (f) + m_isFetching++; + else + m_isFetching--; + + if ((!f && m_isFetching==0) || (f && m_isFetching==1)) { + emit isFetchingChanged(); + } + Q_ASSERT(m_isFetching>=0); +} + void FeaturedModel::setResources(const QVector<AbstractResource *>& _resources) { auto resources = _resources;
  46. Download patch libdiscover/backends/CMakeLists.txt

    --- 5.14.5.1-2/libdiscover/backends/CMakeLists.txt 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/CMakeLists.txt 2019-11-12 10:10:38.000000000 +0000 @@ -1,6 +1,6 @@ function(add_unit_test name) - add_executable(${name} ${CMAKE_SOURCE_DIR}/libdiscover/tests/modeltest.cpp ${ARGN}) - add_test(${name} ${name}) + add_executable(${name} ${ARGN}) + add_test(${name} ${CMAKE_BINARY_DIR}/bin/${name}) ecm_mark_as_test(${name}) target_link_libraries(${name} Discover::Common @@ -31,7 +31,7 @@ endif() find_package(Snapd) set_package_properties(Snapd PROPERTIES DESCRIPTION "Library that exposes Snapd" - URL "http://www.snapcraft.io" + URL "https://www.snapcraft.io" PURPOSE "Required to build the Snap backend" TYPE OPTIONAL)
  47. Download patch discover/autotests/toplevels.qml

    --- 5.14.5.1-2/discover/autotests/toplevels.qml 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/autotests/toplevels.qml 2019-11-12 10:10:38.000000000 +0000 @@ -52,7 +52,7 @@ DiscoverTest }); var updateButton; chooseChild(drawer, function(object) { - if (object.objectName == "updateButton") { + if (object.objectName === "updateButton") { updateButton = object; return true } @@ -72,10 +72,10 @@ DiscoverTest var updatePage = appRoot.stack.currentItem; compare(typeName(updatePage), "UpdatesPage") compare(updatePage.state, "has-updates", "to update") - var action = updatePage.currentAction + var action = updatePage.actions.main verify(action); action.triggered(updatePage); - compare(updatePage.state, "has-updates", "updating") + compare(updatePage.state, "progressing", "updating") //make sure the window doesn't close while updating verify(appRoot.visible);
  48. Download patch discover/autotests/CMakeLists.txt

    --- 5.14.5.1-2/discover/autotests/CMakeLists.txt 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/autotests/CMakeLists.txt 2019-11-12 10:10:38.000000000 +0000 @@ -1,6 +1,6 @@ set(plasma_discover_autotest_SRCS) ecm_qt_declare_logging_category(plasma_discover_autotest_SRCS HEADER discover_debug.h IDENTIFIER DISCOVER_LOG CATEGORY_NAME org.kde.plasma.discover) -ecm_add_test(PaginateModelTest.cpp ../PaginateModel.cpp ${plasma_discover_autotest_SRCS} ${CMAKE_SOURCE_DIR}/libdiscover/tests/modeltest.cpp TEST_NAME PaginateModelTest LINK_LIBRARIES Qt5::Test Qt5::Gui) +ecm_add_test(PaginateModelTest.cpp ../PaginateModel.cpp ${plasma_discover_autotest_SRCS} TEST_NAME PaginateModelTest LINK_LIBRARIES Qt5::Test Qt5::Gui) target_include_directories(PaginateModelTest PUBLIC ${CMAKE_SOURCE_DIR}/libdiscover/) if(BUILD_DummyBackend)
  49. Download patch libdiscover/backends/DummyBackend/DummyNotifier.h

    --- 5.14.5.1-2/libdiscover/backends/DummyBackend/DummyNotifier.h 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/DummyBackend/DummyNotifier.h 2019-11-12 10:10:38.000000000 +0000 @@ -32,8 +32,8 @@ public: ~DummyNotifier() override; void recheckSystemUpdateNeeded() override; - uint securityUpdatesCount() override; - uint updatesCount() override; + bool hasSecurityUpdates() override { return false; } + bool hasUpdates() override { return false; } bool needsReboot() const override { return false; } };
  50. Download patch discover/qml/InstallApplicationButton.qml

    --- 5.14.5.1-2/discover/qml/InstallApplicationButton.qml 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/qml/InstallApplicationButton.qml 2019-11-12 10:10:38.000000000 +0000 @@ -18,15 +18,22 @@ ConditionalLoader id: listener } - property QtObject action: Kirigami.Action { + readonly property Kirigami.Action action: Kirigami.Action { text: root.text icon { name: application.isInstalled ? "trash-empty" : "cloud-download" color: !enabled ? Kirigami.Theme.backgroundColor : !listener.isActive ? (application.isInstalled ? Kirigami.Theme.negativeTextColor : Kirigami.Theme.positiveTextColor) : Kirigami.Theme.backgroundColor } - enabled: !listener.isActive && application.state != AbstractResource.Broken + enabled: !listener.isActive && application.state !== AbstractResource.Broken onTriggered: root.click() } + readonly property Kirigami.Action cancelAction: Kirigami.Action { + text: i18n("Cancel") + icon.name: "dialog-cancel" + enabled: listener.isCancellable + onTriggered: listener.cancel() + visible: listener.isActive + } function click() { if (!isActive) { @@ -35,7 +42,7 @@ ConditionalLoader else ResourcesModel.installApplication(application); } else { - console.warn("trying to un/install but resouce still active", application.name) + console.warn("trying to un/install but resource still active", application.name) } } @@ -43,9 +50,10 @@ ConditionalLoader componentTrue: RowLayout { ToolButton { Layout.fillHeight: true - icon.name: "dialog-cancel" - enabled: listener.isCancellable - onClicked: listener.cancel() + action: root.cancelAction + text: "" + ToolTip.visible: hovered + ToolTip.text: root.cancelAction.text } LabelBackground { @@ -56,7 +64,7 @@ ConditionalLoader } componentFalse: Button { - enabled: application.state != AbstractResource.Broken + enabled: application.state !== AbstractResource.Broken text: root.text focus: true
  51. Download patch discover/main.cpp

    --- 5.14.5.1-2/discover/main.cpp 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/main.cpp 2019-11-12 10:10:38.000000000 +0000 @@ -23,6 +23,7 @@ #include <KAboutData> #include <KCrash> #include <KDBusService> +#include <KQuickAddons/QtQuickSettings> #include <KLocalizedString> #include <QCommandLineParser> #include <qwindow.h> @@ -50,12 +51,11 @@ QCommandLineParser* createParser() parser->addOption(QCommandLineOption(QStringLiteral("compact"), i18n("Compact Mode (auto/compact/full)."), QStringLiteral("mode"), QStringLiteral("auto"))); parser->addOption(QCommandLineOption(QStringLiteral("local-filename"), i18n("Local package file to install"), QStringLiteral("package"))); parser->addOption(QCommandLineOption(QStringLiteral("listbackends"), i18n("List all the available backends."))); + parser->addOption(QCommandLineOption(QStringLiteral("search"), i18n("Search string."), QStringLiteral("text"))); parser->addOption(QCommandLineOption(QStringLiteral("test"), QStringLiteral("Test file"), QStringLiteral("file.qml"))); parser->addPositionalArgument(QStringLiteral("urls"), i18n("Supports appstream: url scheme")); DiscoverBackendsFactory::setupCommandLine(parser); KAboutData::applicationData().setupCommandLine(parser); - parser->addHelpOption(); - parser->addVersionOption(); return parser; } @@ -71,6 +71,9 @@ void processArgs(QCommandLineParser* par if(parser->isSet(QStringLiteral("mode"))) mainWindow->openMode(parser->value(QStringLiteral("mode"))); + if(parser->isSet(QStringLiteral("search"))) + Q_EMIT mainWindow->openSearch(parser->value(QStringLiteral("search"))); + if(parser->isSet(QStringLiteral("local-filename"))) mainWindow->openLocalPackage(QUrl::fromUserInput(parser->value(QStringLiteral("local-filename")), {}, QUrl::AssumeLocalFile)); @@ -92,12 +95,19 @@ int main(int argc, char** argv) app.setAttribute(Qt::AA_DontCreateNativeWidgetSiblings); app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); KCrash::initialize(); + KQuickAddons::QtQuickSettings::init(); KLocalizedString::setApplicationDomain("plasma-discover"); KAboutData about(QStringLiteral("discover"), i18n("Discover"), version, i18n("An application explorer"), - KAboutLicense::GPL, i18n("© 2010-2018 Plasma Development Team")); - about.addAuthor(i18n("Aleix Pol Gonzalez"), QString(), QStringLiteral("aleixpol@blue-systems.com")); + KAboutLicense::GPL, i18n("© 2010-2019 Plasma Development Team")); + about.addAuthor(i18n("Aleix Pol Gonzalez"), QString(), QStringLiteral("aleixpol@kde.org")); about.addAuthor(i18n("Jonathan Thomas"), QString(), QStringLiteral("echidnaman@kubuntu.org")); about.setProductName("discover/discover"); + about.setProgramLogo(app.windowIcon()); + + about.setTranslator( + i18ndc(nullptr, "NAME OF TRANSLATORS", "Your names"), + i18ndc(nullptr, "EMAIL OF TRANSLATORS", "Your emails")); + KAboutData::setApplicationData(about); DiscoverObject *mainWindow = nullptr;
  52. Download patch debian/salsa-ci.yml

    --- 5.14.5.1-2/debian/salsa-ci.yml 2019-10-04 08:04:41.000000000 +0000 +++ 5.17.3-0ubuntu1/debian/salsa-ci.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -include: - - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml - - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml - -variables: - SALSA_CI_DISABLE_MISSING_BREAKS: 0 - SALSA_CI_DISABLE_RC_BUGS: 0 - SALSA_CI_REPROTEST_ARGS: '--variations=-build-path'
  53. Download patch libdiscover/appstream/AppStreamUtils.h

    --- 5.14.5.1-2/libdiscover/appstream/AppStreamUtils.h 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/appstream/AppStreamUtils.h 2019-11-12 10:10:38.000000000 +0000 @@ -23,55 +23,20 @@ #include <QUrl> #include <QList> -#include <QDebug> #include <AppStreamQt/image.h> #include <AppStreamQt/component.h> -#include <AppStreamQt/release.h> -#include <AppStreamQt/screenshot.h> namespace AppStreamUtils { -static QUrl imageOfKind(const QList<AppStream::Image> &images, AppStream::Image::Kind kind) -{ - QUrl ret; - Q_FOREACH (const AppStream::Image &i, images) { - if (i.kind() == kind) { - ret = i.url(); - break; - } - } - return ret; -} +Q_DECL_EXPORT QUrl imageOfKind(const QList<AppStream::Image> &images, AppStream::Image::Kind kind); -static QString changelogToHtml(const AppStream::Component &appdata) -{ - if(appdata.releases().isEmpty()) - return {}; +Q_DECL_EXPORT QString changelogToHtml(const AppStream::Component &appdata); - const auto release = appdata.releases().constFirst(); - if (release.description().isEmpty()) - return {}; - - QString changelog = QStringLiteral("<h3>") + release.version() + QStringLiteral("</h3>") - + QStringLiteral("<p>") + release.description() + QStringLiteral("</p>"); - return changelog; -} +Q_DECL_EXPORT QPair<QList<QUrl>, QList<QUrl>> fetchScreenshots(const AppStream::Component &appdata); -static QPair<QList<QUrl>, QList<QUrl>> fetchScreenshots(const AppStream::Component &appdata) -{ - QList<QUrl> screenshots, thumbnails; - Q_FOREACH (const AppStream::Screenshot &s, appdata.screenshots()) { - const auto images = s.images(); - const QUrl thumbnail = AppStreamUtils::imageOfKind(images, AppStream::Image::KindThumbnail); - const QUrl plain = AppStreamUtils::imageOfKind(images, AppStream::Image::KindSource); - if (plain.isEmpty()) - qWarning() << "invalid screenshot for" << appdata.name(); - - screenshots << plain; - thumbnails << (thumbnail.isEmpty() ? plain : thumbnail); - } - return {screenshots, thumbnails}; -} +Q_DECL_EXPORT QJsonArray licenses(const AppStream::Component &appdata); + +Q_DECL_EXPORT QString appstreamId(const QUrl &appstreamUrl); }
  54. Download patch COPYING

    --- 5.14.5.1-2/COPYING 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/COPYING 2019-11-12 10:10:38.000000000 +0000 @@ -2,7 +2,7 @@ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -672,5 +672,5 @@ into proprietary programs. If your prog may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read -<http://www.gnu.org/philosophy/why-not-lgpl.html>. +<https://www.gnu.org/philosophy/why-not-lgpl.html>.
  55. Download patch debian/watch

    --- 5.14.5.1-2/debian/watch 2019-10-04 08:04:41.000000000 +0000 +++ 5.17.3-0ubuntu1/debian/watch 2019-11-12 17:03:55.000000000 +0000 @@ -1,2 +1,2 @@ version=4 -opts=pgpsigurlmangle=s/$/.sig/ https://download.kde.org/stable/plasma/([\d.]+)/discover@ANY_VERSION@@ARCHIVE_EXT@ +opts=pgpsigurlmangle=s/$/.sig/ https://download.kde.org/stable/plasma/([\d.]+)/discover-([\d.]+)\.tar\.xz
  56. Download patch libdiscover/backends/DummyBackend/DummyResource.cpp

    --- 5.14.5.1-2/libdiscover/backends/DummyBackend/DummyResource.cpp 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/DummyBackend/DummyResource.cpp 2019-11-12 10:10:38.000000000 +0000 @@ -27,21 +27,24 @@ Q_GLOBAL_STATIC_WITH_ARGS(QVector<QString>, s_icons, ({ QLatin1String("kdevelop"), QLatin1String("kalgebra"), QLatin1String("kmail"), QLatin1String("akregator"), QLatin1String("korganizer") })) -DummyResource::DummyResource(QString name, bool isTechnical, AbstractResourcesBackend* parent) +DummyResource::DummyResource(QString name, AbstractResource::Type type, AbstractResourcesBackend* parent) : AbstractResource(parent) , m_name(std::move(name)) , m_state(State::Broken) , m_iconName((*s_icons)[KRandom::random() % s_icons->size()]) , m_addons({ PackageState(QStringLiteral("a"), QStringLiteral("aaaaaa"), false), PackageState(QStringLiteral("b"), QStringLiteral("aaaaaa"), false), PackageState(QStringLiteral("c"), QStringLiteral("aaaaaa"), false)}) - , m_isTechnical(isTechnical) + , m_type(type) { const int nofScreenshots = KRandom::random() % 5; m_screenshots = QList<QUrl>{ - QUrl(QStringLiteral("http://screenshots.debian.net/screenshots/000/014/863/large.png")), - QUrl(QStringLiteral("https://c2.staticflickr.com/6/5656/21772158034_dc84382527_o.jpg")), + QUrl(QStringLiteral("https://screenshots.debian.net/screenshots/000/014/863/large.png")), QUrl(QStringLiteral("https://c1.staticflickr.com/9/8479/8166397343_b78106f353_k.jpg")), QUrl(QStringLiteral("https://c2.staticflickr.com/4/3685/9954407993_dad10a6943_k.jpg")), - QUrl(QStringLiteral("https://c1.staticflickr.com/1/653/22527103378_8ce572e1de_k.jpg")) + QUrl(QStringLiteral("https://c1.staticflickr.com/1/653/22527103378_8ce572e1de_k.jpg")), + QUrl(QStringLiteral("https://images.unsplash.com/photo-1528744598421-b7b93e12df15?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60")), + QUrl(QStringLiteral("https://images.unsplash.com/photo-1552385430-53e6f2028760?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=634&q=80")), + QUrl(QStringLiteral("https://images.unsplash.com/photo-1506810172640-8a9f77cb1472?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1350&q=80")), + }.mid(nofScreenshots); m_screenshotThumbnails = m_screenshots; } @@ -73,7 +76,7 @@ int DummyResource::size() QUrl DummyResource::homepage() { - return QUrl(QStringLiteral("http://kde.org")); + return QUrl(QStringLiteral("https://kde.org")); } QUrl DummyResource::helpURL() @@ -93,7 +96,8 @@ QUrl DummyResource::donationURL() QVariant DummyResource::icon() const { - return isTechnical() ? QStringLiteral("kalarm") : m_iconName; + static const QVector<QVariant> icons = { QStringLiteral("device-notifier"), QStringLiteral("media-floppy"), QStringLiteral("drink-beer") }; + return icons[type()]; } QString DummyResource::installedVersion() const @@ -101,9 +105,9 @@ QString DummyResource::installedVersion( return QStringLiteral("2.3"); } -QString DummyResource::license() +QJsonArray DummyResource::licenses() { - return QStringLiteral("GPL"); + return { QJsonObject{ {QStringLiteral("name"), QStringLiteral("GPL") }, { QStringLiteral("url"), QStringLiteral("https://kde.org") } } }; } QString DummyResource::longDescription()
  57. Download patch libdiscover/backends/FlatpakBackend/FlatpakNotifier.cpp

    --- 5.14.5.1-2/libdiscover/backends/FlatpakBackend/FlatpakNotifier.cpp 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/FlatpakBackend/FlatpakNotifier.cpp 2019-11-12 10:10:38.000000000 +0000 @@ -40,48 +40,32 @@ static void installationChanged(GFileMon return; } - notifier->checkUpdates(); + notifier->recheckSystemUpdateNeeded(); } FlatpakNotifier::FlatpakNotifier(QObject* parent) : BackendNotifierModule(parent) - , m_userInstallationUpdates(0) - , m_systemInstallationUpdates(0) + , m_cancellable(g_cancellable_new()) { - m_cancellable = g_cancellable_new(); - - checkUpdates(); - QTimer *dailyCheck = new QTimer(this); dailyCheck->setInterval(24 * 60 * 60 * 1000); //refresh at least once every day - connect(dailyCheck, &QTimer::timeout, this, &FlatpakNotifier::checkUpdates); -} - -FlatpakNotifier::~FlatpakNotifier() -{ - g_object_unref(m_userInstallationMonitor); - g_object_unref(m_systemInstallationMonitor); - g_object_unref(m_flatpakInstallationSystem); - g_object_unref(m_flatpakInstallationUser); - g_object_unref(m_cancellable); + connect(dailyCheck, &QTimer::timeout, this, &FlatpakNotifier::recheckSystemUpdateNeeded); } -void FlatpakNotifier::recheckSystemUpdateNeeded() +FlatpakNotifier::Installation::~Installation() { - checkUpdates(); + if (m_monitor) + g_object_unref(m_monitor); + if (m_installation) + g_object_unref(m_installation); } -uint FlatpakNotifier::securityUpdatesCount() -{ - return 0; -} - -uint FlatpakNotifier::updatesCount() +FlatpakNotifier::~FlatpakNotifier() { - return m_systemInstallationUpdates + m_userInstallationUpdates; + g_object_unref(m_cancellable); } -void FlatpakNotifier::checkUpdates() +void FlatpakNotifier::recheckSystemUpdateNeeded() { g_autoptr(GError) error = nullptr; @@ -90,36 +74,36 @@ void FlatpakNotifier::checkUpdates() qWarning() << "Failed to setup flatpak installations: " << error->message; } else { // Load updates from remote repositories - loadRemoteUpdates(m_flatpakInstallationSystem); - loadRemoteUpdates(m_flatpakInstallationUser); + loadRemoteUpdates(m_system.m_installation); + loadRemoteUpdates(m_user.m_installation); } } void FlatpakNotifier::onFetchUpdatesFinished(FlatpakInstallation *flatpakInstallation, GPtrArray *updates) { bool changed = false; - uint validUpdates = 0; + bool hasUpdates = false; g_autoptr(GPtrArray) fetchedUpdates = updates; - for (uint i = 0; i < fetchedUpdates->len; i++) { + for (uint i = 0; !hasUpdates && i < fetchedUpdates->len; i++) { FlatpakInstalledRef *ref = FLATPAK_INSTALLED_REF(g_ptr_array_index(fetchedUpdates, i)); const QString refName = QString::fromUtf8(flatpak_ref_get_name(FLATPAK_REF(ref))); // FIXME right now I can't think of any other filter than this, in FlatpakBackend updates are matched // with apps so .Locale/.Debug subrefs are not shown and updated automatically. Also this will show // updates for refs we don't show in Discover if appstream metadata or desktop file for them is not found - if (refName.endsWith(QStringLiteral(".Locale")) || refName.endsWith(QStringLiteral(".Debug"))) { + if (refName.endsWith(QLatin1String(".Locale")) || refName.endsWith(QLatin1String(".Debug"))) { continue; } - validUpdates++; + hasUpdates = true; } if (flatpak_installation_get_is_user(flatpakInstallation)) { - changed = m_userInstallationUpdates != validUpdates; - m_userInstallationUpdates = validUpdates; + changed = m_user.m_hasUpdates != hasUpdates; + m_user.m_hasUpdates = hasUpdates; } else { - changed = m_systemInstallationUpdates != validUpdates; - m_systemInstallationUpdates = validUpdates; + changed = m_system.m_hasUpdates != hasUpdates; + m_system.m_hasUpdates = hasUpdates; } if (changed) { @@ -130,6 +114,12 @@ void FlatpakNotifier::onFetchUpdatesFini void FlatpakNotifier::loadRemoteUpdates(FlatpakInstallation *installation) { auto fw = new QFutureWatcher<GPtrArray *>(this); + connect(fw, &QFutureWatcher<GPtrArray *>::finished, this, [this, installation, fw](){ + auto refs = fw->result(); + if (refs) + onFetchUpdatesFinished(installation, refs); + fw->deleteLater(); + }); fw->setFuture(QtConcurrent::run( [installation]() -> GPtrArray * { g_autoptr(GCancellable) cancellable = g_cancellable_new(); g_autoptr(GError) localError = nullptr; @@ -139,46 +129,45 @@ void FlatpakNotifier::loadRemoteUpdates( } return refs; })); - connect(fw, &QFutureWatcher<GPtrArray *>::finished, this, [this, installation, fw](){ - auto refs = fw->result(); - if (refs) - onFetchUpdatesFinished(installation, refs); - fw->deleteLater(); - }); +} + +bool FlatpakNotifier::hasUpdates() +{ + return m_system.m_hasUpdates || m_user.m_hasUpdates; } bool FlatpakNotifier::setupFlatpakInstallations(GError **error) { - if (!m_flatpakInstallationSystem) { - m_flatpakInstallationSystem = flatpak_installation_new_system(m_cancellable, error); - if (!m_flatpakInstallationSystem) { + if (!m_system.m_installation) { + m_system.m_installation = flatpak_installation_new_system(m_cancellable, error); + if (!m_system.m_installation) { return false; } } - if (!m_flatpakInstallationUser) { - m_flatpakInstallationUser = flatpak_installation_new_user(m_cancellable, error); - if (!m_flatpakInstallationUser) { + if (!m_user.m_installation) { + m_user.m_installation = flatpak_installation_new_user(m_cancellable, error); + if (!m_user.m_installation) { return false; } } - if (!m_systemInstallationMonitor) { - m_systemInstallationMonitor = flatpak_installation_create_monitor(m_flatpakInstallationSystem, m_cancellable, error); - if (!m_systemInstallationMonitor) { + if (!m_system.m_monitor) { + m_system.m_monitor = flatpak_installation_create_monitor(m_system.m_installation, m_cancellable, error); + if (!m_system.m_monitor) { return false; } - g_signal_connect(m_systemInstallationMonitor, "changed", G_CALLBACK(installationChanged), this); + g_signal_connect(m_system.m_monitor, "changed", G_CALLBACK(installationChanged), this); } - if (!m_userInstallationMonitor) { - m_userInstallationMonitor = flatpak_installation_create_monitor(m_flatpakInstallationUser, m_cancellable, error); - if (!m_userInstallationMonitor) { + if (!m_user.m_monitor) { + m_user.m_monitor = flatpak_installation_create_monitor(m_user.m_installation, m_cancellable, error); + if (!m_user.m_monitor) { return false; } - g_signal_connect(m_userInstallationMonitor, "changed", G_CALLBACK(installationChanged), this); + g_signal_connect(m_user.m_monitor, "changed", G_CALLBACK(installationChanged), this); } return true;
  58. Download patch discover/autotests/install.qml

    --- 5.14.5.1-2/discover/autotests/install.qml 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/autotests/install.qml 2019-11-12 10:10:38.000000000 +0000 @@ -36,6 +36,6 @@ DiscoverTest button.listener.cancel() verify(!button.isActive) compare(cancelSpy.count, 1) - verify(state == button.application.state) + verify(state === button.application.state) } }
  59. Download patch discover/qml/BrowsingPage.qml

    --- 5.14.5.1-2/discover/qml/BrowsingPage.qml 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/qml/BrowsingPage.qml 2019-11-12 10:10:38.000000000 +0000 @@ -42,6 +42,20 @@ DiscoverPage Navigation.openCategory(null, "") } + BusyIndicator { + id: indicator + anchors.centerIn: parent + width: Kirigami.Units.gridUnit * 8 + height: width + visible: apps.count === 0 && apps.model.isFetching + } + + background: Rectangle { + color: Kirigami.Theme.backgroundColor + Kirigami.Theme.colorSet: Kirigami.Theme.Window + Kirigami.Theme.inherit: false + } + signal clearSearch() readonly property bool compact: page.width < 550 || !applicationWindow().wideScreen @@ -53,7 +67,25 @@ DiscoverPage delegate: ApplicationDelegate { application: model.application compact: page.compact - view: apps + } + + footer: ColumnLayout { + visible: apps.count === 0 && !apps.model.isFetching + width: parent.width + + Kirigami.Icon { + source: "network-disconnect" + Layout.alignment: Qt.AlignHCenter + width: Kirigami.Units.gridUnit * 4 + height: width + } + + Kirigami.Heading { + Layout.fillWidth: true + horizontalAlignment: Text.AlignHCenter + text: xi18nc("@info", "Unable to load applications.<nl/>Please verify Internet connectivity.") + level: 3 + } } } }
  60. Download patch discover/qml/SearchField.qml

    --- 5.14.5.1-2/discover/qml/SearchField.qml 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/qml/SearchField.qml 2019-11-12 10:10:38.000000000 +0000 @@ -1,5 +1,6 @@ /*************************************************************************** * Copyright © 2017 Aleix Pol Gonzalez <aleixpol@blue-systems.com> * + * Copyright © 2019 Carl Schwan <carl@carlschwan.eu> * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License as * @@ -20,51 +21,34 @@ import QtQuick 2.5 import QtQuick.Controls 2.1 -import org.kde.kirigami 2.1 as Kirigami +import org.kde.kirigami 2.7 as Kirigami -TextField +Kirigami.ActionTextField { id: searchField + focusSequence: "Ctrl+F" + rightActions: [ + Kirigami.Action { + iconName: "edit-clear" + visible: searchField.text.length !== 0 + onTriggered: searchField.clearText() + } + ] + property QtObject page property string currentSearchText placeholderText: (!enabled || !page || page.hasOwnProperty("isHome") || page.title.length === 0) ? i18n("Search...") : i18n("Search in '%1'...", window.leftPage.title) - Shortcut { - sequence: "Ctrl+F" - onActivated: { - searchField.forceActiveFocus() - searchField.selectAll() - } - } onAccepted: { currentSearchText = text } - hoverEnabled: true - ToolTip { - delay: Kirigami.Units.longDuration - visible: hovered - text: searchAction.shortcut - } - function clearText() { searchField.text = "" searchField.accepted() } - ToolButton { - anchors { - top: parent.top - right: parent.right - bottom: parent.bottom - margins: Kirigami.Units.smallSpacing - } - icon.name: "edit-clear" - visible: searchField.text != "" - onClicked: clearText() - } - Connections { ignoreUnknownSignals: true target: page
  61. Download patch libdiscover/backends/FlatpakBackend/tests/FlatpakTest.cpp

    --- 5.14.5.1-2/libdiscover/backends/FlatpakBackend/tests/FlatpakTest.cpp 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/FlatpakBackend/tests/FlatpakTest.cpp 2019-11-12 10:10:38.000000000 +0000 @@ -49,6 +49,7 @@ public: FlatpakTest(QObject* parent = nullptr): QObject(parent) { + QStandardPaths::setTestModeEnabled(true); qputenv("FLATPAK_TEST_MODE", "ON"); m_model = new ResourcesModel(QStringLiteral("flatpak-backend"), this); m_appBackend = backendByName(m_model, QStringLiteral("FlatpakBackend")); @@ -57,6 +58,8 @@ public: private Q_SLOTS: void init() { + QDir(QStandardPaths::writableLocation(QStandardPaths::TempLocation) + QLatin1String("/discover-flatpak-test")).removeRecursively(); + QVERIFY(m_appBackend); while(m_appBackend->isFetching()) { QSignalSpy spy(m_appBackend, &AbstractResourcesBackend::fetchingChanged); @@ -76,9 +79,9 @@ private Q_SLOTS: if (m->rowCount() == 1) { QSignalSpy spy(m, &SourcesModel::rowsInserted); bk->actions().constFirst()->trigger(); - QVERIFY(spy.count() || spy.wait()); + QVERIFY(spy.count() || spy.wait(20000)); } - QVERIFY(initializedSpy.count() || initializedSpy.wait()); + QVERIFY(initializedSpy.count() || initializedSpy.wait(20000)); auto resFlathub = getAllResources(m_appBackend); QVERIFY(resFlathub.count() > 0); } @@ -100,9 +103,9 @@ private Q_SLOTS: const auto resRssguard = res.constFirst(); QCOMPARE(resRssguard->state(), AbstractResource::None); - waitTransaction(m_appBackend->installApplication(resRssguard)); + QCOMPARE(waitTransaction(m_appBackend->installApplication(resRssguard)), Transaction::DoneStatus); QCOMPARE(resRssguard->state(), AbstractResource::Installed); - waitTransaction(m_appBackend->removeApplication(resRssguard)); + QCOMPARE(waitTransaction(m_appBackend->removeApplication(resRssguard)), Transaction::DoneStatus); QCOMPARE(resRssguard->state(), AbstractResource::None); } @@ -124,14 +127,19 @@ private Q_SLOTS: } private: - void waitTransaction(Transaction* t) { - QSignalSpy spyInstalled(t->resource(), &AbstractResource::stateChanged); + Transaction::Status waitTransaction(Transaction* t) { + TransactionModel::global()->addTransaction(t); + QSignalSpy spyInstalled(TransactionModel::global(), &TransactionModel::transactionRemoved); QSignalSpy destructionSpy(t, &QObject::destroyed); + + Transaction::Status ret = t->status(); + connect(TransactionModel::global(), &TransactionModel::transactionRemoved, this, [t, &ret] { ret = t->status(); }); while (t && spyInstalled.count() == 0) { - qDebug() << t->status() << t->progress(); + qDebug() << "waiting, currently" << ret << spyInstalled.count() << destructionSpy.count(); spyInstalled.wait(100); } - QVERIFY(destructionSpy.count() || destructionSpy.wait()); + Q_ASSERT(destructionSpy.count() || destructionSpy.wait()); + return ret; } QVector<AbstractResource*> getResources(ResultsStream* stream, bool canBeEmpty = true)
  62. Download patch libdiscover/backends/DummyBackend/tests/DummyTest.cpp

    --- 5.14.5.1-2/libdiscover/backends/DummyBackend/tests/DummyTest.cpp 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/DummyBackend/tests/DummyTest.cpp 2019-11-12 10:10:38.000000000 +0000 @@ -22,7 +22,7 @@ #include "DiscoverBackendsFactory.h" #include <resources/ResourcesUpdatesModel.h> #include <UpdateModel/UpdateModel.h> -#include <tests/modeltest.h> +#include <QAbstractItemModelTester> #include <resources/ResourcesModel.h> #include <resources/ResourcesProxyModel.h> #include <resources/AbstractBackendUpdater.h> @@ -81,7 +81,7 @@ void DummyTest::testReadData() { const auto resources = fetchResources(m_appBackend->search({})); - QCOMPARE(m_appBackend->property("startElements").toInt(), resources.size()); + QCOMPARE(m_appBackend->property("startElements").toInt() * 2, resources.size()); QBENCHMARK { for(AbstractResource* res: resources) { QVERIFY(!res->name().isEmpty()); @@ -102,7 +102,7 @@ void DummyTest::testProxy() QVERIFY(spy.wait()); QVERIFY(!pm.isBusy()); - QCOMPARE(m_appBackend->property("startElements").toInt(), pm.rowCount()); + QCOMPARE(pm.rowCount(), m_appBackend->property("startElements").toInt() * 2); pm.setSearch(QStringLiteral("techie")); QVERIFY(pm.isBusy()); QVERIFY(spy.wait()); @@ -113,7 +113,7 @@ void DummyTest::testProxy() QVERIFY(pm.isBusy()); QVERIFY(spy.wait()); QVERIFY(!pm.isBusy()); - QCOMPARE(m_appBackend->property("startElements").toInt(), pm.rowCount()); + QCOMPARE(pm.rowCount(), m_appBackend->property("startElements").toInt() * 2); } void DummyTest::testProxySorting() @@ -131,7 +131,7 @@ void DummyTest::testProxySorting() QVERIFY(spy.wait()); QVERIFY(!pm.isBusy()); - QCOMPARE(m_appBackend->property("startElements").toInt(), pm.rowCount()); + QCOMPARE(m_appBackend->property("startElements").toInt() * 2, pm.rowCount()); QVariant lastRatingCount; for(int i=0, rc=pm.rowCount(); i<rc; ++i) { const QModelIndex mi = pm.index(i, 0); @@ -145,14 +145,14 @@ void DummyTest::testProxySorting() void DummyTest::testFetch() { const auto resources = fetchResources(m_appBackend->search({})); - QCOMPARE(m_appBackend->property("startElements").toInt(), resources.count()); + QCOMPARE(m_appBackend->property("startElements").toInt()*2, resources.count()); //fetches updates, adds new things m_appBackend->checkForUpdates(); QSignalSpy spy(m_model, SIGNAL(allInitialized())); QVERIFY(spy.wait(80000)); auto resources2 = fetchResources(m_appBackend->search({})); - QCOMPARE(m_appBackend->property("startElements").toInt()*2, resources2.count()); + QCOMPARE(m_appBackend->property("startElements").toInt()*4, resources2.count()); } void DummyTest::testSort() @@ -196,7 +196,7 @@ void DummyTest::testInstallAddons() QVERIFY(res); ApplicationAddonsModel m; - new ModelTest(&m, &m); + new QAbstractItemModelTester(&m, &m); m.setApplication(res); QCOMPARE(m.rowCount(), res->addonsInformation().count()); QCOMPARE(res->addonsInformation().at(0).isInstalled(), false); @@ -236,7 +236,7 @@ void DummyTest::testReviewsModel() QVERIFY(res); ReviewsModel m; - new ModelTest(&m, &m); + new QAbstractItemModelTester(&m, &m); m.setResource(res); m.fetchMore(); @@ -263,12 +263,12 @@ void DummyTest::testUpdateModel() const auto backend = m_model->backends().first(); ResourcesUpdatesModel ruModel; - new ModelTest(&ruModel, &ruModel); + new QAbstractItemModelTester(&ruModel, &ruModel); UpdateModel model; - new ModelTest(&model, &model); + new QAbstractItemModelTester(&model, &model); model.setBackend(&ruModel); - QCOMPARE(model.rowCount(), 4*backend->property("startElements").toInt()/3); + QCOMPARE(model.rowCount(), backend->property("startElements").toInt()*2); QCOMPARE(model.hasUpdates(), true); } @@ -278,7 +278,7 @@ void DummyTest::testScreenshotsModel() filter.resourceUrl = QUrl(QStringLiteral("dummy://Dummy.1")); ScreenshotsModel m; - new ModelTest(&m, &m); + new QAbstractItemModelTester(&m, &m); const auto resources = fetchResources(m_appBackend->search(filter)); QCOMPARE(resources.count(), 1);
  63. Download patch libdiscover/backends/DummyBackend/DummyResource.h

    --- 5.14.5.1-2/libdiscover/backends/DummyBackend/DummyResource.h 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/DummyBackend/DummyResource.h 2019-11-12 10:10:38.000000000 +0000 @@ -28,7 +28,7 @@ class DummyResource : public AbstractRes { Q_OBJECT public: - explicit DummyResource(QString name, bool isTechnical, AbstractResourcesBackend* parent); + explicit DummyResource(QString name, AbstractResource::Type type, AbstractResourcesBackend* parent); QList<PackageState> addonsInformation() override; QString section() override; @@ -36,7 +36,7 @@ public: QString longDescription() override; QString availableVersion() const override; QString installedVersion() const override; - QString license() override; + QJsonArray licenses() override; int size() override; QUrl homepage() override; QUrl helpURL() override; @@ -48,12 +48,13 @@ public: QString comment() override; QString name() const override; QString packageName() const override; - bool isTechnical() const override { return m_isTechnical; } + AbstractResource::Type type() const override { return m_type; } bool canExecute() const override { return true; } void invokeApplication() const override; void fetchChangelog() override; void fetchScreenshots() override; QUrl url() const override; + QString author() const override { return QStringLiteral("BananaPerson"); } void setState(State state); void setSize(int size) { m_size = size; } void setAddons(const AddonList& addons); @@ -63,13 +64,13 @@ public: QDate releaseDate() const override { return {}; } public: - QString m_name; + const QString m_name; AbstractResource::State m_state; QList<QUrl> m_screenshots; QList<QUrl> m_screenshotThumbnails; QString m_iconName; QList<PackageState> m_addons; - bool m_isTechnical; + const AbstractResource::Type m_type; int m_size; };
  64. Download patch debian/plasma-discover-backend-snap.maintscript

    --- 5.14.5.1-2/debian/plasma-discover-backend-snap.maintscript 2019-10-04 08:04:41.000000000 +0000 +++ 5.17.3-0ubuntu1/debian/plasma-discover-backend-snap.maintscript 2019-11-12 17:03:55.000000000 +0000 @@ -1 +1 @@ -rm_conffile /etc/dbus-1/system.d/org.kde.discover.libsnapclient.conf 5.14.5.1-2~~ +rm_conffile /etc/dbus-1/system.d/org.kde.discover.libsnapclient.conf
  65. Download patch libdiscover/backends/FlatpakBackend/CMakeLists.txt

    --- 5.14.5.1-2/libdiscover/backends/FlatpakBackend/CMakeLists.txt 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/FlatpakBackend/CMakeLists.txt 2019-11-12 10:10:38.000000000 +0000 @@ -12,6 +12,10 @@ set(flatpak-backend_SRCS add_library(flatpak-backend MODULE ${flatpak-backend_SRCS}) target_link_libraries(flatpak-backend Qt5::Core Qt5::Widgets Qt5::Concurrent KF5::CoreAddons KF5::ConfigCore Discover::Common AppStreamQt PkgConfig::Flatpak) +if (NOT Flatpak_VERSION VERSION_LESS 1.1.2) + target_compile_definitions(flatpak-backend PRIVATE -DFLATPAK_VERBOSE_PROGRESS) +endif() + install(TARGETS flatpak-backend DESTINATION ${PLUGIN_INSTALL_DIR}/discover) install(FILES flatpak-backend-categories.xml DESTINATION ${DATA_INSTALL_DIR}/libdiscover/categories)
  66. Download patch libdiscover/ApplicationAddonsModel.cpp

    --- 5.14.5.1-2/libdiscover/ApplicationAddonsModel.cpp 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/ApplicationAddonsModel.cpp 2019-11-12 10:10:38.000000000 +0000 @@ -29,7 +29,7 @@ ApplicationAddonsModel::ApplicationAddon : QAbstractListModel(parent) , m_app(nullptr) { -// new ModelTest(this, this); +// new QAbstractItemModelTester(this, this); connect(TransactionModel::global(), &TransactionModel::transactionRemoved, this, &ApplicationAddonsModel::transactionOver); }
  67. Download patch discover/DiscoverDeclarativePlugin.cpp

    --- 5.14.5.1-2/discover/DiscoverDeclarativePlugin.cpp 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/DiscoverDeclarativePlugin.cpp 2019-11-12 10:10:38.000000000 +0000 @@ -29,6 +29,7 @@ #include <resources/ResourcesModel.h> #include <resources/SourcesModel.h> #include <resources/AbstractSourcesBackend.h> +#include <resources/AbstractBackendUpdater.h> #include <resources/ResourcesProxyModel.h> #include <ReviewsBackend/Rating.h> #include <ReviewsBackend/AbstractReviewsBackend.h> @@ -70,6 +71,7 @@ void DiscoverDeclarativePlugin::register qmlRegisterUncreatableType<AbstractSourcesBackend>("org.kde.discover", 2, 0, "AbstractSourcesBackend", QStringLiteral("should come from the SourcesModel")); qmlRegisterUncreatableType<Transaction>("org.kde.discover", 2, 0, "Transaction", QStringLiteral("should come from the backends")); qmlRegisterUncreatableType<SourcesModel>("org.kde.discover", 2, 0, "SourcesModelClass", QStringLiteral("should come from the backends")); + qmlRegisterUncreatableType<SourcesModel>("org.kde.discover", 2, 0, "AbstractBackendUpdater", QStringLiteral("should come from the backends")); qmlRegisterType<Rating>(); qmlRegisterType<AbstractResourcesBackend>(); qmlRegisterType<AbstractReviewsBackend>();
  68. Download patch discover/resources.qrc

    --- 5.14.5.1-2/discover/resources.qrc 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/resources.qrc 2019-11-12 10:10:38.000000000 +0000 @@ -20,12 +20,8 @@ <file>qml/AddSourceDialog.qml</file> <file>qml/ConditionalLoader.qml</file> <file>qml/ConditionalObject.qml</file> - <file>qml/LinkButton.qml</file> - <file>qml/UrlButton.qml</file> <file>qml/ApplicationScreenshots.qml</file> <file>qml/LabelBackground.qml</file> - <file>qml/ActionBridge.qml</file> - <file>qml/KirigamiActionBridge.qml</file> <file>qml/DiscoverPage.qml</file> <file>qml/DiscoverWindow.qml</file> <file>qml/DiscoverDrawer.qml</file> @@ -34,6 +30,7 @@ <file>qml/SearchField.qml</file> <file>qml/Shadow.qml</file> <file>qml/DiscoverPopup.qml</file> + <file>qml/AboutPage.qml</file> <file>qml/navigation.js</file> </qresource>
  69. Download patch discover/discoversettings.kcfg

    --- 5.14.5.1-2/discover/discoversettings.kcfg 1970-01-01 00:00:00.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/discoversettings.kcfg 2019-11-12 10:10:38.000000000 +0000 @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd"> + <kcfgfile arg="true"/> + <group name="DiscoverUI"> + <entry name="appsListPageSorting" type="Int"><default>ResourcesProxyModel::SortableRatingRole</default></entry> + <entry name="installedPageSorting" type="Int"><default>ResourcesProxyModel::NameRole</default></entry> + </group> +</kcfg>
  70. Download patch discover/qml/LinkButton.qml

    --- 5.14.5.1-2/discover/qml/LinkButton.qml 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/qml/LinkButton.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -import QtQuick 2.2 -import org.kde.kirigami 2.0 as Kirigami -import QtQuick.Controls 2.1 as QQC2 - -QQC2.Label { - id: control - - property QtObject action: null //some older Qt versions don't support the namespacing in Kirigami.Action - property alias acceptedButtons: area.acceptedButtons - text: action ? action.text : "" - enabled: !action || action.enabled - onClicked: if (action) action.trigger() - - font: control.font - color: enabled ? Kirigami.Theme.linkColor : Kirigami.Theme.textColor - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - elide: Text.ElideRight - - signal clicked(QtObject mouse) - MouseArea { - id: area - anchors.fill: parent - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - - onContainsMouseChanged: { - control.font.underline = containsMouse && control.enabled - } - - onClicked: control.clicked(mouse) - } -}
  71. Download patch discover/qml/KirigamiActionBridge.qml

    --- 5.14.5.1-2/discover/qml/KirigamiActionBridge.qml 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/qml/KirigamiActionBridge.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -/*************************************************************************** - * Copyright © 2015 Aleix Pol Gonzalez <aleixpol@blue-systems.com> * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License as * - * published by the Free Software Foundation; either version 2 of * - * the License or (at your option) version 3 or any later version * - * accepted by the membership of KDE e.V. (or its successor approved * - * by the membership of KDE e.V.), which shall act as a proxy * - * defined in Section 14 of version 3 of the license. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see <http://www.gnu.org/licenses/>. * - ***************************************************************************/ - -import QtQml 2.0 -import org.kde.kirigami 2.1 as Kirigami - -Kirigami.Action -{ - property QtObject action: null - - function removeAmpersand(text) { - return text.replace("&", ""); - } - text: action ? removeAmpersand(action.text) : "<null>" - checked: action && action.checked - enabled: action && action.enabled - tooltip: action ? action.toolTip : "" - iconName: action ? app.iconName(action.icon) : "" - shortcut: action ? action.shortcut : undefined - - onTriggered: action.trigger() -}
  72. Download patch discover/qml/ApplicationScreenshots.qml

    --- 5.14.5.1-2/discover/qml/ApplicationScreenshots.qml 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/qml/ApplicationScreenshots.qml 2019-11-12 10:10:38.000000000 +0000 @@ -118,7 +118,7 @@ Flickable { delegate: MouseArea { readonly property url imageSource: large_image_url readonly property real proportion: thumbnail.sourceSize.width>1 ? thumbnail.sourceSize.height/thumbnail.sourceSize.width : 1 - width: Math.max(50, height/proportion) + width: Math.min(Math.max(50, height/proportion), thumbnail.status == Image.Loading ? height : thumbnail.sourceSize.width) height: screenshotsLayout.height hoverEnabled: true @@ -152,6 +152,9 @@ Flickable { height: parent.height fillMode: Image.PreserveAspectFit smooth: true + onStatusChanged: if (status === Image.Error) { + screenshotsModel.remove(small_image_url) + } } } }
  73. Download patch libdiscover/appstream/AppStreamUtils.cpp

    --- 5.14.5.1-2/libdiscover/appstream/AppStreamUtils.cpp 1970-01-01 00:00:00.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/appstream/AppStreamUtils.cpp 2019-11-12 10:10:38.000000000 +0000 @@ -0,0 +1,108 @@ +/*************************************************************************** + * Copyright © 2017 Aleix Pol Gonzalez <aleixpol@kde.org> * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License as * + * published by the Free Software Foundation; either version 2 of * + * the License or (at your option) version 3 or any later version * + * accepted by the membership of KDE e.V. (or its successor approved * + * by the membership of KDE e.V.), which shall act as a proxy * + * defined in Section 14 of version 3 of the license. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see <http://www.gnu.org/licenses/>. * + ***************************************************************************/ + +#include "AppStreamUtils.h" + +#include <QJsonArray> +#include <QJsonObject> +#include <QDebug> +#include "utils.h" +#include <KLocalizedString> +#include <AppStreamQt/component.h> +#include <AppStreamQt/release.h> +#include <AppStreamQt/screenshot.h> +#if APPSTREAM_HAS_SPDX +#include <AppStreamQt/spdx.h> +#endif + +using namespace AppStreamUtils; + +QUrl AppStreamUtils::imageOfKind(const QList<AppStream::Image>& images, AppStream::Image::Kind kind) +{ + QUrl ret; + Q_FOREACH (const AppStream::Image &i, images) { + if (i.kind() == kind) { + ret = i.url(); + break; + } + } + return ret; +} + +QString AppStreamUtils::changelogToHtml(const AppStream::Component& appdata) +{ + if(appdata.releases().isEmpty()) + return {}; + + const auto release = appdata.releases().constFirst(); + if (release.description().isEmpty()) + return {}; + + QString changelog = QLatin1String("<h3>") + release.version() + QLatin1String("</h3>") + + QStringLiteral("<p>") + release.description() + QStringLiteral("</p>"); + return changelog; +} + +QPair<QList<QUrl>, QList<QUrl> > AppStreamUtils::fetchScreenshots(const AppStream::Component& appdata) +{ + QList<QUrl> screenshots, thumbnails; + Q_FOREACH (const AppStream::Screenshot &s, appdata.screenshots()) { + const auto images = s.images(); + const QUrl thumbnail = AppStreamUtils::imageOfKind(images, AppStream::Image::KindThumbnail); + const QUrl plain = AppStreamUtils::imageOfKind(images, AppStream::Image::KindSource); + if (plain.isEmpty()) + qWarning() << "invalid screenshot for" << appdata.name(); + + screenshots << plain; + thumbnails << (thumbnail.isEmpty() ? plain : thumbnail); + } + return {screenshots, thumbnails}; +} + +QJsonArray AppStreamUtils::licenses(const AppStream::Component& appdata) +{ +#if APPSTREAM_HAS_SPDX + QJsonArray ret; + const auto licenses = AppStream::SPDX::tokenizeLicense(appdata.projectLicense()); + static const QLatin1String prop ("@LicenseRef-proprietary="); + for (const auto &token : licenses) { + QString license = token; + license.remove(0, 1); //tokenize prefixes with an @ for some reason + if (!AppStream::SPDX::isLicenseId(license)) + continue; +#if APPSTREAM_HAS_SPDX_LICENSEURL + ret.append(QJsonObject{ {QStringLiteral("name"), license}, {QStringLiteral("url"), { AppStream::SPDX::licenseUrl(license) } }}); +#else + if (license.startsWith(prop)) + ret.append(QJsonObject{ {QStringLiteral("name"), i18n("Proprietary")}, {QStringLiteral("url"), license.mid(prop.size())} }); + else + ret.append(QJsonObject{ {QStringLiteral("name"), license}, {QStringLiteral("url"), { QLatin1String("https://spdx.org/licenses/") + AppStream::SPDX::asSpdxId(license) + QLatin1String(".html#licenseText") } }}); +#endif + } + return ret; +#else + return { QJsonObject { {QStringLiteral("name"), appdata.projectLicense() } } }; +#endif +} + +QString AppStreamUtils::appstreamId(const QUrl &appstreamUrl) +{ + return appstreamUrl.host().isEmpty() ? appstreamUrl.path() : appstreamUrl.host(); +}
  74. Download patch debian/plasma-discover-common.install

    --- 5.14.5.1-2/debian/plasma-discover-common.install 2019-10-04 08:04:41.000000000 +0000 +++ 5.17.3-0ubuntu1/debian/plasma-discover-common.install 2019-11-12 17:03:55.000000000 +0000 @@ -1,6 +1,6 @@ -etc/xdg/discover_ktexteditor_codesnippets_core.knsrc usr/share/discover/* usr/share/icons/hicolor/*/apps/plasmadiscover.* +usr/share/knsrcfiles/discover_ktexteditor_codesnippets_core.knsrc usr/share/kxmlgui5/plasmadiscover/* usr/share/libdiscover/categories/packagekit-backend-categories.xml usr/share/locale/*
  75. Download patch libdiscover/appstream/OdrsReviewsBackend.cpp

    --- 5.14.5.1-2/libdiscover/appstream/OdrsReviewsBackend.cpp 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/appstream/OdrsReviewsBackend.cpp 2019-11-12 10:10:38.000000000 +0000 @@ -20,6 +20,8 @@ ***************************************************************************/ #include "OdrsReviewsBackend.h" +#include "AppStreamIntegration.h" +#include "CachedNetworkAccessManager.h" #include <ReviewsBackend/Review.h> #include <ReviewsBackend/Rating.h> @@ -47,10 +49,9 @@ // #define APIURL "http://127.0.0.1:5000/1.0/reviews/api" #define APIURL "https://odrs.gnome.org/1.0/reviews/api" -OdrsReviewsBackend::OdrsReviewsBackend(AbstractResourcesBackend *parent) - : AbstractReviewsBackend(parent) +OdrsReviewsBackend::OdrsReviewsBackend() + : AbstractReviewsBackend(nullptr) , m_isFetching(false) - , m_nam(new QNetworkAccessManager(this)) { bool fetchRatings = false; const QUrl ratingsUrl(QStringLiteral(APIURL "/ratings")); @@ -91,32 +92,7 @@ void OdrsReviewsBackend::ratingsFetched( static QString osName() { - QString osReleaseFilename; - if (QFileInfo::exists(QStringLiteral("/etc/os-release"))) { - osReleaseFilename = QStringLiteral("/etc/os-release"); - } else if (QFileInfo::exists(QStringLiteral("/usr/lib/os-release"))) { - osReleaseFilename = QStringLiteral("/usr/lib/os-release"); - } - - if (osReleaseFilename.isEmpty()) { - return QStringLiteral("Unknown"); - } - - QFile osReleaseFile(osReleaseFilename); - if (osReleaseFile.open(QIODevice::ReadOnly)) { - QString line; - QTextStream stream(&osReleaseFile); - while (stream.readLineInto(&line)) { - if (line.startsWith(QStringLiteral("NAME"))) { - QStringRef name = line.midRef(5).trimmed(); - if (name.startsWith(QLatin1Char('\"')) && name.endsWith(QLatin1Char('\"'))) - name = name.mid(1, name.size()-2); - return name.toString(); - } - } - } - - return QStringLiteral("Unknown"); + return AppStreamIntegration::global()->osRelease()->name(); } static QString userHash() @@ -141,71 +117,41 @@ void OdrsReviewsBackend::fetchReviews(Ab Q_UNUSED(page) m_isFetching = true; - // Check cached reviews - const QString fileName = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QStringLiteral("/reviews/%1.json").arg(app->appstreamId()); - if (QFileInfo::exists(fileName)) { - QFileInfo file(fileName); - // Check if the reviews are not older than a week msecs * secs * hours * days - if (file.lastModified().msecsTo(QDateTime::currentDateTime()) < 1000 * 60 * 60 * 24 * 7 ) { - QFile reviewFile(fileName); - if (reviewFile.open(QIODevice::ReadOnly)) { - QByteArray reviews = reviewFile.readAll(); - QJsonDocument document = QJsonDocument::fromJson(reviews); - parseReviews(document, app); - return; - } - } - } - const QJsonDocument document(QJsonObject{ {QStringLiteral("app_id"), app->appstreamId()}, {QStringLiteral("distro"), osName()}, {QStringLiteral("user_hash"), userHash()}, {QStringLiteral("version"), app->isInstalled() ? app->installedVersion() : app->availableVersion()}, {QStringLiteral("locale"), QLocale::system().name()}, - {QStringLiteral("limit"), 0} + {QStringLiteral("limit"), -1} }); + const auto json = document.toJson(QJsonDocument::Compact); QNetworkRequest request(QUrl(QStringLiteral(APIURL "/fetch"))); request.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("application/json; charset=utf-8")); - request.setHeader(QNetworkRequest::ContentLengthHeader, document.toJson().size()); + request.setHeader(QNetworkRequest::ContentLengthHeader, json.size()); // Store reference to the app for which we request reviews request.setOriginatingObject(app); - auto reply = m_nam->post(request, document.toJson()); + auto reply = nam()->post(request, json); connect(reply, &QNetworkReply::finished, this, &OdrsReviewsBackend::reviewsFetched); } void OdrsReviewsBackend::reviewsFetched() { QNetworkReply* reply = qobject_cast<QNetworkReply*>(sender()); - + QScopedPointer<QNetworkReply, QScopedPointerDeleteLater> replyPtr(reply); + const QByteArray data = reply->readAll(); if (reply->error() != QNetworkReply::NoError) { - qCWarning(LIBDISCOVER_LOG) << "error fetching reviews:" << reply->errorString(); + qCWarning(LIBDISCOVER_LOG) << "error fetching reviews:" << reply->errorString() << data; m_isFetching = false; return; } - QByteArray data = reply->readAll(); const QJsonDocument document = QJsonDocument::fromJson(data); AbstractResource *resource = qobject_cast<AbstractResource*>(reply->request().originatingObject()); Q_ASSERT(resource); parseReviews(document, resource); - - // Store reviews to cache so we don't need to download them all the time - if (document.array().isEmpty()) { - return; - } - - QJsonObject jsonObject = document.array().first().toObject(); - if (jsonObject.isEmpty()) { - return; - } - - QFile file(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QStringLiteral("/reviews/%1.json").arg(jsonObject.value(QStringLiteral("app_id")).toString())); - if (file.open(QIODevice::WriteOnly)) { - file.write(document.toJson()); - } } Rating * OdrsReviewsBackend::ratingForApplication(AbstractResource *app) const @@ -231,7 +177,7 @@ void OdrsReviewsBackend::submitUsefulnes request.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("application/json; charset=utf-8")); request.setHeader(QNetworkRequest::ContentLengthHeader, document.toJson().size()); - auto reply = m_nam->post(request, document.toJson()); + auto reply = nam()->post(request, document.toJson()); connect(reply, &QNetworkReply::finished, this, &OdrsReviewsBackend::usefulnessSubmitted); } @@ -244,6 +190,7 @@ void OdrsReviewsBackend::usefulnessSubmi } else { qCWarning(LIBDISCOVER_LOG) << "Failed to submit usefulness: " << reply->errorString(); } + reply->deleteLater(); } QString OdrsReviewsBackend::userName() const @@ -266,7 +213,7 @@ void OdrsReviewsBackend::submitReview(Ab const QJsonDocument document(map); - QNetworkAccessManager *accessManager = new QNetworkAccessManager(this); + QNetworkAccessManager *accessManager = nam(); QNetworkRequest request(QUrl(QStringLiteral(APIURL "/submit"))); request.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("application/json; charset=utf-8")); request.setHeader(QNetworkRequest::ContentLengthHeader, document.toJson().size()); @@ -295,6 +242,7 @@ void OdrsReviewsBackend::reviewSubmitted } else { qCWarning(LIBDISCOVER_LOG) << "Failed to submit review: " << reply->errorString(); } + reply->deleteLater(); } void OdrsReviewsBackend::parseRatings() @@ -369,3 +317,21 @@ bool OdrsReviewsBackend::isResourceSuppo { return !res->appstreamId().isEmpty(); } + +void OdrsReviewsBackend::emitRatingFetched(AbstractResourcesBackend* b, const QList<AbstractResource *>& resources) const +{ + b->emitRatingsReady(); + foreach(AbstractResource* res, resources) { + if (m_ratings.contains(res->appstreamId())) { + Q_EMIT res->ratingFetched(); + } + } +} + +QNetworkAccessManager * OdrsReviewsBackend::nam() +{ + if (!m_delayedNam) { + m_delayedNam = new CachedNetworkAccessManager(QStringLiteral("odrs"), this); + } + return m_delayedNam; +}
  76. Download patch libdiscover/backends/FlatpakBackend/org.kde.discover-flatpak.desktop

    --- 5.14.5.1-2/libdiscover/backends/FlatpakBackend/org.kde.discover-flatpak.desktop 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/FlatpakBackend/org.kde.discover-flatpak.desktop 2019-11-12 10:10:38.000000000 +0000 @@ -1,9 +1,9 @@ [Desktop Entry] Name=Discover Name[ar]=استكشف -Name[ast]=Discover Name[ca]=Discover Name[ca@valencia]=Discover +Name[cs]=Discover Name[da]=Discover Name[de]=Discover Name[el]=Discover @@ -19,7 +19,9 @@ Name[hu]=Discover Name[ia]=Discoperi Name[id]=Discover Name[it]=Discover -Name[ko]=발견 +Name[ko]=둘러보기 +Name[lt]=Discover +Name[ml]=കണ്ടെത്തുക Name[nl]=Ontdekken Name[nn]=Discover Name[pa]=ਖੋਜ @@ -27,17 +29,18 @@ Name[pl]=Odkrywca Name[pt]=Discover Name[pt_BR]=Discover Name[ru]=Discover -Name[sk]=Objaviť +Name[sk]=Discover Name[sl]=Discover Name[sr]=Oткривач Name[sr@ijekavian]=Oткривач Name[sr@ijekavianlatin]=Otkrivač Name[sr@latin]=Otkrivač Name[sv]=Upptäck +Name[tg]=Кашфиёт Name[tr]=Keşfet Name[uk]=Discover Name[x-test]=xxDiscoverxx -Name[zh_CN]=发现 +Name[zh_CN]=Discover Name[zh_TW]=Discover Exec=plasma-discover %U Icon=plasmadiscover
  77. Download patch libdiscover/backends/FlatpakBackend/FlatpakSourcesBackend.h

    --- 5.14.5.1-2/libdiscover/backends/FlatpakBackend/FlatpakSourcesBackend.h 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/FlatpakBackend/FlatpakSourcesBackend.h 2019-11-12 10:10:38.000000000 +0000 @@ -50,6 +50,7 @@ public: bool moveSource(const QString & sourceId, int delta) override; int originIndex(const QString& sourceId) const; + QStandardItem* sourceByUrl(const QString & url) const; private: QStandardItem* sourceById(const QString & sourceId) const;
  78. Download patch libdiscover/ActionsModel.h

    --- 5.14.5.1-2/libdiscover/ActionsModel.h 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/ActionsModel.h 2019-11-12 10:10:38.000000000 +0000 @@ -31,7 +31,7 @@ class DISCOVERCOMMON_EXPORT ActionsModel { Q_OBJECT Q_PROPERTY(QVariant actions READ actions WRITE setActions NOTIFY actionsChanged) - Q_PROPERTY(int filterPriority READ filterPriority WRITE setFilterPriority) + Q_PROPERTY(int filterPriority READ filterPriority WRITE setFilterPriority NOTIFY filterPriorityChanged) public: explicit ActionsModel(QObject* parent = nullptr); @@ -47,6 +47,7 @@ class DISCOVERCOMMON_EXPORT ActionsModel Q_SIGNALS: void actionsChanged(const QVariant& actions); + void filterPriorityChanged(); private: void reload();
  79. Download patch debian/plasma-discover.maintscript

    --- 5.14.5.1-2/debian/plasma-discover.maintscript 2019-10-04 08:04:41.000000000 +0000 +++ 5.17.3-0ubuntu1/debian/plasma-discover.maintscript 2019-11-12 17:03:55.000000000 +0000 @@ -1 +1,2 @@ rm_conffile /etc/apt/apt.conf.d/60plasma-discover 5.12.4-1 +rm_conffile /etc/xdg/discover.categories
  80. Download patch discover/DiscoverObject.cpp
  81. Download patch discover/qml/ReviewDelegate.qml

    --- 5.14.5.1-2/discover/qml/ReviewDelegate.qml 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/qml/ReviewDelegate.qml 2019-11-12 10:10:38.000000000 +0000 @@ -33,7 +33,7 @@ ColumnLayout function usefulnessToString(favorable, total) { - return total==0 + return total===0 ? i18n("<em>Tell us about this review!</em>") : i18n("<em>%1 out of %2 people found this review useful</em>", favorable, total) }
  82. Download patch discover/qml/ProgressView.qml

    --- 5.14.5.1-2/discover/qml/ProgressView.qml 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/qml/ProgressView.qml 2019-11-12 10:10:38.000000000 +0000 @@ -5,22 +5,23 @@ import org.kde.discover 2.0 import org.kde.kirigami 2.0 as Kirigami import "navigation.js" as Navigation -Kirigami.BasicListItem { +Kirigami.AbstractListItem { id: listItem - label: TransactionModel.count ? i18n("Tasks (%1%)", TransactionModel.progress) : i18n("Tasks") - visible: TransactionModel.count > 0 - - background: Item { - Rectangle { - anchors { - fill: parent - rightMargin: TransactionModel.count>=1 ? listItem.width*(1-TransactionModel.progress/100) : 0 - } - color: TransactionModel.count>=1 || listItem.hovered || listItem.highlighted || listItem.pressed || listItem.checked ? listItem.activeBackgroundColor : listItem.backgroundColor - opacity: listItem.hovered || listItem.highlighted ? 0.2 : 1 + contentItem: ColumnLayout { + Label { + id: label + Layout.fillWidth: true + Layout.leftMargin: Kirigami.Units.iconSizes.smallMedium + (LayoutMirroring.enabled ? listItem.rightPadding : listItem.leftPadding) + Layout.rightMargin: Layout.leftMargin + text: TransactionModel.count ? i18n("Tasks (%1%)", TransactionModel.progress) : i18n("Tasks") + } + ProgressBar { + Layout.fillWidth: true + value: TransactionModel.progress/100 } } + visible: TransactionModel.count > 0 property QtObject sheetObject: null onClicked: { @@ -84,7 +85,7 @@ Kirigami.BasicListItem { } ToolButton { icon.name: "system-run" - visible: model.application != undefined && model.application.isInstalled && !listener.isActive && model.application.canExecute + visible: model.application !== undefined && model.application.isInstalled && !listener.isActive && model.application.canExecute onClicked: { model.application.invokeApplication() model.remove(index)
  83. Download patch libdiscover/backends/FlatpakBackend/FlatpakNotifier.h

    --- 5.14.5.1-2/libdiscover/backends/FlatpakBackend/FlatpakNotifier.h 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/FlatpakBackend/FlatpakNotifier.h 2019-11-12 10:10:38.000000000 +0000 @@ -36,26 +36,26 @@ public: explicit FlatpakNotifier(QObject* parent = nullptr); ~FlatpakNotifier() override; + bool hasUpdates() override; + bool hasSecurityUpdates() override { return false; } void recheckSystemUpdateNeeded() override; - uint securityUpdatesCount() override; - uint updatesCount() override; bool needsReboot() const override { return false; } -public Q_SLOTS: - void checkUpdates(); - void onFetchUpdatesFinished(FlatpakInstallation *flatpakInstallation, GPtrArray *updates); - private: + void onFetchUpdatesFinished(FlatpakInstallation *flatpakInstallation, GPtrArray *updates); void loadRemoteUpdates(FlatpakInstallation *flatpakInstallation); bool setupFlatpakInstallations(GError **error); - uint m_userInstallationUpdates; - uint m_systemInstallationUpdates; - GCancellable *m_cancellable; - GFileMonitor *m_userInstallationMonitor = nullptr; - GFileMonitor *m_systemInstallationMonitor = nullptr; - FlatpakInstallation *m_flatpakInstallationUser = nullptr; - FlatpakInstallation *m_flatpakInstallationSystem = nullptr; + struct Installation { + ~Installation(); + + bool m_hasUpdates = false; + GFileMonitor *m_monitor = nullptr; + FlatpakInstallation *m_installation = nullptr; + }; + Installation m_user; + Installation m_system; + GCancellable * const m_cancellable; }; #endif
  84. Download patch discover/qml/UrlButton.qml

    --- 5.14.5.1-2/discover/qml/UrlButton.qml 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/qml/UrlButton.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -import QtQuick 2.2 -import org.kde.kirigami 2.0 as Kirigami -import QtQuick.Controls 2.1 as QQC2 - -LinkButton -{ - id: button - property string url - text: url - visible: text.length>0 - - acceptedButtons: Qt.LeftButton | Qt.RightButton - onClicked: { - if (mouse.button === Qt.RightButton) - menu.popup() - else - Qt.openUrlExternally(url) - } - - QQC2.Menu { - id: menu - QQC2.MenuItem { - text: i18n("Copy link address") - onClicked: app.copyTextToClipboard(button.url) - } - } -}
  85. Download patch libdiscover/backends/DummyBackend/DummyBackend.cpp

    --- 5.14.5.1-2/libdiscover/backends/DummyBackend/DummyBackend.cpp 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/DummyBackend/DummyBackend.cpp 2019-11-12 10:10:38.000000000 +0000 @@ -62,7 +62,7 @@ void DummyBackend::populate(const QStrin const int start = m_resources.count(); for(int i=start; i<start+m_startElements; i++) { const QString name = n+QLatin1Char(' ')+QString::number(i); - DummyResource* res = new DummyResource(name, false, this); + DummyResource* res = new DummyResource(name, AbstractResource::Application, this); res->setSize(100+(m_startElements-i)); res->setState(AbstractResource::State(1+(i%3))); m_resources.insert(name.toLower(), res); @@ -70,8 +70,17 @@ void DummyBackend::populate(const QStrin } for(int i=start; i<start+m_startElements; i++) { - const QString name = QStringLiteral("techie")+QString::number(i); - DummyResource* res = new DummyResource(name, true, this); + const QString name = QLatin1String("addon")+QString::number(i); + DummyResource* res = new DummyResource(name, AbstractResource::Addon, this); + res->setState(AbstractResource::State(1+(i%3))); + res->setSize(300+(m_startElements-i)); + m_resources.insert(name, res); + connect(res, &DummyResource::stateChanged, this, &DummyBackend::updatesCountChanged); + } + + for(int i=start; i<start+m_startElements; i++) { + const QString name = QLatin1String("techie")+QString::number(i); + DummyResource* res = new DummyResource(name, AbstractResource::Technical, this); res->setState(AbstractResource::State(1+(i%3))); res->setSize(300+(m_startElements-i)); m_resources.insert(name, res); @@ -99,7 +108,7 @@ ResultsStream* DummyBackend::search(cons if (!filter.resourceUrl.isEmpty()) return findResourceByPackageName(filter.resourceUrl); else foreach(AbstractResource* r, m_resources) { - if (r->isTechnical() && filter.state != AbstractResource::Upgradeable) { + if (r->type() == AbstractResource::Technical && filter.state != AbstractResource::Upgradeable) { continue; } @@ -114,6 +123,15 @@ ResultsStream* DummyBackend::search(cons ResultsStream * DummyBackend::findResourceByPackageName(const QUrl& search) { + if(search.isLocalFile()) { + DummyResource* res = new DummyResource(search.fileName(), AbstractResource::Technical, this); + res->setSize(666); + res->setState(AbstractResource::None); + m_resources.insert(res->packageName(), res); + connect(res, &DummyResource::stateChanged, this, &DummyBackend::updatesCountChanged); + return new ResultsStream(QStringLiteral("DummyStream-local"), { res }); + } + auto res = search.scheme() == QLatin1String("dummy") ? m_resources.value(search.host().replace(QLatin1Char('.'), QLatin1Char(' '))) : nullptr; if (!res) { return new ResultsStream(QStringLiteral("DummyStream"), {}); @@ -156,16 +174,6 @@ void DummyBackend::checkForUpdates() qDebug() << "DummyBackend::checkForUpdates"; } -AbstractResource * DummyBackend::resourceForFile(const QUrl& path) -{ - DummyResource* res = new DummyResource(path.fileName(), true, this); - res->setSize(666); - res->setState(AbstractResource::None); - m_resources.insert(res->packageName(), res); - connect(res, &DummyResource::stateChanged, this, &DummyBackend::updatesCountChanged); - return res; -} - QString DummyBackend::displayName() const { return QStringLiteral("Dummy");
  86. Download patch discover/qml/SourcesPage.qml
  87. Download patch discover/org.kde.discover.desktop.cmake

    --- 5.14.5.1-2/discover/org.kde.discover.desktop.cmake 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/org.kde.discover.desktop.cmake 2019-11-12 10:10:38.000000000 +0000 @@ -1,9 +1,9 @@ [Desktop Entry] Name=Discover Name[ar]=استكشف -Name[ast]=Discover Name[ca]=Discover Name[ca@valencia]=Discover +Name[cs]=Discover Name[da]=Discover Name[de]=Discover Name[el]=Discover @@ -19,7 +19,9 @@ Name[hu]=Discover Name[ia]=Discoperi Name[id]=Discover Name[it]=Discover -Name[ko]=발견 +Name[ko]=둘러보기 +Name[lt]=Discover +Name[ml]=കണ്ടെത്തുക Name[nl]=Ontdekken Name[nn]=Discover Name[pa]=ਖੋਜ @@ -27,17 +29,18 @@ Name[pl]=Odkrywca Name[pt]=Discover Name[pt_BR]=Discover Name[ru]=Discover -Name[sk]=Objaviť +Name[sk]=Discover Name[sl]=Discover Name[sr]=Oткривач Name[sr@ijekavian]=Oткривач Name[sr@ijekavianlatin]=Otkrivač Name[sr@latin]=Otkrivač Name[sv]=Upptäck +Name[tg]=Кашфиёт Name[tr]=Keşfet Name[uk]=Discover Name[x-test]=xxDiscoverxx -Name[zh_CN]=发现 +Name[zh_CN]=Discover Name[zh_TW]=Discover MimeType=@DesktopMimeType@ Exec=@DesktopExec@ @@ -67,6 +70,8 @@ GenericName[hu]=Szoftverközpont GenericName[id]=Pusat Perangkat Lunak GenericName[it]=Software Center GenericName[ko]=소프트웨어 센터 +GenericName[lt]=Programinės įrangos centras +GenericName[ml]=സോഫ്റ്റ്വെയർ സെന്റർ GenericName[nb]=Programvaresenter GenericName[nl]=Softwarecentrum GenericName[nn]=Programvaresenter @@ -82,6 +87,7 @@ GenericName[sr@ijekavian]=Софтвер GenericName[sr@ijekavianlatin]=Softverski centar GenericName[sr@latin]=Softverski centar GenericName[sv]=Programvarucentral +GenericName[tg]=Маркази нармафзор GenericName[tr]=Yazılım Merkezi GenericName[uk]=Центр програм GenericName[x-test]=xxSoftware Centerxx @@ -102,12 +108,13 @@ Keywords[et]=programm,rakendus,tarkvara, Keywords[eu]=programa;software;gordetegi;pakete;instalatu;kendu;eguneratu;appak;aplikazioak; Keywords[fi]=program;software;repository;package;install;remove;update;apps;applications;ohjelma;ohjelmisto;ohjelmalähde;lähteet;arkisto;paketti;asenna;poista;päivitä;sovellukset; Keywords[fr]=programme; logiciel;dépôt;archive;paquet;installation;suppression;mise à jour;deb; -Keywords[gl]=aplicativo;software;repositorio;paquete;instalar;desinstalar;actualizar;deb; +Keywords[gl]=aplicación;software;repositorio;paquete;instalar;desinstalar;actualizar;deb; Keywords[he]=program;software;repository;package;install;remove;update;apps;applications;תוכנות;התקנה;הסרה;חבילה;מקורות;יישומים; Keywords[hu]=program;szoftver;tároló;csomag;telepítés;eltávolítás;frissítés;alkalmazás;alkalmazások; -Keywords[id]=program;perangkat lunak;repositori;paket;pasang;copot;perbarui;apl;aplikasi; +Keywords[id]=program;perangkat lunak;repositori;paket;pasang;hapus;perbarui;apl;aplikasi; Keywords[it]=programma;software;deposito;pacchetto;installa;rimuovi;aggiorna;app;applicazioni; -Keywords[ko]=program;software;repository;archive;package;install;remove;update;deb;프로그램;소프트웨어;저장소;리포지토리;패키지;꾸러미;설치;삭제;업데이트; +Keywords[ko]=프로그램;software;repository;archive;package;install;remove;update;deb;프로그램;소프트웨어;저장소;리포지토리;패키지;꾸러미;설치;삭제;업데이트; +Keywords[lt]=programa;programinė įranga;saugykla;paketas;įdiegti;diegti;šalinti;ištrinti;naujinti;atnaujinti;programos; Keywords[nb]=program;programvare;pakkebrønn;pakke;installere;fjerne;oppdatere;app;apper; Keywords[nl]=programma;software;opslagruimte;pakket;installeren;verwijderen;bijwerken;apps;toepassingen;applicaties; Keywords[nn]=program;programvare;pakkebrønn;pakke;pakkar;installera;installering;fjerna;fjerning;oppdatera;oppdatering;app;appar;applikasjonar; @@ -122,10 +129,11 @@ Keywords[sr@ijekavian]=program;software; Keywords[sr@ijekavianlatin]=program;software;repository;package;install;remove;update;apps;applications;program;softver;riznica;paket;instalirati;ukloniti;ažurirati; Keywords[sr@latin]=program;software;repository;package;install;remove;update;apps;applications;program;softver;riznica;paket;instalirati;ukloniti;ažurirati; Keywords[sv]=program;programvara;arkiv;paket;installera;ta bort;uppdatera;appar;program; +Keywords[tg]=барнома;нармафзор;анбори додаҳо;баста;насб;тоза;навсозӣ;барномаҳо;зербарномаҳо; Keywords[tr]=program;yazılım;depo;paket;yükle;kur;kaldır;güncelle;uygulama;uygulamalar; Keywords[uk]=program;software;repository;package;install;remove;update;app;apps;applications;програма;програмне забезпечення;сховище;архів;пакунок;встановити;встановлення;вилучити;вилучення;оновлення;оновити; Keywords[x-test]=xxprogramxx;xxsoftwarexx;xxrepositoryxx;xxpackagexx;xxinstallxx;xxremovexx;xxupdatexx;xxappsxx;xxapplicationsxx; -Keywords[zh_CN]=program;software;repository;package;install;remove;update;apps;applications;程序;软件;软件源;包;安装;移除;更新;应用程序;应用; +Keywords[zh_CN]=程序;软件;软件源;包;安装;移除;更新;应用程序;应用; Keywords[zh_TW]=program;software;repository;package;install;remove;update;apps;applications; [Desktop Action Updates] @@ -147,9 +155,12 @@ Name[gl]=Actualizacións Name[he]=עדכונים Name[hu]=Frissítések Name[ia]=Actualisationes -Name[id]=Update +Name[id]=Pembaruan Name[it]=Aggiornamenti +Name[ja]=更新 Name[ko]=업데이트 +Name[lt]=Atnaujinimai +Name[ml]=അപ്ഡേറ്റുകൾ Name[nb]=Oppdateringer Name[nl]=Elementen voor bijwerken Name[nn]=Oppdateringar @@ -165,6 +176,7 @@ Name[sr@ijekavian]=Допуне Name[sr@ijekavianlatin]=Dopune Name[sr@latin]=Dopune Name[sv]=Uppdateringar +Name[tg]=Навсозиҳо Name[tr]=Güncellemeler Name[uk]=Оновлення Name[x-test]=xxUpdatesxx
  88. Download patch discover/autotests/updateandinstall.qml

    --- 5.14.5.1-2/discover/autotests/updateandinstall.qml 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/autotests/updateandinstall.qml 2019-11-12 10:10:38.000000000 +0000 @@ -11,10 +11,10 @@ DiscoverTest var updatePage = appRoot.stack.currentItem; compare(typeName(updatePage), "UpdatesPage") compare(updatePage.state, "has-updates", "to update") - var action = updatePage.currentAction + var action = updatePage.actions.main verify(action); action.triggered(null); - compare(updatePage.state, "has-updates", "updating") + compare(updatePage.state, "progressing", "updating") } {//we start installing a resource @@ -32,14 +32,10 @@ DiscoverTest { var updatePage = appRoot.stack.currentItem; compare(typeName(updatePage), "UpdatesPage") - while(updatePage.state === "fetching") + while(updatePage.state === "fetching" || updatePage.state === "progressing") { waitForSignal(updatePage, "stateChanged") + } compare(updatePage.state, "now-uptodate", "to update") - var action = updatePage.currentAction - verify(!action.visible) } - - while(updatePage.state != "now-uptodate") - waitForSignal(updatePage, "stateChanged") } }
  89. Download patch libdiscover/backends/FlatpakBackend/FlatpakResource.cpp

    --- 5.14.5.1-2/libdiscover/backends/FlatpakBackend/FlatpakResource.cpp 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/FlatpakBackend/FlatpakResource.cpp 2019-11-12 10:10:38.000000000 +0000 @@ -21,6 +21,7 @@ #include "FlatpakResource.h" #include "FlatpakBackend.h" +#include "config-paths.h" #include <Transaction/AddonList.h> @@ -31,6 +32,7 @@ #include <KFormat> #include <KLocalizedString> +#include <QProcess> #include <QDir> #include <QDebug> #include <QDesktopServices> @@ -46,7 +48,7 @@ static QString iconCachePath(const AppStream::Icon &icon) { Q_ASSERT(icon.kind() == AppStream::Icon::KindRemote); - return QStringLiteral("%1/icons/%2").arg(QStandardPaths::writableLocation(QStandardPaths::CacheLocation)).arg(icon.url().fileName()); + return QStringLiteral("%1/icons/%2").arg(QStandardPaths::writableLocation(QStandardPaths::CacheLocation), icon.url().fileName()); } FlatpakResource::FlatpakResource(const AppStream::Component &component, FlatpakInstallation* installation, FlatpakBackend *parent) @@ -71,7 +73,7 @@ FlatpakResource::FlatpakResource(const A // Create $HOME/.cache/discover/icons folder cacheDir.mkdir(QStringLiteral("icons")); QNetworkAccessManager *manager = new QNetworkAccessManager(this); - connect(manager, &QNetworkAccessManager::finished, [this, icon, fileName, manager] (QNetworkReply *reply) { + connect(manager, &QNetworkAccessManager::finished, this, [this, icon, fileName, manager] (QNetworkReply *reply) { if (reply->error() == QNetworkReply::NoError) { QByteArray iconData = reply->readAll(); QFile file(fileName); @@ -141,10 +143,17 @@ void FlatpakResource::updateFromRef(Flat setBranch(QString::fromUtf8(flatpak_ref_get_branch(ref))); setCommit(QString::fromUtf8(flatpak_ref_get_commit(ref))); setFlatpakName(QString::fromUtf8(flatpak_ref_get_name(ref))); - setType(flatpak_ref_get_kind(ref) == FLATPAK_REF_KIND_APP ? FlatpakResource::DesktopApp : FlatpakResource::Runtime); + setType(flatpak_ref_get_kind(ref) == FLATPAK_REF_KIND_APP ? DesktopApp : + extends().isEmpty() ? Runtime + : Extension); setObjectName(packageName()); } +QString FlatpakResource::ref() const +{ + return typeAsString() + QLatin1Char('/') + flatpakName() + QLatin1Char('/') + arch() + QLatin1Char('/') + branch(); +} + QStringList FlatpakResource::categories() { auto cats = m_appdata.categories(); @@ -237,9 +246,16 @@ int FlatpakResource::installedSize() con return m_installedSize; } -bool FlatpakResource::isTechnical() const +AbstractResource::Type FlatpakResource::type() const { - return m_id.type == FlatpakResource::Runtime; + switch (m_id.type) { + case FlatpakResource::Runtime: + return Technical; + case FlatpakResource::Extension: + return Addon; + default: + return Application; + } } QUrl FlatpakResource::homepage() @@ -278,9 +294,9 @@ QString FlatpakResource::flatpakName() c return m_flatpakName; } -QString FlatpakResource::license() +QJsonArray FlatpakResource::licenses() { - return m_appdata.projectLicense(); + return AppStreamUtils::licenses(m_appdata); } QString FlatpakResource::longDescription() @@ -368,7 +384,7 @@ AbstractResource::State FlatpakResource: return m_state; } -FlatpakResource::ResourceType FlatpakResource::type() const +FlatpakResource::ResourceType FlatpakResource::resourceType() const { return m_id.type; } @@ -376,11 +392,11 @@ FlatpakResource::ResourceType FlatpakRes QString FlatpakResource::typeAsString() const { switch (m_id.type) { - case FlatpakResource::DesktopApp: - case FlatpakResource::Source: - return QLatin1String("app"); case FlatpakResource::Runtime: + case FlatpakResource::Extension: return QLatin1String("runtime"); + case FlatpakResource::DesktopApp: + case FlatpakResource::Source: default: return QLatin1String("app"); } @@ -393,6 +409,13 @@ FlatpakResource::Id FlatpakResource::uni void FlatpakResource::invokeApplication() const { + const QString desktopFile = installPath() + QLatin1String("/export/share/applications/") + appstreamId(); + const QString runservice = QStringLiteral(CMAKE_INSTALL_FULL_LIBEXECDIR_KF5 "/discover/runservice"); + if (QFile::exists(desktopFile) && QFile::exists(runservice)) { + QProcess::startDetached(runservice, {desktopFile}); + return; + } + g_autoptr(GCancellable) cancellable = g_cancellable_new(); g_autoptr(GError) localError = nullptr; @@ -524,6 +547,11 @@ QString FlatpakResource::installationPat return QString::fromUtf8(g_file_get_path(path)); } +QString FlatpakResource::installPath() const +{ + return installationPath() + QStringLiteral("/app/%1/%2/%3/active").arg(flatpakName(), arch(), branch()); +} + QUrl FlatpakResource::url() const { return m_resourceFile.isEmpty() ? QUrl(QStringLiteral("appstream://") + appstreamId()) : m_resourceFile; @@ -543,3 +571,13 @@ QString FlatpakResource::sourceIcon() co { return QStringLiteral("flatpak-discover"); } + + QString FlatpakResource::author() const +{ + return m_appdata.developerName(); +} + +QStringList FlatpakResource::extends() const +{ + return m_appdata.extends(); +}
  90. Download patch discover/qml/AboutPage.qml

    --- 5.14.5.1-2/discover/qml/AboutPage.qml 1970-01-01 00:00:00.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/qml/AboutPage.qml 2019-11-12 10:10:38.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2018 Aleix Pol Gonzalez <aleixpol@blue-systems.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library/Lesser General Public License + * version 2, or (at your option) any later version, as published by the + * Free Software Foundation + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library/Lesser General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQml 2.1 +import org.kde.kirigami 2.6 as Kirigami + +Kirigami.AboutPage +{ + actions.main: Kirigami.Action { + function removeAmpersand(text) { + return text.replace("&", ""); + } + + readonly property QtObject action: app.action("help_report_bug") + text: removeAmpersand(action.text) + enabled: action.enabled + onTriggered: action.trigger() + icon.name: app.iconName(action.icon) + } + + aboutData: discoverAboutData +}
  91. Download patch discover/PaginateModel.h

    --- 5.14.5.1-2/discover/PaginateModel.h 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/PaginateModel.h 2019-11-12 10:10:38.000000000 +0000 @@ -33,14 +33,23 @@ class PaginateModel : public QAbstractListModel { Q_OBJECT + /** Holds the number of elements that will fit in a page */ Q_PROPERTY(int pageSize READ pageSize WRITE setPageSize NOTIFY pageSizeChanged) + + /** Tells what is the first row shown in the model */ Q_PROPERTY(int firstItem READ firstItem WRITE setFirstItem NOTIFY firstItemChanged) + + /** The model we will be proxying */ Q_PROPERTY(QAbstractItemModel* sourceModel READ sourceModel WRITE setSourceModel NOTIFY sourceModelChanged) + + /** Among the totality of elements, indicates the one we're currently offering */ Q_PROPERTY(int currentPage READ currentPage NOTIFY firstItemChanged) + + /** Provides the number of pages available, given the sourceModel size */ Q_PROPERTY(int pageCount READ pageCount NOTIFY pageCountChanged) /** If enabled, ensures that pageCount and pageSize are the same. */ - Q_PROPERTY(bool staticRowCount READ hasStaticRowCount WRITE setStaticRowCount) + Q_PROPERTY(bool staticRowCount READ hasStaticRowCount WRITE setStaticRowCount NOTIFY staticRowCountChanged) public: explicit PaginateModel(QObject* object = nullptr); @@ -74,9 +83,16 @@ class PaginateModel : public QAbstractLi void setStaticRowCount(bool src); bool hasStaticRowCount() const; + /** Display the first rows of the model */ Q_SCRIPTABLE void firstPage(); + + /** Display the rows right after the ones that are currently being served */ Q_SCRIPTABLE void nextPage(); + + /** Display the rows right before the ones that are currently being served */ Q_SCRIPTABLE void previousPage(); + + /** Display the last set of rows of the source model */ Q_SCRIPTABLE void lastPage(); private Q_SLOTS: @@ -105,16 +121,15 @@ class PaginateModel : public QAbstractLi void firstItemChanged(); void sourceModelChanged(); void pageCountChanged(); + void staticRowCountChanged(); private: bool canSizeChange() const; bool isIntervalValid(const QModelIndex& parent, int start, int end) const; - int rowsByPageSize(int size) const; - int m_firstItem; - int m_pageSize; - QAbstractItemModel* m_sourceModel; - bool m_hasStaticRowCount; + + class PaginateModelPrivate; + QScopedPointer<PaginateModelPrivate> d; }; #endif
  92. Download patch libdiscover/backends/FlatpakBackend/org.kde.discover.flatpak.appdata.xml

    --- 5.14.5.1-2/libdiscover/backends/FlatpakBackend/org.kde.discover.flatpak.appdata.xml 2019-02-13 13:39:58.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/FlatpakBackend/org.kde.discover.flatpak.appdata.xml 2019-11-12 10:10:38.000000000 +0000 @@ -4,8 +4,9 @@ <name>Flatpak backend</name> <name xml:lang="ar">سَند فلاتپاك</name> <name xml:lang="ca">Dorsal del Flatpak</name> - <name xml:lang="ca-valencia">Dorsal del Flatpak</name> + <name xml:lang="ca-valencia">Dorsal de Flatpak</name> <name xml:lang="cs">Podpůrná vrstva Flatpak</name> + <name xml:lang="da">Flatpak-motor</name> <name xml:lang="de">Flatpak-Backend</name> <name xml:lang="en-GB">Flatpak backend</name> <name xml:lang="es">Motor Flatpak</name> @@ -16,9 +17,11 @@ <name xml:lang="id">Backend Flatpak</name> <name xml:lang="it">Motore Flatpak</name> <name xml:lang="ko">Flatpak 백엔드</name> + <name xml:lang="lt">Flatpak vidinė pusė</name> <name xml:lang="nb">Flatpak-motor</name> <name xml:lang="nl">Flatpak-backend</name> <name xml:lang="nn">Flatpak-motor</name> + <name xml:lang="pa">ਫਲੈਟਪੈਕ ਬੈਕਐਡ</name> <name xml:lang="pl">Silnik Flatpak</name> <name xml:lang="pt">Infra-estrutura do Flatpak</name> <name xml:lang="pt-BR">Infraestrutura Flatpak</name> @@ -33,17 +36,19 @@ <summary>Integrates Flatpak applications into Discover</summary> <summary xml:lang="ar">يُكامل تطبيقات ”فلاتپاك“ في «استكشف»</summary> <summary xml:lang="ca">Integra aplicacions del Flatpak al Discover</summary> - <summary xml:lang="ca-valencia">Integra aplicacions del Flatpak al Discover</summary> + <summary xml:lang="ca-valencia">Integra aplicacions de Flatpak a Discover</summary> + <summary xml:lang="da">Integrerer Flatpak-programmer i Discover</summary> <summary xml:lang="de">Integriert Flatpak-Anwendungen in Discover</summary> <summary xml:lang="en-GB">Integrates Flatpak applications into Discover</summary> <summary xml:lang="es">Integra aplicaciones Flatpak en Discover</summary> <summary xml:lang="eu">Flatpak aplikazioak Discover-ren integratzen ditu</summary> <summary xml:lang="fi">Yhdistää Flatpak-sovellukset Discoveriin</summary> <summary xml:lang="fr">Intègre les applications Flatpak au sein de Discover</summary> - <summary xml:lang="gl">Integra aplicativos de Flatpak con Discover</summary> + <summary xml:lang="gl">Integra aplicacións de Flatpak con Discover</summary> <summary xml:lang="id">Aplikasi Flatpak terintegrasi ke dalam Discover</summary> <summary xml:lang="it">Integra le applicazioni Flatpak in Discover</summary> - <summary xml:lang="ko">Flatpak 프로그램을 발견에 통합</summary> + <summary xml:lang="ko">Flatpak 프로그램을 살펴보기에 통합</summary> + <summary xml:lang="lt">Integruoja Flatpak programas į Discover</summary> <summary xml:lang="nb">Integrerer Flatpak-programmer i Discover</summary> <summary xml:lang="nl">Integreert Flatpak-toepassingen in Discover</summary> <summary xml:lang="nn">Integrerer Flatpak-program i Discover</summary> @@ -56,14 +61,13 @@ <summary xml:lang="sv">Integrerar Flatpak-program i Discover</summary> <summary xml:lang="uk">Інтеграція програм Flatpak з Discover</summary> <summary xml:lang="x-test">xxIntegrates Flatpak applications into Discoverxx</summary> - <summary xml:lang="zh-CN">将 Flatpak 应用程序集成到发现者中</summary> + <summary xml:lang="zh-CN">将 Flatpak 应用程序集成到Discover中</summary> <summary xml:lang="zh-TW">將 Flatpak 應用程式整合進 Discover 商店</summary> <extends>org.kde.discover.desktop</extends> <metadata_license>CC0-1.0</metadata_license> <project_license>GPL-2.0+</project_license> <developer_name>Aleix Pol Gonzalez</developer_name> <developer_name xml:lang="ar">Aleix Pol Gonzalez</developer_name> - <developer_name xml:lang="ast">Aleix Pol González</developer_name> <developer_name xml:lang="ca">Aleix Pol Gonzalez</developer_name> <developer_name xml:lang="ca-valencia">Aleix Pol Gonzalez</developer_name> <developer_name xml:lang="cs">Aleix Pol Gonzalez</developer_name> @@ -78,6 +82,7 @@ <developer_name xml:lang="id">Aleix Pol Gonzalez</developer_name> <developer_name xml:lang="it">Aleix Pol Gonzalez</developer_name> <developer_name xml:lang="ko">Aleix Pol Gonzalez</developer_name> + <developer_name xml:lang="lt">Aleix Pol Gonzalez</developer_name> <developer_name xml:lang="nb">Aleix Pol Gonzalez</developer_name> <developer_name xml:lang="nl">Aleix Pol Gonzalez</developer_name> <developer_name xml:lang="nn">Aleix Pol Gonzalez</developer_name> @@ -93,4 +98,10 @@ <developer_name xml:lang="zh-CN">Aleix Pol Gonzalez</developer_name> <developer_name xml:lang="zh-TW">Aleix Pol Gonzalez</developer_name> <icon type="stock">system-software-install</icon> + <releases> + <release version="5.17.3" date="2019-11-12"/> + <release version="5.17.2" date="2019-10-29"/> + <release version="5.17.1" date="2019-10-22"/> + <release version="5.17.0" date="2019-10-15"/> + </releases> </component>
  93. Download patch libdiscover/backends/DummyBackend/DummyBackend.h

    --- 5.14.5.1-2/libdiscover/backends/DummyBackend/DummyBackend.h 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/DummyBackend/DummyBackend.h 2019-11-12 10:10:38.000000000 +0000 @@ -24,7 +24,6 @@ #include <resources/AbstractResourcesBackend.h> #include <QVariantList> -class QAction; class DummyReviewsBackend; class StandardBackendUpdater; class DummyResource; @@ -47,7 +46,6 @@ public: Transaction* installApplication(AbstractResource* app, const AddonList& addons) override; Transaction* removeApplication(AbstractResource* app) override; bool isFetching() const override { return m_fetching; } - AbstractResource * resourceForFile(const QUrl & ) override; void checkForUpdates() override; QString displayName() const override; bool hasApplications() const override;
  94. Download patch discover/qml/DiscoverWindow.qml

    --- 5.14.5.1-2/discover/qml/DiscoverWindow.qml 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/qml/DiscoverWindow.qml 2019-11-12 10:10:38.000000000 +0000 @@ -19,6 +19,7 @@ Kirigami.ApplicationWindow readonly property string topSearchComp: ("qrc:/qml/SearchPage.qml") readonly property string topUpdateComp: ("qrc:/qml/UpdatesPage.qml") readonly property string topSourcesComp: ("qrc:/qml/SourcesPage.qml") + readonly property string topAboutComp: ("qrc:/qml/AboutPage.qml") readonly property string loadingComponent: ("qrc:/qml/LoadingPage.qml") readonly property QtObject stack: window.pageStack property string currentTopLevel: defaultStartup ? topBrowsingComp : loadingComponent @@ -27,6 +28,8 @@ Kirigami.ApplicationWindow objectName: "DiscoverMainWindow" title: leftPage ? leftPage.title : "" + width: app.initialGeometry.width>=10 ? app.initialGeometry.width : Kirigami.Units.gridUnit * 45 + height: app.initialGeometry.height>=10 ? app.initialGeometry.height : Kirigami.Units.gridUnit * 30 visible: true @@ -61,6 +64,7 @@ Kirigami.ApplicationWindow } TopLevelPageData { id: installedAction + iconName: "view-list-details" text: i18n("Installed") component: topInstalledComp objectName: "installed" @@ -68,16 +72,23 @@ Kirigami.ApplicationWindow TopLevelPageData { id: updateAction iconName: ResourcesModel.updatesCount>0 ? ResourcesModel.hasSecurityUpdates ? "update-high" : "update-low" : "update-none" - text: ResourcesModel.updatesCount<=0 ? (ResourcesModel.isFetching ? i18n("Checking for updates...") : i18n("No Updates") ) : i18nc("Update section name", "Update (%1)", ResourcesModel.updatesCount) + text: ResourcesModel.updatesCount<=0 ? (ResourcesModel.isFetching ? i18n("Fetching Updates...") : i18n("Up to Date") ) : i18nc("Update section name", "Update (%1)", ResourcesModel.updatesCount) component: topUpdateComp objectName: "update" } TopLevelPageData { - id: settingsAction - iconName: "settings" - text: i18n("Settings") + id: aboutAction + iconName: "help-feedback" + text: i18n("About") + component: topAboutComp + objectName: "about" + } + TopLevelPageData { + id: sourcesAction + iconName: "configure" + text: i18n("Sources") component: topSourcesComp - objectName: "settings" + objectName: "sources" } Kirigami.Action { @@ -118,7 +129,7 @@ Kirigami.ApplicationWindow window.stack.push(errorPageComponent, { error: errorMessage, title: i18n("Sorry...") }) } - onPreventedClose: showPassiveNotification(i18n("Could not close the application, there are tasks that need to be done.")) + onPreventedClose: showPassiveNotification(i18n("Could not close Discover, there are tasks that need to be done."), 20000, i18n("Quit Anyway"), function() { Qt.quit() }) onUnableToFind: { showPassiveNotification(i18n("Unable to find resource: %1", resid)); Navigation.openHome() @@ -138,11 +149,35 @@ Kirigami.ApplicationWindow Kirigami.Page { id: page property string error: "" + readonly property bool isHome: true + function searchFor(text) { + if (text.length === 0) + return; + Navigation.openCategory(null, "") + } + Kirigami.Icon { + id: infoIcon; + anchors { + bottom: parent.verticalCenter + margins: Kirigami.Units.largeSpacing + horizontalCenter: parent.horizontalCenter + } + visible: page.error !== "" + source: "emblem-warning" + height: Kirigami.Units.iconSizes.huge + width: height; + } Kirigami.Heading { - text: page.error - anchors.fill: parent + anchors { + top: parent.verticalCenter + margins: Kirigami.Units.largeSpacing + horizontalCenter: parent.horizontalCenter + } + width: parent.width; + wrapMode: Text.WordWrap horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter + visible: page.error !== "" + text: page.error } } } @@ -176,6 +211,8 @@ Kirigami.ApplicationWindow sheet.acted = true sheet.close() } + Keys.onEnterPressed: clicked() + Keys.onReturnPressed: clicked() } Button { Layout.alignment: Qt.AlignRight @@ -186,6 +223,7 @@ Kirigami.ApplicationWindow sheet.acted = true sheet.close() } + Keys.onEscapePressed: clicked() } } } @@ -227,7 +265,7 @@ Kirigami.ApplicationWindow onCurrentTopLevelChanged: { window.pageStack.clear() if (currentTopLevel) - window.pageStack.push(currentTopLevel, {}, window.status!=Component.Ready) + window.pageStack.push(currentTopLevel, {}, window.status!==Component.Ready) } UnityLauncher {
  95. Download patch discover/FeaturedModel.h

    --- 5.14.5.1-2/discover/FeaturedModel.h 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/FeaturedModel.h 2019-11-12 10:10:38.000000000 +0000 @@ -22,12 +22,15 @@ #define FEATUREDMODEL_H #include <QAbstractListModel> +#include <QPointer> +namespace KIO { class StoredTransferJob; } class AbstractResource; class FeaturedModel : public QAbstractListModel { Q_OBJECT + Q_PROPERTY(bool isFetching READ isFetching NOTIFY isFetchingChanged) public: FeaturedModel(); ~FeaturedModel() override {} @@ -37,13 +40,21 @@ class FeaturedModel : public QAbstractLi int rowCount(const QModelIndex & parent) const override; QHash<int, QByteArray> roleNames() const override; + bool isFetching() const { return m_isFetching != 0; } + + Q_SIGNALS: + void isFetchingChanged(); + private: void setUris(const QVector<QUrl> &uris); void refresh(); void removeResource(AbstractResource* resource); + void acquireFetching(bool f); + QVector<QUrl> m_uris; QVector<AbstractResource*> m_resources; + int m_isFetching = 0; }; #endif // FEATUREDMODEL_H
  96. Download patch discover/qml/ActionListItem.qml

    --- 5.14.5.1-2/discover/qml/ActionListItem.qml 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/qml/ActionListItem.qml 2019-11-12 10:10:38.000000000 +0000 @@ -19,8 +19,9 @@ ***************************************************************************/ import QtQuick 2.5 -import QtQuick.Controls 2.0 -import org.kde.kirigami 2.3 as Kirigami +import QtQuick.Controls 2.5 as QQC2 + +import org.kde.kirigami 2.5 as Kirigami Kirigami.BasicListItem { @@ -40,6 +41,10 @@ Kirigami.BasicListItem Kirigami.MnemonicData.label: action.text label: Kirigami.MnemonicData.richTextLabel + readonly property var tooltip: QQC2.ToolTip { + text: action.shortcut ? action.shortcut : p0.nativeText + } + readonly property var p0: Shortcut { sequence: item.Kirigami.MnemonicData.sequence onActivated: item.clicked()
  97. Download patch libdiscover/backends/FlatpakBackend/FlatpakTransactionThread.cpp
  98. Download patch discover/org.kde.discover.appdata.xml
  99. Download patch libdiscover/backends/FlatpakBackend/FlatpakResource.h

    --- 5.14.5.1-2/libdiscover/backends/FlatpakBackend/FlatpakResource.h 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/libdiscover/backends/FlatpakBackend/FlatpakResource.h 2019-11-12 10:10:38.000000000 +0000 @@ -45,24 +45,28 @@ public: InstalledSize, RequiredRuntime }; + Q_ENUM(PropertyKind) enum PropertyState { NotKnownYet = 0, AlreadyKnown, UnknownOrFailed, }; + Q_ENUM(PropertyState) enum ResourceType { DesktopApp = 0, Runtime, + Extension, Source }; + Q_ENUM(ResourceType) struct Id { - FlatpakInstallation * installation; + FlatpakInstallation * const installation; QString origin; FlatpakResource::ResourceType type; - QString id; + const QString id; QString branch; QString arch; bool operator!=(const Id& other) const { return !operator==(other); } @@ -100,14 +104,14 @@ public: QVariant icon() const override; QString installedVersion() const override; int installedSize() const; - bool isTechnical() const override; + AbstractResource::Type type() const override; QUrl homepage() override; QUrl helpURL() override; QUrl bugURL() override; QUrl donationURL() override; QString flatpakFileType() const; QString flatpakName() const; - QString license() override; + QJsonArray licenses() override; QString longDescription() override; QString name() const override; QString origin() const override; @@ -119,11 +123,13 @@ public: int size() override; QString sizeDescription() override; AbstractResource::State state() override; - ResourceType type() const; + ResourceType resourceType() const; QString typeAsString() const; FlatpakResource::Id uniqueId() const; QUrl url() const override; QDate releaseDate() const override; + QString author() const override; + QStringList extends() const override; FlatpakInstallation* installation() const { return m_id.installation; } @@ -148,10 +154,12 @@ public: // void setAddonInstalled(const QString& addon, bool installed); void updateFromRef(FlatpakRef* ref); + QString ref() const; QString sourceIcon() const override; + QString installPath() const; Q_SIGNALS: - void propertyStateChanged(PropertyKind kind, PropertyState state); + void propertyStateChanged(FlatpakResource::PropertyKind kind, FlatpakResource::PropertyState state); private: void setArch(const QString &arch);
  100. Download patch discover/qml/ReviewDialog.qml

    --- 5.14.5.1-2/discover/qml/ReviewDialog.qml 2019-01-08 10:58:04.000000000 +0000 +++ 5.17.3-0ubuntu1/discover/qml/ReviewDialog.qml 2019-11-12 10:10:38.000000000 +0000 @@ -18,6 +18,7 @@ Kirigami.OverlaySheet signal accepted() ColumnLayout { + height: Kirigami.Units.gridUnit * 22 Kirigami.Heading { level: 3; text: i18n("Reviewing '%1'", application.name) } Label { text: i18n("Rating:") } Rating { @@ -27,7 +28,9 @@ Kirigami.OverlaySheet Label { visible: reviewDialog.backend.userName.length > 0 - text: visible ? i18n("Submission name: %1", reviewDialog.backend.userName) : "" + Layout.fillWidth: true + elide: Text.ElideRight + text: visible ? xi18nc("@info", "Submission name:<nl/>%1", reviewDialog.backend.userName) : "" } Label { text: i18n("Title:") } TextField {
  101. ...

Debian ( Changelog | PTS | Bugs ) Ubuntu ( Changelog | txt | LP | Bugs ) | Diff from Ubuntu

Source: xdg-user-dirs

xdg-user-dirs (0.17-2ubuntu1) disco; urgency=low * Merge with Debian. Remaining change: - Add launchpad_translation_export.patch: + update translations from Launchpad -- Sebastien Bacher <seb128@ubuntu.com> Thu, 24 Jan 2019 15:37:01 +0100

Modifications :
  1. Download patch debian/rules

    --- 0.17-2/debian/rules 2018-12-28 00:48:38.000000000 +0000 +++ 0.17-2ubuntu1/debian/rules 2019-01-24 14:32:35.000000000 +0000 @@ -1,5 +1,6 @@ #!/usr/bin/make -f +export NO_PKG_MANGLE=1 export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DEB_LDFLAGS_MAINT_APPEND = -Wl,-O1 -Wl,-z,defs -Wl,--as-needed
  2. Download patch debian/patches/launchpad_translation_export.patch
  3. Download patch debian/control

    --- 0.17-2/debian/control 2018-12-28 00:48:38.000000000 +0000 +++ 0.17-2ubuntu1/debian/control 2019-01-24 14:39:24.000000000 +0000 @@ -5,7 +5,8 @@ Source: xdg-user-dirs Section: utils Priority: optional -Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org> +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> +XSBC-Original-Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org> Uploaders: Iain Lane <laney@debian.org>, Jeremy Bicha <jbicha@debian.org>, Jordi Mallach <jordi@debian.org>, Matthias Klumpp <mak@debian.org>, Michael Biebl <biebl@debian.org>, Sebastian Dröge <slomo@debian.org> Build-Depends: debhelper-compat (= 12), docbook-xml,
  4. Download patch debian/control.in

    --- 0.17-2/debian/control.in 2018-12-28 00:48:38.000000000 +0000 +++ 0.17-2ubuntu1/debian/control.in 2019-01-24 14:39:24.000000000 +0000 @@ -1,7 +1,8 @@ Source: xdg-user-dirs Section: utils Priority: optional -Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org> +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> +XSBC-Original-Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org> Uploaders: @GNOME_TEAM@ Build-Depends: debhelper-compat (= 12), docbook-xml,
  5. Download patch debian/patches/series

    --- 0.17-2/debian/patches/series 2018-12-28 00:48:38.000000000 +0000 +++ 0.17-2ubuntu1/debian/patches/series 2018-03-23 15:54:24.000000000 +0000 @@ -0,0 +1 @@ +launchpad_translation_export.patch
  1. fwupd
  2. plasma-discover
  3. xdg-user-dirs