[neon/backports-jammy/packagekit-qt/Neon/unstable] /: Imported Upstream version 0.9.5
Matthias Klumpp
null at kde.org
Wed Mar 15 04:29:32 GMT 2023
Git commit 75fa3711c95be7aee62fb2ed072d641aebd71215 by Matthias Klumpp.
Committed on 10/10/2014 at 15:19.
Pushed by carlosdem into branch 'Neon/unstable'.
Imported Upstream version 0.9.5
M +13 -15 CMakeLists.txt
M +22 -0 NEWS
A +8 -0 README
D +0 -49 RELEASE
M +0 -9 config.h.in
M +13 -16 src/CMakeLists.txt
M +10 -5 src/bitfield.cpp
M +5 -1 src/bitfield.h
M +0 -2 src/common.h
M +5 -38 src/daemon.cpp
M +54 -52 src/daemon.h
M +1 -1 src/daemonprivate.cpp
M +2 -2 src/daemonprivate.h
M +3 -4 src/modules/packagekit-qt-config.cmake.in
M +3 -3 src/packagekitqt4.pc.in
M +3 -3 src/packagekitqt5.pc.in
M +1 -32 src/transaction.cpp
M +4 -3 src/transaction.h
M +5 -5 src/transactionprivate.cpp
M +2 -2 src/transactionprivate.h
https://invent.kde.org/neon/backports-jammy/packagekit-qt/commit/75fa3711c95be7aee62fb2ed072d641aebd71215
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9b1b054..b4c1303 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,9 +6,12 @@ find_package(PkgConfig REQUIRED)
set(CMAKE_BUILD_TYPE "Debug")
+# Used to set installation paths
+include(GNUInstallDirs)
+
set(QPACKAGEKIT_VERSION_MAJOR "0")
set(QPACKAGEKIT_VERSION_MINOR "9")
-set(QPACKAGEKIT_VERSION_PATCH "2")
+set(QPACKAGEKIT_VERSION_PATCH "5")
set(QPACKAGEKIT_VERSION_SUFFIX "${VERSION_SUFFIX}")
set(QPACKAGEKIT_VERSION "${QPACKAGEKIT_VERSION_MAJOR}.${QPACKAGEKIT_VERSION_MINOR}.${QPACKAGEKIT_VERSION_PATCH}")
@@ -33,6 +36,8 @@ else()
set(QT_VERSION "4")
endif(USE_QT5)
+set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX
"/usr" CACHE PATH "QPK default install prefix" FORCE)
@@ -41,27 +46,14 @@ endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
#
# Configure files
#
-set (PREFIXDIR "${CMAKE_INSTALL_PREFIX}")
-set (DATADIR "${CMAKE_INSTALL_PREFIX}/share")
-set (PKGDATADIR "${DATA_INSTALL_DIR}")
-set (LIBDIR "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}")
-set (PKGLIBDIR "${LIBDIR}/packagekit")
set (GETTEXT_PACKAGE "packagekit")
-set (LOCALE_DIR "${DATADIR}/locale")
set (VERSION "${QPACKAGEKIT_VERSION}")
-set (BUILDDIR "${CMAKE_BINARY_DIR}")
set (LOCALSTATEDIR "/var")
+set (CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${LIBNAME}/")
add_definitions("-DLOCALSTATEDIR=\"${LOCALSTATEDIR}\"")
add_definitions("-std=gnu++11")
-set(CMAKE_INSTALL_LIBDIR "lib/${CMAKE_LIBRARY_ARCHITECTURE}" CACHE PATH "Output directory for libraries")
-if (IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR})
- set (PKQT_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR})
-else (IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR})
- set (PKQT_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
-endif (IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR})
-
configure_file(config.h.in ${CMAKE_BINARY_DIR}/config.h)
#
@@ -75,3 +67,9 @@ endif (DISABLE_MAINTAINER_CFLAGS)
add_definitions(${MAINTAINER_CFLAGS})
add_subdirectory(src)
+
+install(EXPORT PackageKitQtTargets
+ DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
+ FILE PackageKitQtTargets.cmake
+ NAMESPACE PK::
+ COMPONENT Devel)
diff --git a/NEWS b/NEWS
index 24c9e2b..9f64004 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,25 @@
+Version 0.9.5
+~~~~~~~~~~~~~
+Released: 2014-10-10
+
+New Features:
+ - Add operator== to bitfield (Daniel Nicoletti)
+
+Bugfixes:
+ - Deprecate ::packageIcon methods (Aleix Pol)
+ - Disable namespacing and classes names on the generated interfaces (Daniel Nicoletti)
+ - Don't assume the target is packagekitqt5 (Aleix Pol)
+ - Fix compilation due to not-set cmake variable (Matthias Klumpp)
+ - Fix documentation (Aleix Pol)
+ - Fix QPK include dir in cmake module (Matthias Klumpp)
+ - Properly export cmake targets (Aleix Pol)
+ - Remove daemon proxy conection to changed() (Daniel Nicoletti)
+ - Remove RoleUpgradeSystem as it's not supported in 0.9.x anymore (Daniel Nicoletti)
+ - Remove the metatype registration for Transaction types (Daniel Nicoletti)
+ - Support RPATH by default (Aleix Pol)
+ - Use GNUInstallDirs to determine most of used variables (Hrvoje Senjan)
+ - Use "PackageKit" as the include namespace rather than the library name (Aleix Pol)
+
Version 0.9.2
~~~~~~~~~~~~~
Released: 2013-04-29
diff --git a/README b/README
new file mode 100644
index 0000000..0e93f18
--- /dev/null
+++ b/README
@@ -0,0 +1,8 @@
+# PackageKit-Qt
+Qt bindings for PackageKit
+
+## PackageKit
+PackageKit is a DBUS abstraction layer that allows the session user to manage
+packages in a secure way using a cross-distro, cross-architecture API.
+
+For more information, please see http://www.packagekit.org
diff --git a/RELEASE b/RELEASE
deleted file mode 100644
index cb1f5e3..0000000
--- a/RELEASE
+++ /dev/null
@@ -1,49 +0,0 @@
-PackageKit-Qt Release Notes
-
-1. Write NEWS entries for PackageKit-Qt in the same format as usual.
-
-git shortlog QPACKAGEKIT_0_8_8.. | grep -i -v trivial | grep -v Merge > NEWS.new
-
---------------------------------------------------------------------------------
-Version 0.9.2
-~~~~~~~~~~~~~
-Released: 2013-xx-xx
-
-Notes:
-
-New Features:
-
-Bugfixes:
---------------------------------------------------------------------------------
-
-2. Update library version if new ABI or API in CMakeLists.txt
-
-3. Commit changes in PackageKit-Qt git:
-
-git commit -a -m "Release version 0.9.2"
-git tag -s -f -m "Release 0.9.2" QPACKAGEKIT_0_9_2
-<gpg password>
-git push --tags
-git push
-
-4. run './release.sh --version=0.9.2 --git-tag=QPACKAGEKIT_0_9_2 --sign'
-
-5. Upload tarball to:
-
-scp *.tar.* packagekit.org:/srv/www/html/releases/
-
-6. Do post release version bump in CMakeLists.txt
-
-7. Commit trivial changes:
-
-git commit -a -m "trivial: post release version bump"
-git push
-
-8. Send an email to packagekit at lists.freedesktop.org
-
-=================================================
-PackageKit-Qt 0.9.2 released!
-
-Tarballs available here: http://www.packagekit.org/releases/
-
-=================================================
diff --git a/config.h.in b/config.h.in
index 782abcb..8ab6511 100644
--- a/config.h.in
+++ b/config.h.in
@@ -7,15 +7,6 @@
/* Gettext Package */
#define GETTEXT_PACKAGE "@GETTEXT_PACKAGE@"
-/* Paths */
-#define LOCALEDIR "@LOCALE_DIR@"
-#define PKGDATADIR "@PKGDATADIR@"
-#define PKGLIBDIR "@PKGLIBDIR@"
-#define PREFIXDIR "@PREFIXDIR@"
-#define DATADIR "@DATADIR@"
-#define LIBDIR "@LIBDIR@"
-#define BUILDDIR "@BUILDDIR@"
-
/* Name of package */
#define PACKAGE_NAME "packagekit-qt"
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 8ef7906..0e18022 100755
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -11,16 +11,12 @@ endif ()
# Set up Qt
if (Qt5_FOUND)
find_package(Qt5DBus REQUIRED)
- find_package(Qt5Sql REQUIRED)
include_directories(${Qt5Core_INCLUDE_DIRS}
${Qt5DBus_INCLUDE_DIRS}
- ${Qt5Sql_INCLUDE_DIRS}
)
add_definitions(${Qt5DBus_DEFINITIONS})
- add_definitions(${Qt5Sql_DEFINITIONS})
elseif (Qt4_FOUND)
set(QT_USE_QTDBUS TRUE)
- set(QT_USE_QTSQL TRUE)
set(QT_DONT_USE_QTGUI TRUE)
include(${QT_USE_FILE})
endif ()
@@ -55,18 +51,19 @@ set(packagekitqt_SRC
details.cpp
)
-find_file(PK_INTERFACE_XML org.freedesktop.PackageKit.xml
- PATHS ${CMAKE_INSTALL_PREFIX}/share/dbus-1/interfaces/
+find_path(PK_INTERFACES_DIR org.freedesktop.PackageKit.xml
+ HINTS ${CMAKE_INSTALL_PREFIX} /usr
+ PATH_SUFFIXES share/dbus-1/interfaces/
)
-find_file(PK_TRANSACTION_INTERFACE_XML org.freedesktop.PackageKit.Transaction.xml
- PATHS ${CMAKE_INSTALL_PREFIX}/share/dbus-1/interfaces/
-)
-if (PK_INTERFACE_XML STREQUAL "PK_INTERFACE_XML-NOTFOUND" OR PK_TRANSACTION_INTERFACE_XML STREQUAL "PK_TRANSACTION_INTERFACE_XML-NOTFOUND")
+set(PK_INTERFACE_XML "${PK_INTERFACES_DIR}/org.freedesktop.PackageKit.xml")
+set(PK_TRANSACTION_INTERFACE_XML "${PK_INTERFACES_DIR}/org.freedesktop.PackageKit.Transaction.xml")
+
+if (NOT PK_INTERFACE_XML OR NOT PK_TRANSACTION_INTERFACE_XML)
message (FATAL_ERROR "Unable to find PackageKit DBus specifications! Please install PackageKit to continue!")
endif ()
-set_source_files_properties(${PK_INTERFACE_XML} PROPERTIES CLASSNAME DaemonProxy)
-set_source_files_properties(${PK_TRANSACTION_INTERFACE_XML} PROPERTIES CLASSNAME TransactionProxy)
+set_source_files_properties(${PK_INTERFACE_XML} PROPERTIES NO_NAMESPACE true)
+set_source_files_properties(${PK_TRANSACTION_INTERFACE_XML} PROPERTIES NO_NAMESPACE true)
if (Qt5_FOUND)
qt5_add_dbus_interface(packagekitqt_SRC ${PK_INTERFACE_XML} daemonproxy)
@@ -87,7 +84,7 @@ set_target_properties(${LIBNAME} PROPERTIES VERSION ${QPACKAGEKIT_VERSION} SOVER
if (Qt5_FOUND)
add_dependencies(${LIBNAME} mocs)
target_link_libraries(${LIBNAME}
- ${Qt5DBus_LIBRARIES} ${Qt5Sql_LIBRARIES}
+ LINK_PUBLIC Qt5::DBus
)
elseif (Qt4_FOUND)
target_link_libraries(${LIBNAME}
@@ -99,13 +96,13 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${LIBNAME}.pc.in
${CMAKE_CURRENT_BINARY_DIR}/${LIBNAME}.pc
@ONLY
)
-
-install(TARGETS ${LIBNAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})
+target_include_directories(${LIBNAME} INTERFACE "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${LIBNAME}/PackageKit/;${CMAKE_INSTALL_INCLUDEDIR}/${LIBNAME}>")
+install(TARGETS ${LIBNAME} EXPORT PackageKitQtTargets DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LIBNAME}.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
install(FILES ${packagekitqt_HEADERS}
- DESTINATION include/PackageKit/${LIBNAME}
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${LIBNAME}/PackageKit/
)
add_subdirectory(modules)
diff --git a/src/bitfield.cpp b/src/bitfield.cpp
index c986905..68ef80c 100644
--- a/src/bitfield.cpp
+++ b/src/bitfield.cpp
@@ -2,7 +2,7 @@
using namespace PackageKit;
-Bitfield::Bitfield () : m_val (0)
+Bitfield::Bitfield ()
{
}
@@ -61,10 +61,15 @@ Bitfield Bitfield::operator|= (Bitfield mask)
Bitfield& Bitfield::operator= (const Bitfield& other)
{
- if (this == &other)
- return *this;
+ if (this == &other)
+ return *this;
- m_val = other.m_val;
+ m_val = other.m_val;
- return *this;
+ return *this;
+}
+
+bool Bitfield::operator==(const Bitfield &other)
+{
+ return m_val == other.m_val;
}
diff --git a/src/bitfield.h b/src/bitfield.h
index d7dd481..8535e46 100644
--- a/src/bitfield.h
+++ b/src/bitfield.h
@@ -2,6 +2,7 @@
#define PACKAGEKIT_BITFIELD_H
#include <QtGlobal>
+#include <QMetaType>
namespace PackageKit {
@@ -23,11 +24,14 @@ public:
Bitfield operator|= (Bitfield mask);
Bitfield& operator= (const Bitfield& other);
+ bool operator==(const Bitfield &other);
private:
- qulonglong m_val;
+ qulonglong m_val = 0;
};
} // End namespace PackageKit
+Q_DECLARE_METATYPE(PackageKit::Bitfield)
+
#endif
diff --git a/src/common.h b/src/common.h
index d7497d4..05a3df4 100644
--- a/src/common.h
+++ b/src/common.h
@@ -34,5 +34,3 @@
#define AUTH_SYSTEM_SOURCES_REFRESH "org.freedesktop.packagekit.system-sources-refresh"
#define AUTH_SYSTEM_NETWORK_PROXY_CONFIGURE "org.freedesktop.packagekit.system-network-proxy-configure"
#define AUTH_CANCEL_FOREIGN "org.freedesktop.packagekit.cancel-foreign"
-
-#define PK_DESKTOP_DEFAULT_DATABASE LOCALSTATEDIR "/lib/PackageKit/desktop-files.db"
diff --git a/src/daemon.cpp b/src/daemon.cpp
index 621fb89..647756a 100755
--- a/src/daemon.cpp
+++ b/src/daemon.cpp
@@ -19,9 +19,6 @@
* Boston, MA 02110-1301, USA.
*/
-#include <QtSql>
-#include <QDebug>
-
#include "daemon.h"
#include "daemonprivate.h"
#include "transactionprivate.h"
@@ -47,10 +44,10 @@ Daemon::Daemon(QObject *parent) :
d_ptr(new DaemonPrivate(this))
{
Q_D(Daemon);
- d->daemon = new ::DaemonProxy(QLatin1String(PK_NAME),
- QLatin1String(PK_PATH),
- QDBusConnection::systemBus(),
- this);
+ d->daemon = new ::OrgFreedesktopPackageKitInterface(QLatin1String(PK_NAME),
+ QLatin1String(PK_PATH),
+ QDBusConnection::systemBus(),
+ this);
QDBusConnection::systemBus().connect(QLatin1String(PK_NAME),
QLatin1String(PK_PATH),
@@ -58,33 +55,6 @@ Daemon::Daemon(QObject *parent) :
QLatin1String("PropertiesChanged"),
this,
SLOT(propertiesChanged(QString,QVariantMap,QStringList)));
-
- // Set up database for desktop files
- QSqlDatabase db;
- db = QSqlDatabase::addDatabase("QSQLITE", PK_DESKTOP_DEFAULT_DATABASE);
- db.setDatabaseName(PK_DESKTOP_DEFAULT_DATABASE);
- if (!db.open()) {
- qDebug() << "Failed to initialize the desktop files database";
- }
-
- qRegisterMetaType<PackageKit::Daemon::Network>("PackageKit::Daemon::Network");
- qRegisterMetaType<PackageKit::Daemon::Authorize>("PackageKit::Daemon::Authorize");
- qRegisterMetaType<PackageKit::Transaction::InternalError>("PackageKit::Transaction::InternalError");
- qRegisterMetaType<PackageKit::Transaction::Role>("PackageKit::Transaction::Role");
- qRegisterMetaType<PackageKit::Transaction::Error>("PackageKit::Transaction::Error");
- qRegisterMetaType<PackageKit::Transaction::Exit>("PackageKit::Transaction::Exit");
- qRegisterMetaType<PackageKit::Transaction::Filter>("PackageKit::Transaction::Filter");
- qRegisterMetaType<PackageKit::Transaction::Message>("PackageKit::Transaction::Message");
- qRegisterMetaType<PackageKit::Transaction::Status>("PackageKit::Transaction::Status");
- qRegisterMetaType<PackageKit::Transaction::MediaType>("PackageKit::Transaction::MediaType");
- qRegisterMetaType<PackageKit::Transaction::DistroUpgrade>("PackageKit::Transaction::DistroUpgrade");
- qRegisterMetaType<PackageKit::Transaction::TransactionFlag>("PackageKit::Transaction::TransactionFlag");
- qRegisterMetaType<PackageKit::Transaction::TransactionFlags>("PackageKit::Transaction::TransactionFlags");
- qRegisterMetaType<PackageKit::Transaction::Restart>("PackageKit::Transaction::Restart");
- qRegisterMetaType<PackageKit::Transaction::UpdateState>("PackageKit::Transaction::UpdateState");
- qRegisterMetaType<PackageKit::Transaction::Group>("PackageKit::Transaction::Group");
- qRegisterMetaType<PackageKit::Transaction::Info>("PackageKit::Transaction::Info");
- qRegisterMetaType<PackageKit::Transaction::SigType>("PackageKit::Transaction::SigType");
}
void DaemonPrivate::setupSignal(const QString &signal, bool connect)
@@ -94,10 +64,7 @@ void DaemonPrivate::setupSignal(const QString &signal, bool connect)
const char *signalToConnect = 0;
const char *memberToConnect = 0;
- if (signal == SIGNAL(changed())) {
- signalToConnect = SIGNAL(Changed());
- memberToConnect = SIGNAL(changed());
- } else if (signal == SIGNAL(repoListChanged())) {
+ if (signal == SIGNAL(repoListChanged())) {
signalToConnect = SIGNAL(RepoListChanged());
memberToConnect = SIGNAL(repoListChanged());
} else if (signal == SIGNAL(restartScheduled())) {
diff --git a/src/daemon.h b/src/daemon.h
index 4114112..05d74f4 100644
--- a/src/daemon.h
+++ b/src/daemon.h
@@ -277,8 +277,10 @@ public:
/**
* Returns the package icon from the \p packageID
+ *
+ * @deprecated use Appstream to fetch icons
*/
- Q_INVOKABLE static QString packageIcon(const QString &packageID);
+ Q_INVOKABLE QT_DEPRECATED static QString packageIcon(const QString &packageID);
/**
* Returns the string representing the enum
@@ -364,7 +366,7 @@ public:
* \note You need to manually restart the transaction which triggered the EULA.
* \sa eulaRequired()
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *acceptEula(const QString &eulaID);
@@ -372,7 +374,7 @@ public:
* Download the given \p packages to a temp dir, if \p storeInCache is true
* the download will be stored in the package manager cache
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *downloadPackages(const QStringList &packageIDs, bool storeInCache = false);
@@ -380,7 +382,7 @@ public:
* This is a convenience function to download this \p package
* \sa downloadPackages(const QStringList &packageIDs, bool storeInCache = false)
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *downloadPackage(const QString &packageID, bool storeInCache = false);
@@ -389,7 +391,7 @@ public:
*
* \sa category
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *getCategories();
@@ -402,7 +404,7 @@ public:
*
* \note This method emits \sa package()
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *dependsOn(const QStringList &packageIDs, Transaction::Filters filters = Transaction::FilterNone, bool recursive = false);
@@ -410,7 +412,7 @@ public:
* Convenience function to get the dependencies of this \p package
* \sa dependsOn(const QStringList &packageIDs, Filters filters, bool recursive = false)
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *dependsOn(const QString &packageID, Transaction::Filters filters = Transaction::FilterNone, bool recursive = false);
@@ -421,7 +423,7 @@ public:
* \note This method emits \sa package()
* with details set
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *getDetails(const QStringList &packageIDs);
@@ -429,7 +431,7 @@ public:
* Convenience function to get the details about this \p package
* \sa getDetails(const QStringList &packageIDs)
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *getDetails(const QString &packageID);
@@ -440,7 +442,7 @@ public:
* \note This method emits \sa package()
* with details set
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *getDetailsLocal(const QStringList &files);
@@ -451,7 +453,7 @@ public:
* \note This method emits \sa package()
* with details set
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *getDetailsLocal(const QString &file);
@@ -460,7 +462,7 @@ public:
*
* \note This method emits \sa files()
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *getFiles(const QStringList &packageIDs);
@@ -468,7 +470,7 @@ public:
* Convenience function to get the files contained in this \p package
* \sa getFiles(const QStringList &packageIDs)
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *getFiles(const QString &packageIDs);
@@ -477,7 +479,7 @@ public:
*
* \note This method emits \sa files()
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *getFilesLocal(const QStringList &files);
@@ -486,7 +488,7 @@ public:
*
* \note This method emits \sa files()
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *getFilesLocal(const QString &file);
@@ -496,7 +498,7 @@ public:
* \note You must delete these transactions yourself
* \note This method emits \sa transaction()
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *getOldTransactions(uint number);
@@ -505,7 +507,7 @@ public:
*
* \note This method emits \sa package()
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *getPackages(Transaction::Filters filters = Transaction::FilterNone);
@@ -514,7 +516,7 @@ public:
*
* \note This method emits \sa repository()
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *getRepoList(Transaction::Filters filters = Transaction::FilterNone);
@@ -527,7 +529,7 @@ public:
*
* \note This method emits \sa package()
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *requiredBy(const QStringList &packageIDs, Transaction::Filters filters = Transaction::FilterNone, bool recursive = false);
@@ -535,7 +537,7 @@ public:
* Convenience function to get packages requiring this package
* \sa requiredBy(const QStringList &packageIDs, Filters filters, bool recursive = false)
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *requiredBy(const QString &packageID, Transaction::Filters filters = Transaction::FilterNone, bool recursive = false);
@@ -544,7 +546,7 @@ public:
*
* \note This method emits \sa updateDetail()
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *getUpdatesDetails(const QStringList &packageIDs);
@@ -552,7 +554,7 @@ public:
* Convenience function to get update details
* \sa getUpdateDetail(const QStringList &packageIDs)
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *getUpdateDetail(const QString &packageID);
@@ -563,7 +565,7 @@ public:
*
* \note This method emits \sa package()
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *getUpdates(Transaction::Filters filters = Transaction::FilterNone);
@@ -572,7 +574,7 @@ public:
*
* \note This method emits \sa distroUpgrade()
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *getDistroUpgrades();
@@ -583,7 +585,7 @@ public:
*
* \note This method emits \sa package() and \sa changed()
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *installFiles(const QStringList &files, Transaction::TransactionFlags flags = Transaction::TransactionFlagOnlyTrusted);
@@ -591,7 +593,7 @@ public:
* Convenience function to install a file
* \sa installFiles(const QStringList &files, TransactionFlags flags)
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *installFile(const QString &file, Transaction::TransactionFlags flags = Transaction::TransactionFlagOnlyTrusted);
@@ -602,7 +604,7 @@ public:
*
* \note This method emits \sa package() and \sa changed()
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *installPackages(const QStringList &packageIDs, Transaction::TransactionFlags flags = Transaction::TransactionFlagOnlyTrusted);
@@ -610,7 +612,7 @@ public:
* Convenience function to install a package
* \sa installPackages(const QStringList &packageIDs, TransactionFlags flags)
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *installPackage(const QString &packageID, Transaction::TransactionFlags flags = Transaction::TransactionFlagOnlyTrusted);
@@ -619,7 +621,7 @@ public:
*
* \p type, \p keyId and \p package generally come from the Transaction::repoSignatureRequired
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *installSignature(Transaction::SigType type, const QString &keyID, const QString &packageID);
@@ -628,7 +630,7 @@ public:
*
* \note This method emits \sa changed()
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *refreshCache(bool force);
@@ -641,7 +643,7 @@ public:
*
* \note This method emits \sa package() and \sa changed()
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *removePackages(const QStringList &packageIDs, bool allowDeps = false, bool autoRemove = false, Transaction::TransactionFlags flags = Transaction::TransactionFlagOnlyTrusted);
@@ -650,21 +652,21 @@ public:
*
* \sa removePackages(const PackageList &packages, bool allowDeps = false, bool autoRemove = false, TransactionFlags flags)
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *removePackage(const QString &packageID, bool allowDeps = false, bool autoRemove = false, Transaction::TransactionFlags flags = Transaction::TransactionFlagOnlyTrusted);
/**
* Repairs a broken system
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *repairSystem(Transaction::TransactionFlags flags = Transaction::TransactionFlagOnlyTrusted);
/**
* Activates or disables a repository
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *repoEnable(const QString &repoId, bool enable = true);
@@ -673,14 +675,14 @@ public:
*
* \p autoremove packages from this repository
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *repoRemove(const QString &repoId, bool autoremove, Transaction::TransactionFlags flags = Transaction::TransactionFlagNone);
/**
* Sets a repository's parameter
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *repoSetData(const QString &repoId, const QString ¶meter, const QString &value);
@@ -691,7 +693,7 @@ public:
*
* \note This method emits \sa package()
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *resolve(const QStringList &packageNames, Transaction::Filters filters = Transaction::FilterNone);
@@ -699,7 +701,7 @@ public:
* Convenience function to remove a package name
* \sa resolve(const QStringList &packageNames, Transaction::Filters filters = Transaction::FilterNone)
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *resolve(const QString &packageName, Transaction::Filters filters = Transaction::FilterNone);
@@ -710,7 +712,7 @@ public:
*
* \note This method emits \sa package()
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *searchFiles(const QStringList &search, Transaction::Filters filters = Transaction::FilterNone);
@@ -718,7 +720,7 @@ public:
* Convenience function to search for a file
* \sa searchFiles(const QStringList &search, Transaction::Filters filters = Transaction::FilterNone)
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *searchFiles(const QString &search, Transaction::Filters filters = Transaction::FilterNone);
@@ -729,7 +731,7 @@ public:
*
* \note This method emits \sa package()
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *searchDetails(const QStringList &search, Transaction::Filters filters = Transaction::FilterNone);
@@ -737,7 +739,7 @@ public:
* Convenience function to search by details
* \sa searchDetails(const QStringList &search, Transaction::Filters filters = Transaction::FilterNone)
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *searchDetails(const QString &search, Transaction::Filters filters = Transaction::FilterNone);
@@ -750,7 +752,7 @@ public:
*
* \note This method emits \sa package()
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *searchGroups(const QStringList &groups, Transaction::Filters filters = Transaction::FilterNone);
@@ -758,7 +760,7 @@ public:
* Convenience function to search by group string
* \sa searchGroups(const QStringList &groups, Transaction::Filters filters = Transaction::FilterNone)
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *searchGroup(const QString &group, Transaction::Filters filters = Transaction::FilterNone);
@@ -766,7 +768,7 @@ public:
* Convenience function to search by group enum
* \sa searchGroups(const QStringList &groups, Transaction::Filters filters = Transaction::FilterNone)
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *searchGroup(Transaction::Group group, Transaction::Filters filters = Transaction::FilterNone);
@@ -777,7 +779,7 @@ public:
*
* \note This method emits \sa package()
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *searchGroups(Transaction::Groups group, Transaction::Filters filters = Transaction::FilterNone);
@@ -788,7 +790,7 @@ public:
*
* \note This method emits \sa package()
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *searchNames(const QStringList &search, Transaction::Filters filters = Transaction::FilterNone);
@@ -796,7 +798,7 @@ public:
* Convenience function to search by names
* \sa searchNames(const QStringList &search, Filters filters)
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *searchNames(const QString &search, Transaction::Filters filters = Transaction::FilterNone);
@@ -806,7 +808,7 @@ public:
* \p onlyTrusted indicates if this transaction is only allowed to install trusted packages
* \note This method emits \sa package() and \sa changed()
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *updatePackages(const QStringList &packageIDs, Transaction::TransactionFlags flags = Transaction::TransactionFlagOnlyTrusted);
@@ -814,7 +816,7 @@ public:
* Convenience function to update a package
* \sa updatePackages(const QStringList &packageIDs, TransactionFlags flags)
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *updatePackage(const QString &packageID, Transaction::TransactionFlags flags = Transaction::TransactionFlagOnlyTrusted);
@@ -823,7 +825,7 @@ public:
*
* \note This method emits \sa package()
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *whatProvides(const QStringList &search, Transaction::Filters filters = Transaction::FilterNone);
@@ -831,7 +833,7 @@ public:
* Convenience function to search for what provides
* \sa whatProvides(Provides type, const QStringList &search, Transaction::Filters filters = Transaction::FilterNone)
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
static Transaction *whatProvides(const QString &search, Transaction::Filters filters = Transaction::FilterNone);
diff --git a/src/daemonprivate.cpp b/src/daemonprivate.cpp
index 6a52f14..25ba55b 100644
--- a/src/daemonprivate.cpp
+++ b/src/daemonprivate.cpp
@@ -124,7 +124,7 @@ void DaemonPrivate::updateProperties(const QVariantMap &properties)
} else if (property == QLatin1String("DistroId")) {
distroId = value.toString();
} else if (property == QLatin1String("Filters")) {
- filters = static_cast<Transaction::Filters>(value.toULongLong());
+ filters = static_cast<Transaction::Filters>(value.toUInt());
} else if (property == QLatin1String("Groups")) {
groups = static_cast<Transaction::Groups>(value.toULongLong());
} else if (property == QLatin1String("Locked")) {
diff --git a/src/daemonprivate.h b/src/daemonprivate.h
index abc03a7..b8c2b6c 100644
--- a/src/daemonprivate.h
+++ b/src/daemonprivate.h
@@ -27,7 +27,7 @@
#include "daemon.h"
-class DaemonProxy;
+class OrgFreedesktopPackageKitInterface;
namespace PackageKit {
@@ -39,7 +39,7 @@ protected:
virtual ~DaemonPrivate() {}
Daemon *q_ptr;
- ::DaemonProxy *daemon;
+ ::OrgFreedesktopPackageKitInterface *daemon;
QStringList hints;
QStringList connectedSignals;
diff --git a/src/modules/packagekit-qt-config.cmake.in b/src/modules/packagekit-qt-config.cmake.in
index f9f4436..3dcf3f3 100644
--- a/src/modules/packagekit-qt-config.cmake.in
+++ b/src/modules/packagekit-qt-config.cmake.in
@@ -1,11 +1,10 @@
# - Config information for PackageKit-Qt at QT_VERSION@
# This file defines:
#
-# PackageKitQt at QT_VERSION@_INCLUDE_DIR - the PackageKitQt at QT_VERSION@ include directory
# PackageKitQt at QT_VERSION@_LIBRARIES - Link these to use PackageKitQt at QT_VERSION@
SET(prefix "@CMAKE_INSTALL_PREFIX@")
SET(exec_prefix "@CMAKE_INSTALL_PREFIX@")
-SET(PackageKitQt at QT_VERSION@_LIBRARIES "@PKQT_INSTALL_LIBDIR@/lib at LIBNAME@.so" CACHE FILEPATH "Libraries for PackageKitQt at QT_VERSION@")
-SET(PackageKitQt at QT_VERSION@_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include/PackageKit/@LIBNAME@" CACHE PATH "Include path for PackageKitQt at QT_VERSION@")
-SET(PackageKitQt at QT_VERSION@_FOUND "TRUE")
+SET(PackageKitQt at QT_VERSION@_LIBRARIES "PK::@LIBNAME@")
+
+include("${CMAKE_CURRENT_LIST_DIR}/PackageKitQtTargets.cmake")
diff --git a/src/packagekitqt4.pc.in b/src/packagekitqt4.pc.in
index 449bbe2..2030ff2 100755
--- a/src/packagekitqt4.pc.in
+++ b/src/packagekitqt4.pc.in
@@ -1,11 +1,11 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
-libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
-includedir=${prefix}/include
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
+includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
Name: @LIBNAME@
Description: PackageKit is a system daemon for installing stuff.
Version: @VERSION@
-Requires: QtCore, QtDBus, QtSql, QtXml
+Requires: QtCore, QtDBus, QtXml
Libs: -L${libdir} -l at LIBNAME@
Cflags: -I${includedir}/PackageKit/@LIBNAME@
diff --git a/src/packagekitqt5.pc.in b/src/packagekitqt5.pc.in
index 0b2f476..99ace5b 100644
--- a/src/packagekitqt5.pc.in
+++ b/src/packagekitqt5.pc.in
@@ -1,11 +1,11 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
-libdir=@PKQT_INSTALL_LIBDIR@
-includedir=${prefix}/include
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
+includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
Name: @LIBNAME@
Description: PackageKit is a system daemon for installing stuff.
Version: @VERSION@
-Requires: Qt5Core, Qt5DBus, Qt5Sql, Qt5Xml
+Requires: Qt5Core, Qt5DBus, Qt5Xml
Libs: -L${libdir} -l at LIBNAME@
Cflags: -I${includedir}/PackageKit/@LIBNAME@
diff --git a/src/transaction.cpp b/src/transaction.cpp
index 0ed97e1..7cfa302 100755
--- a/src/transaction.cpp
+++ b/src/transaction.cpp
@@ -26,7 +26,6 @@
#include "daemon.h"
#include "common.h"
-#include <QSqlQuery>
#include <QDBusError>
using namespace PackageKit;
@@ -215,37 +214,7 @@ QString Transaction::packageData(const QString &packageID)
QString Transaction::packageIcon(const QString &packageID)
{
- QString path;
- QSqlDatabase db = QSqlDatabase::database(PK_DESKTOP_DEFAULT_DATABASE);
- if (!db.isOpen()) {
- qDebug() << "Desktop files database is not open";
- return path;
- }
-
- QSqlQuery q(db);
- q.prepare("SELECT filename FROM cache WHERE package = :name");
- q.bindValue(":name", Transaction::packageName(packageID));
- if (q.exec()) {
- if (q.next()) {
- QFile desktopFile(q.value(0).toString());
- if (desktopFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
- while (!desktopFile.atEnd()) {
- QByteArray line = desktopFile.readLine().trimmed();
- if (line.startsWith("Icon=")) {
- path = line.mid(5);
- break;
- }
- }
- desktopFile.close();
- } else {
- qDebug() << "Cannot open desktop file " << q.value(0).toString();
- }
- }
- } else {
- qDebug() << "Error while running query " << q.executedQuery();
- }
-
- return path;
+ return QString();
}
QString Transaction::lastPackage() const
diff --git a/src/transaction.h b/src/transaction.h
index 2b03f41..51ac1d0 100644
--- a/src/transaction.h
+++ b/src/transaction.h
@@ -140,7 +140,6 @@ public:
RoleGetDistroUpgrades,
RoleGetCategories,
RoleGetOldTransactions,
- RoleUpgradeSystem, // Since 0.6.11
RoleRepairSystem, // Since 0.7.2
RoleGetDetailsLocal, // Since 0.8.17
RoleGetFilesLocal, // Since 0.9.1
@@ -650,7 +649,7 @@ public:
/**
* Cancels the transaction
*
- * \warning check \sa error() to know if it the call has any error
+ * \warning check \sa errorCode() signal to know if it the call has any error
*/
Q_INVOKABLE QDBusPendingReply<> cancel();
@@ -676,8 +675,10 @@ public:
/**
* Returns the package icon from the \p packageID
+ *
+ * @deprecated use Appstream to fetch icons
*/
- static QString packageIcon(const QString &packageID);
+ static QT_DEPRECATED QString packageIcon(const QString &packageID);
Q_SIGNALS:
void allowCancelChanged();
diff --git a/src/transactionprivate.cpp b/src/transactionprivate.cpp
index 7a87aec..2c73899 100644
--- a/src/transactionprivate.cpp
+++ b/src/transactionprivate.cpp
@@ -46,10 +46,10 @@ void TransactionPrivate::setup(const QDBusObjectPath &transactionId)
Q_Q(Transaction);
tid = transactionId;
- p = new TransactionProxy(QLatin1String(PK_NAME),
- tid.path(),
- QDBusConnection::systemBus(),
- q);
+ p = new OrgFreedesktopPackageKitTransactionInterface(QLatin1String(PK_NAME),
+ tid.path(),
+ QDBusConnection::systemBus(),
+ q);
if (!Daemon::global()->hints().isEmpty()) {
q->setHints(Daemon::global()->hints());
}
@@ -329,7 +329,7 @@ void TransactionPrivate::updateProperties(const QVariantMap &properties)
status = static_cast<Transaction::Status>(value.toUInt());
QMetaObject::invokeMethod(q, "statusChanged", Qt::QueuedConnection);
} else if (property == QLatin1String("TransactionFlags")) {
- transactionFlags = static_cast<Transaction::TransactionFlags>(value.toULongLong());
+ transactionFlags = static_cast<Transaction::TransactionFlags>(value.toUInt());
QMetaObject::invokeMethod(q, "transactionFlagsChanged", Qt::QueuedConnection);
} else if (property == QLatin1String("Uid")) {
uid = value.toUInt();
diff --git a/src/transactionprivate.h b/src/transactionprivate.h
index 895cfac..72860d8 100644
--- a/src/transactionprivate.h
+++ b/src/transactionprivate.h
@@ -29,7 +29,7 @@
#include "transaction.h"
-class TransactionProxy;
+class OrgFreedesktopPackageKitTransactionInterface;
namespace PackageKit {
@@ -45,7 +45,7 @@ protected:
void runQueuedTransaction();
QDBusObjectPath tid;
- ::TransactionProxy* p = 0;
+ ::OrgFreedesktopPackageKitTransactionInterface* p = 0;
Transaction *q_ptr;
QStringList connectedSignals;
More information about the Neon-commits
mailing list