summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/packagemanagercore.cpp
diff options
context:
space:
mode:
authorkh <karsten.heimrich@theqtcompany.com>2014-11-24 17:39:06 +0100
committerKarsten Heimrich <karsten.heimrich@theqtcompany.com>2014-11-26 14:49:23 +0100
commit64d49f097f25dd019345a7e913e1c4cf8188e168 (patch)
treeda6670298b59bd04db7d1f5dc62a9ceb79082b7b /src/libs/installer/packagemanagercore.cpp
parentd18b9696e573aa7b3f38784f6c5764b9fe6fd81b (diff)
Implement a way to start the server in debug mode and API cleanup.
1; Passing debug as first argument to the starting server does not start the server side so the server keeps running in an endless loop. This makes it far easier to attach a debugger. 2; API cleanup and unify init function to take port, key, and mode. The address was never able to be changed anyway, so stop passing them around. Change-Id: I2a847f009ed1557a5e136e2b0006de5c62426da2 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Diffstat (limited to 'src/libs/installer/packagemanagercore.cpp')
-rw-r--r--src/libs/installer/packagemanagercore.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp
index 494b8b486..abff0bafa 100644
--- a/src/libs/installer/packagemanagercore.cpp
+++ b/src/libs/installer/packagemanagercore.cpp
@@ -690,15 +690,19 @@ PackageManagerCore::PackageManagerCore()
qRegisterMetaType<QInstaller::PackageManagerCore::WizardPage>("QInstaller::PackageManagerCore::WizardPage");
}
-PackageManagerCore::PackageManagerCore(qint64 magicmaker, const QList<OperationBlob> &operations)
+PackageManagerCore::PackageManagerCore(qint64 magicmaker, const QList<OperationBlob> &operations,
+ quint16 port, const QString &key, Protocol::Mode mode)
: d(new PackageManagerCorePrivate(this, magicmaker, operations))
{
Repository::registerMetaType(); // register, cause we stream the type as QVariant
qRegisterMetaType<QInstaller::PackageManagerCore::Status>("QInstaller::PackageManagerCore::Status");
qRegisterMetaType<QInstaller::PackageManagerCore::WizardPage>("QInstaller::PackageManagerCore::WizardPage");
- d->initialize(QHash<QString, QString>());
+ // Creates and initializes a remote client, makes us get admin rights for QFile, QSettings
+ // and QProcess operations. Init needs to called to set the server side authorization key.
+ RemoteClient::instance().init(port, key, mode, Protocol::StartAs::SuperUser);
+ d->initialize(QHash<QString, QString>());
//
// Sanity check to detect a broken installations with missing operations.