Commit c2c5c833 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

pk: Actually require PackageKit 1.0.1

parent b946520f
......@@ -26,7 +26,7 @@ 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(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)
......@@ -75,7 +75,7 @@ set_package_properties(packagekitqt5 PROPERTIES
set_package_properties(AppStreamQt PROPERTIES
DESCRIPTION "Library that lists Appstream resources"
URL "http://www.freedesktop.org"
PURPOSE "Required to build the PackageKit backend"
PURPOSE "Required to build the PackageKit and Flatpak backends"
TYPE OPTIONAL)
set_package_properties(FLATPAK PROPERTIES
DESCRIPTION "Library that exposes flatpak repositories"
......
......@@ -30,9 +30,4 @@ install(TARGETS DiscoverPackageKitNotifier DESTINATION ${PLUGIN_INSTALL_DIR}/dis
install(FILES packagekit-backend-categories.xml DESTINATION ${DATA_INSTALL_DIR}/libdiscover/categories)
add_subdirectory(categoryimages)
if(packagekitqt5_VERSION VERSION_GREATER 1.0.1 OR packagekitqt5_VERSION VERSION_EQUAL 1.0.1)
target_compile_definitions(packagekit-backend PUBLIC -DPKQT_1_0)
target_compile_definitions(DiscoverPackageKitNotifier PUBLIC -DPKQT_1_0)
endif()
install( FILES org.kde.discover.packagekit.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR} )
......@@ -204,7 +204,6 @@ uint PackageKitNotifier::updatesCount()
void PackageKitNotifier::onDistroUpgrade(PackageKit::Transaction::DistroUpgrade type, const QString& name, const QString& description)
{
#ifdef PKQT_1_0
KNotification *notification = new KNotification(QLatin1String("distupgrade-notification"), KNotification::Persistent | KNotification::DefaultEvent);
notification->setIconName(QStringLiteral("system-software-update"));
notification->setActions(QStringList{QLatin1String("Upgrade")});
......@@ -224,11 +223,6 @@ void PackageKitNotifier::onDistroUpgrade(PackageKit::Transaction::DistroUpgrade
});
notification->sendEvent();
#else
Q_UNUSED(type)
Q_UNUSED(name)
Q_UNUSED(description)
#endif
}
void PackageKitNotifier::refreshDatabase()
......@@ -238,12 +232,10 @@ void PackageKitNotifier::refreshDatabase()
connect(m_refresher.data(), &PackageKit::Transaction::finished, this, &PackageKitNotifier::recheckSystemUpdateNeeded);
}
#ifdef PKQT_1_0
if (!m_distUpgrades && (PackageKit::Daemon::roles() & PackageKit::Transaction::RoleUpgradeSystem)) {
m_distUpgrades = PackageKit::Daemon::getDistroUpgrades();
connect(m_distUpgrades, &PackageKit::Transaction::distroUpgrade, this, &PackageKitNotifier::onDistroUpgrade);
}
#endif
}
QProcess* PackageKitNotifier::checkAptVariable(const QString &aptconfig, const QLatin1String& varname, std::function<void(const QStringRef& val)> func)
......
......@@ -21,9 +21,7 @@
#include "PackageKitMessages.h"
#include <PackageKit/Daemon>
#ifdef PKQT_1_0
#include <PackageKit/Offline>
#endif
#include <QDebug>
#include <QAction>
#include <QSet>
......@@ -158,10 +156,8 @@ void PackageKitUpdater::proceed()
{
if (!m_proceedFunctions.isEmpty())
processProceedFunction();
#ifdef PKQT_1_0
else if (useOfflineUpdates())
setupTransaction(PackageKit::Transaction::TransactionFlagOnlyTrusted | PackageKit::Transaction::TransactionFlagOnlyDownload);
#endif
else
setupTransaction(PackageKit::Transaction::TransactionFlagOnlyTrusted);
}
......@@ -218,12 +214,8 @@ void PackageKitUpdater::finished(PackageKit::Transaction::Exit exit, uint /*time
fetchLastUpdateTime();
if (useOfflineUpdates()) {
#ifdef PKQT_1_0
PackageKit::Daemon::global()->offline()->trigger(PackageKit::Offline::ActionReboot);
Q_EMIT passiveMessage(i18n("Please restart the computer to finish the installation"));
#else
qWarning() << "PK_OFFLINE_UPDATE is set but discover was built against an old version of PackageKitQt that didn't support offline updates";
#endif
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment