Commit 1af2e20f authored by Raine Makelainen's avatar Raine Makelainen

[developermode] Change developermode enabling on top PackageKit-Qt. Contributes to JB#41708

parent 6e6e3b25
This diff is collapsed.
......@@ -35,9 +35,10 @@
#include <QObject>
#include <QDBusInterface>
#include <QDBusObjectPath>
#include <systemsettingsglobal.h>
#include <daemon.h>
QT_BEGIN_NAMESPACE
class QDBusPendingCallWatcher;
......@@ -86,6 +87,7 @@ public:
enum Status {
Idle = 0,
InitialCheckingStatus,
CheckingStatus,
Preparing,
DownloadingPackages,
......@@ -106,6 +108,7 @@ public:
Q_INVOKABLE void setRemoteLogin(bool enabled);
Q_INVOKABLE void setUsbIpAddress(const QString &usbIpAddress);
Q_INVOKABLE void refresh();
Q_INVOKABLE void checkDeveloperModeStatus();
signals:
void wlanIpAddressChanged();
......@@ -116,31 +119,27 @@ signals:
void workerWorkingChanged();
void workerStatusChanged();
void workerProgressChanged();
void packageCacheUpdated();
private slots:
void transactionPackage(uint info, const QString &packageId);
void transactionErrorCode(uint code, const QString &message);
void transactionFinished(uint exit, uint runtime);
void transactionPropertiesChanged(const QString &interface, const QVariantMap &changed, const QStringList &invalidated);
void transactionPackage(PackageKit::Transaction::Info info, const QString &packageId, const QString &summary);
void transactionErrorCode(PackageKit::Transaction::Error code, const QString &details);
void transactionFinished(PackageKit::Transaction::Exit status, uint runtime);
void updateState(int percentage, PackageKit::Transaction::Status status, PackageKit::Transaction::Role role);
private:
QDBusPendingCallWatcher *resolvePackageId(const QString &packageName);
QDBusPendingCallWatcher *installPackage(const QString &packageId);
QDBusPendingCallWatcher *removePackage(const QString &packageId);
void connectTransactionSignal(const QString &name, const char *slot);
void connectPropertiesChanged();
enum Command {
NoCommand,
InstallCommand,
RemoveCommand
};
void executePackageKitCommand(
QDBusPendingCallWatcher *(DeveloperModeSettings::*command)(const QString &),
const QString &argument);
void refreshPackageCache();
void resolveDeveloperModePackageId(Command command);
void connectCommandSignals(PackageKit::Transaction *transaction);
void checkDeveloperModeStatus(bool initial);
QDBusInterface m_usbModeDaemon;
QDBusObjectPath m_packageKitTransaction;
QDBusPendingCallWatcher *m_pendingPackageKitCall;
QDBusPendingCallWatcher *(DeveloperModeSettings::*m_packageKitCommand)(const QString &packageId);
QList<int> m_statusChanges;
QString m_wlanIpAddress;
QString m_usbInterface;
QString m_usbIpAddress;
......@@ -150,9 +149,9 @@ private:
bool m_remoteLoginEnabled;
DeveloperModeSettings::Status m_workerStatus;
int m_workerProgress;
int m_transactionRole;
int m_transactionStatus;
PackageKit::Transaction::Role m_transactionRole;
PackageKit::Transaction::Status m_transactionStatus;
bool m_cacheUpdated;
};
Q_DECLARE_METATYPE(DeveloperModeSettings::Status);
......
......@@ -6,7 +6,7 @@ CONFIG += qt plugin c++11 hide_symbols link_pkgconfig
QT += qml dbus network
QT -= gui
PKGCONFIG += profile usb-moded-qt5 nemomodels-qt5 libsailfishkeyprovider connman-qt5
PKGCONFIG += profile usb-moded-qt5 nemomodels-qt5 libsailfishkeyprovider connman-qt5 packagekitqt5
target.path = $$[QT_INSTALL_QML]/$$PLUGIN_IMPORT_PATH
INSTALLS += target
......
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