Skip to content

Catch up with changes in the Offline results interface #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 2 additions & 26 deletions src/offline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,38 +131,14 @@ QDBusPendingReply<> Offline::triggerUpgrade(Action action)
return QDBusConnection::systemBus().asyncCall(msg, 24 * 60 * 1000 * 1000);
}

QDBusPendingReply<bool> Offline::getResult()
QDBusPendingReply<bool, QStringList, Transaction::Role, qint64, Transaction::Error, QString> Offline::getResults()
{
// Manually invoke dbus because the qdbusxml2cpp does not allow
// setting the ALLOW_INTERACTIVE_AUTHORIZATION flag
auto msg = QDBusMessage::createMethodCall(PK_NAME,
PK_PATH,
PK_OFFLINE_INTERFACE,
QStringLiteral("GetResult"));
msg.setInteractiveAuthorizationAllowed(true);
return QDBusConnection::systemBus().asyncCall(msg, 24 * 60 * 1000 * 1000);
}

QDBusPendingReply<QStringList> Offline::getResultPackages()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove this method? not up2date with current API but this is now an undefined method since it still in the .h

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That one was merged too quickly before the upstream API was finalized, so editing it is good actually...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I fixed the header too.

{
// Manually invoke dbus because the qdbusxml2cpp does not allow
// setting the ALLOW_INTERACTIVE_AUTHORIZATION flag
auto msg = QDBusMessage::createMethodCall(PK_NAME,
PK_PATH,
PK_OFFLINE_INTERFACE,
QStringLiteral("GetResultPackages"));
msg.setInteractiveAuthorizationAllowed(true);
return QDBusConnection::systemBus().asyncCall(msg, 24 * 60 * 1000 * 1000);
}

QDBusPendingReply<QString, QString> Offline::getResultError()
{
// Manually invoke dbus because the qdbusxml2cpp does not allow
// setting the ALLOW_INTERACTIVE_AUTHORIZATION flag
auto msg = QDBusMessage::createMethodCall(PK_NAME,
PK_PATH,
PK_OFFLINE_INTERFACE,
QStringLiteral("GetResultError"));
QStringLiteral("GetResults"));
msg.setInteractiveAuthorizationAllowed(true);
return QDBusConnection::systemBus().asyncCall(msg, 24 * 60 * 1000 * 1000);
}
Expand Down
17 changes: 4 additions & 13 deletions src/offline.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include <QDBusPendingReply>
#include <QVariantMap>

#include <Transaction>

#include <packagekitqt_global.h>

namespace PackageKit {
Expand Down Expand Up @@ -100,20 +102,9 @@ class PACKAGEKITQT_LIBRARY Offline : public QObject
QDBusPendingReply<> triggerUpgrade(Action action);

/**
* Returns if the last offline action was completed successfully.
*/
QDBusPendingReply<bool> getResult();

/**
* Returns a list of packages that were updated during the last offline action.
*/
QDBusPendingReply<QStringList> getResultPackages();

/**
* Returns the error if the last offline action has failed. The first returned
* string is a PackageKit error code. The second one is a textual description.
* Returns the information about the last offline action performed.
*/
QDBusPendingReply<QString, QString> getResultError();
QDBusPendingReply<bool, QStringList, Transaction::Role, qint64, Transaction::Error, QString> getResults();

/**
* Cancels the offline update so the next boot procceeds as normal.
Expand Down