Giter Club home page Giter Club logo

packagekit-qt's Introduction

packagekit-qt's People

Contributors

1maxnet1 avatar aleasto avatar aleixpol avatar blumia avatar catericka avatar conan-kudo avatar dantti avatar hughsie avatar krop avatar monterrabyte avatar nicolasfella avatar pvuorela avatar rainemak avatar ximion avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

packagekit-qt's Issues

Static methods of Transaction could return QStringView instead of allocating a new QString

All of the following methods do not modify the input string, and neither do they construct a new string from any concatenations that would justify the allocation of a new QString:

src/transaction.h:

    /**
     * Returns the package name from the \p packageID
     */
    static QString packageName(const QString &packageID);

    /**
     * Returns the package version from the \p packageID
     */
    static QString packageVersion(const QString &packageID);

    /**
     * Returns the package arch from the \p packageID
     */
    static QString packageArch(const QString &packageID);

    /**
     * Returns the package data from the \p packageID
     */
    static QString packageData(const QString &packageID);

In KDE/Plasma Discover there is a copy-pasta of packageName method for the sake of performance improvement. Here's a copy of that comment of top:

// Copy of Transaction::packageName that doesn't create a copy but just pass a reference
// It's an optimisation as there's a bunch of allocations that happen from packageName
// Having packageName return a QStringRef or a QStringView would fix this issue.
// TODO Qt 6: Have packageName and similars return a QStringView

Changing it in packagekit-qt now would be an ABI brakage, and you can't overload by return types in C++. But it should at least still be mostly API-compatible, as QStringView implicitly converts to QString when needed.

Alternatively, we could overloaded counterparts for all those methods which both take and return a string view. That would require explicit porting in apps, if they want to take advantage of performance gains.

Missing PackageKit::Transaction::message signal

I'm getting this error message. Has it disappeared from the PackageKit spec?

QObject::connect: No such signal OrgFreedesktopPackageKitTransactionInterface::Message(uint,QString) in /home/apol/devel/frameworks/PackageKit-Qt/src/transaction.cpp:120

kded crashes due to a use-after-free in current Debian bookworm/testing

Hello, I was investigating a bug report in Debian
and could track it down to a use-after-free of a PackageKit::Transaction object.
The free, as far as I see, is done inside the Qt library because of a QDeferredDeleteEvent which was
created because of a call to TransactionPrivate::finished, while still in the constructor of the PackageKit::Transaction object.

A bug report in KDE states this could be an issue of packagekit-qt.
Could you please have a look if that is the case?

A shortened valgrind log follows for searchability, see the Debian bug for complete backtraces.
The matching packaged source code of packagekit-qt is available here.

==12351== Invalid read of size 8
==12351==    at 0x27458BA0: PackageKit::Transaction::role() const (transaction.cpp:297)
==12351==    by 0x273B6AAD: TransactionWatcher::watchTransaction(QDBusObjectPath const&, bool) (TransactionWatcher.cpp:104)
==12351==    by 0x273B6B98: TransactionWatcher::transactionListChanged(QStringList const&) (TransactionWatcher.cpp:85)
==12351==    by 0x5B59FCE: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.7)
==12351==    by 0x2744C094: PackageKit::Daemon::transactionListChanged(QStringList const&) (moc_daemon.cpp:419)
==12351==    by 0x5B59FFB: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.7)
==12351==    by 0x27464B37: TransactionListChanged (daemonproxy.moc:331)
...
==12351==  Address 0x1a6a2a10 is 16 bytes inside a block of size 24 free'd
==12351==    at 0x484371B: operator delete(void*) (vg_replace_malloc.c:923)
==12351==    by 0x5B4E53E: QObject::event(QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.7)
==12351==    by 0x49CAF5D: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.7)
==12351==    by 0x5B227C7: QCoreApplication::notifyInternal2(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.7)
==12351==    by 0x5B25760: QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.7)
...
==12351==  Block was alloc'd at
==12351==    at 0x4840F2F: operator new(unsigned long) (vg_replace_malloc.c:422)
==12351==    by 0x273B693B: TransactionWatcher::watchTransaction(QDBusObjectPath const&, bool) (TransactionWatcher.cpp:95)
==12351==    by 0x273B6B98: TransactionWatcher::transactionListChanged(QStringList const&) (TransactionWatcher.cpp:85)
==12351==    by 0x5B59FCE: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.7)
==12351==    by 0x2744C094: PackageKit::Daemon::transactionListChanged(QStringList const&) (moc_daemon.cpp:419)
==12351==    by 0x5B59FFB: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.7)
==12351==    by 0x27464B37: TransactionListChanged (daemonproxy.moc:331)
==12351==    by 0x27464B37: OrgFreedesktopPackageKitInterface::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (daemonproxy.moc:178)
...

Daemon::searchFiles() transaction missing finished() signal when searching not-matched result

Minimum reproduce code snip:

        PackageKit::Transaction * tx = PackageKit::Daemon::global()->searchFiles(desktopFilePath, PackageKit::Transaction::FilterInstalled);
        connect(tx, &PackageKit::Transaction::package, this, [](PackageKit::Transaction::Info info, const QString &packageID, const QString &summary){
            qDebug() << packageID << summary << info;
        });
        connect(tx, &PackageKit::Transaction::errorCode, this, [](PackageKit::Transaction::Error error, const QString &details){
            qDebug() << error << details;
        });
        connect(tx, &PackageKit::Transaction::finished, this, [](PackageKit::Transaction::Exit status, uint runtime){
            qDebug() << status << runtime;
        });
        connect(tx, &PackageKit::Transaction::statusChanged, this, [tx](){
            qDebug() << tx->status();
        });

When searching file path (desktopFilePath) which can confirm it belongs to a curtain package, we'll find both of these signals will be emitted, but when searching file path that doesn't exist (can be a random string, like /path/does/not/exist, none of these signals will be emitted.

Also, this behavior seems different with the pkcon cli util. We can use pkmon to monitor the related behavior. If using the above code, pkcon will output nothing if the searched string cannot match existing packages, but if we use pkcon search file /path/does/not/exist then pkmon will have result even if it doesn't match to any package (which is the expected behavior).

Tested under Archlinux with its alpm backend, package version:

$ LANG=C pacman -Qi packagekit
Name            : packagekit
Version         : 1.2.6-2
Description     : A system designed to make installation and updates of
                  packages easier
Architecture    : x86_64
URL             : https://www.freedesktop.org/software/PackageKit/
Licenses        : GPL
Groups          : None
Provides        : None
Depends On      : libpackagekit-glib  pacman>=6.0.0  polkit  sqlite
Optional Deps   : bash-completion: command completion in bash [installed]
Required By     : packagekit-qt5
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 2.45 MiB
Packager        : Felix Yan <[email protected]>
Build Date      : 2023
Install Date    : 2023
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

$ LANG=C pacman -Qi packagekit-qt5 
Name            : packagekit-qt5
Version         : 1.1.1-1
Description     : Qt5 bindings for PackageKit
Architecture    : x86_64
URL             : http://www.packagekit.org/
Licenses        : LGPL
Groups          : None
Provides        : None
Depends On      : packagekit  qt5-base
Optional Deps   : None
Required By     : apper  deepin-store
Optional For    : discover  frameworkintegration  plasma-desktop
Conflicts With  : None
Replaces        : None
Installed Size  : 347.97 KiB
Packager        : Antonio Rojas <[email protected]>
Build Date      : 2023
Install Date    : 2023
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature

Let me know if you need any additional information. Thanks!

_IMPORT_PREFIX not set(?)

PackageKit-Qt Qt5 port don't set _IMPORT_PREFIX variable

CMake Error in applets/kicker/CMakeLists.txt:
  Imported target "PK::packagekitqt5" includes non-existent path

```
"/include/packagekitqt5/PackageKit/"
```

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:
- The path was deleted, renamed, or moved to another location.
- An install or uninstall procedure did not complete successfully.
- The installation package was faulty and references files it does not
  provide.

greetings

Can't build

Sorry for the noob issue, but what should I do? (On Debian Jessie)

๐Ÿ‘Ž error: No rule to make target '/home/burak/bin/PackageKit-Qt/src/PK_INTERFACES_DIR-NOTFOUND/org.freedesktop.PackageKit.Transaction.xml', needed by 'src/transactionproxy.cpp'. Stop.

PackageKitQt doesn't compile

Possibly for changes in PackageKit

FAILED: src/daemonproxy.cpp src/daemonproxy.h 
cd /home/apol/build-devel/frameworks/PackageKit-Qt/src && /home/apol/devel/kde5/bin/qdbusxml2cpp -N -m -p daemonproxy /usr/share/dbus-1/interfaces/org.freedesktop.PackageKit.xml
Got unknown type `a{sv}'
You should add <annotation name="org.qtproject.QtDBus.QtTypeName" value="<type>"/> to the XML description

source verification

Now that source tarballs are suppose to be downloaded from github... Any chance to upload file signatures at least? Would be nice if packagers could verify file integrity. Thanks!

[qmake] Is building with qmake possible?

Hello!
Is building with qmake possible?

I'm taking packagekit-qt5 package from manjaro/archlinux and trying to use it with cmake projects like kde's apper -- successfully.

And then trying qmake-based project with:

CONFIG += c++11 hide_symbols link_pkgconfig
PKGCONFIG += packagekitqt5
...

and getting compilation error about missing headers:

#include <packagekitqt_global.h>

The workaround is probably to change includes to "packagekitqt_global.h" but I'm not a pro with the build systems.
Any hints what to check twice it's not my system env/compile flag problems?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.