Commit 7d3af61e authored by Lukas Appelhans's avatar Lukas Appelhans

Fix progress reporting

parent 5255dfff
......@@ -32,10 +32,14 @@ libarchive++/polkitarchivehandler.cpp
set(AKABEI_OPERATION_SRCS
operations/akabeiplainhookoperation.cpp
operations/akabeiplainreinstalloperation.cpp
operations/akabeipolkitreinstalloperation.cpp
operations/akabeiplaininstalloperation.cpp
operations/akabeiplainremoveoperation.cpp
operations/akabeipolkitremoveoperation.cpp
operations/akabeiplainscriptletoperation.cpp
operations/akabeiplainupgradeoperation.cpp
operations/akabeipolkitupgradeoperation.cpp
operations/akabeipolkitinstalloperation.cpp
operations/akabeioperationutils.cpp
)
......@@ -70,10 +74,14 @@ libarchive++/polkitarchivehandler.h
set(AKABEI_OPERATION_HDRS
operations/akabeiplainreinstalloperation.h
operations/akabeipolkitreinstalloperation.h
operations/akabeiplaininstalloperation.h
operations/akabeipolkitinstalloperation.h
operations/akabeiplainremoveoperation.h
operations/akabeipolkitremoveoperation.h
operations/akabeiplainscriptletoperation.h
operations/akabeiplainupgradeoperation.h
operations/akabeipolkitupgradeoperation.h
operations/akabeiplainhookoperation.h
operations/akabeioperationutils.h
)
......
......@@ -91,6 +91,8 @@ SQLiteResource PolKitSQLiteConnection::query(const QString &q)
d->lastQueryDBus = true;
if (!mes.arguments().isEmpty()) {
const QDBusArgument arg = mes.arguments().first().value<QDBusArgument>();
if (arg.currentType() == QDBusArgument::UnknownType)
return SQLiteResource(QList<Row>());
QList<QVariantMap> list;
arg >> list;
return SQLiteResource(list);
......
......@@ -501,6 +501,7 @@ Backend::Backend(QObject* parent)
: QObject(parent)
, d_ptr(new BackendPrivate(this))
{
qDebug() << "We are running in threadSSSSSSSSSSSSSSSSSSSSSSSSS" << QThread::currentThread();
Q_ASSERT(!s_globalBackend()->q);
s_globalBackend()->q = this;
qRegisterMetaType<QUuid>();
......@@ -534,6 +535,7 @@ void Backend::initialize()
{
Q_D(Backend);
QWriteLocker locker(d->mutex);
qDebug() << "We are running in threadSSSSSSSSSSSSSSSSSSSSSSSSS" << QThread::currentThread();
setStatus(Backend::StatusInitializing);
......
......@@ -14,6 +14,7 @@
#include <akabeidatabase.h>
#include <akabeipackage.h>
#include <akabeiconfig.h>
#include <akabeihelpers.h>
#include <utime.h>
#include <libarchive++/archivehandler.h>
......@@ -181,7 +182,7 @@ QStringList Cache::getPackagesByName(const QString &pkg) const
*/
bool Cache::writePackage(const QString &path, const QString &newName)
{
if (path != newName && !QFile::copy(path, d->cachedir.absoluteFilePath(newName))) {
if (path != newName && !Helpers::copyFile(path, d->cachedir.absoluteFilePath(newName))) { //FIXME: Port to polkit
d->error = "Could not copy \"" + path + "\" to cache.\n";
return false;
}
......@@ -246,10 +247,8 @@ bool Cache::Private::cleanNotInstalled()
database.bind(":Filename", file.split("/").last());
SQLiteResource res = database.query( Queries::selectPackages("filename", "=", ":Filename") );
if (res.getRowsCount() == 0) {
QFile f(file);
if (!f.remove()) {
error = f.errorString();
if (!Helpers::removeFile(file)) {
error = QObject::tr("Failed to remove file!");
return false;
}
}
......@@ -284,10 +283,8 @@ bool Cache::Private::cleanConditional(RemoveCriteria criteria, bool half)
continue;
}
QFile file(pair.value());
if (!file.remove()) {
error = file.errorString();
if (!Helpers::removeFile(pair.value())) {
error = QObject::tr("Failed to remove file!");
return false;
}
}
......@@ -304,9 +301,8 @@ bool Cache::Private::cleanAll()
continue;
}
QFile f(cachedir.absoluteFilePath(file));
if (!f.remove()) {
error = f.errorString();
if (!Helpers::removeFile(cachedir.absoluteFilePath(file))) {
error = QObject::tr("Failed to remove file!");
return false;
}
}
......
......@@ -353,7 +353,25 @@ bool removeFile(const QString &file)
if (!mes.arguments().isEmpty())
return mes.arguments().first().toBool();
} else {
qDebug() << "Authorization not granted" << PolkitQt1::Authority::instance()->errorDetails();
Akabei::ErrorQueue::instance()->appendError(Akabei::Error(Akabei::Error::PermissionError, PolkitQt1::Authority::instance()->errorDetails()));
}
return false;
}
bool copyFile(const QString &source, const QString &destination)
{
if (!Akabei::Config::instance()->needsPrivileges())
return QFile::copy(source, destination);
if (Helpers::checkAuthorizationSync("org.chakraproject.akabeicorehelper.filesystem.copy")) {
qDebug() << "Authorization granted";
QDBusInterface iface("org.chakraproject.akabeicorehelper", "/filesystem", "org.chakraproject.akabeicorehelper.filesystem", QDBusConnection::systemBus());
QDBusMessage mes = iface.call("copy", source, destination);
if (!mes.arguments().isEmpty())
return mes.arguments().first().toBool();
} else {
Akabei::ErrorQueue::instance()->appendError(Akabei::Error(Akabei::Error::PermissionError, PolkitQt1::Authority::instance()->errorDetails()));
}
return false;
}
......
......@@ -50,6 +50,7 @@ QString unversionedTarget(const QString &target);
Package *latestVersionOfPackage(QString const& pkgName);
bool removeFile(const QString &file);
bool copyFile(const QString &source, const QString &destination);
Permissions permissionsOfPath(const QString &path);
......
......@@ -14,6 +14,8 @@
#include <akabeibackend.h>
#include <QEventLoop>
#include <QDebug>
#include <QCoreApplication>
namespace Akabei {
......@@ -34,6 +36,9 @@ void OperationPrivate::concurrentValidate()
status = Operation::StatusValidating;
q->validate();
if (status == Operation::StatusValidating) {
//runLoop.data()->processEvents();
//QCoreApplication::processEvents();
//QCoreApplication::sendPostedEvents();
validateLoop.data()->exec();
}
validateLoop.data()->deleteLater();
......@@ -42,10 +47,16 @@ void OperationPrivate::concurrentValidate()
void OperationPrivate::concurrentRun()
{
Q_Q(Operation);
//QEventLoop loop;
runLoop = new QEventLoop;
setStatus(Operation::StatusRunning);
q->run();
q->run();//FIXME: Try to catch all events posted from and to the operation and redo them with the eventloop
qDebug() << "Start event loop from?!" << q->description() << QTime::currentTime().msec();
if (status == Operation::StatusRunning) {
qDebug() << "Really start it";
//runLoop.data()->processEvents();
//QCoreApplication::processEvents();
//QCoreApplication::sendPostedEvents();
runLoop.data()->exec();
}
runLoop.data()->deleteLater();
......@@ -265,7 +276,8 @@ void Operation::setProgress(int percentage)
{
Q_D(Operation);
if (d->runner) {
d->runner->d_func()->emitProgress(this, percentage);
qDebug() << "Start emit progress at" << QTime::currentTime().toString();
d->runner->d_func()->emitProgress(this, qBound(0, percentage, 100));
}
}
......@@ -284,6 +296,7 @@ void Operation::setFinished(bool result)
d->runner->d_func()->emitFinished(this, result);
}
if (!d->runLoop.isNull()) {
qDebug() << "Quit event loop";
d->runLoop.data()->quit();
}
}
......
......@@ -17,6 +17,7 @@
#include <akabeibackend_p.h>
#include <QThreadPool>
#include <QDebug>
namespace Akabei
{
......@@ -65,6 +66,7 @@ void OperationRunnerPrivate::emitProgress(Operation *op, int progress)
if (antiFlicker.elapsed() <= 300 && progress < 100) {
return;
}
qDebug() << "Emitted" << progress << QTime::currentTime().toString();
antiFlicker.restart();
Q_Q(OperationRunner);
......@@ -113,6 +115,8 @@ OperationRunner::OperationRunner(QObject *parent)
// Start the antiflicker
Q_D(OperationRunner);
d->antiFlicker.start();
qDebug() << "Current thread in oprunner is" << QThread::currentThread();
}
OperationRunner::~OperationRunner()
......
......@@ -36,7 +36,6 @@ RunnerWorker::~RunnerWorker()
}
bool RunnerWorker::runSingle(Operation* op)
{
OperationPrivate *opPr = RunnerWorker::operationPrivateProxy(op);
......
......@@ -38,64 +38,6 @@ protected:
ArchiveHandler &m_handle;
};
/**
* @class PolKitEntryHandlerFunctor
* @brief represents a generic operation to perform on archive entries via the polkit helper.
*/
class PolKitEntryHandlerFunctor
{
public:
PolKitEntryHandlerFunctor(Akabei::Operation *, PolKitArchiveHandler &);
void runFunctor();
virtual void newMessage(const QString &archive, const QString &message) = 0;
virtual void updateProgress(const QString &archive, int progress) = 0;
protected:
virtual void run() = 0;
Akabei::Operation *m_caller;
PolKitArchiveHandler &m_handle;
};
/**
* @class PolKitInstallFunctor
* @extends PolKitEntryHandlerFunctor
* @brief performs the operations needed on archive entries during an installation via polkit.
*/
class PolKitInstallFunctor : public PolKitEntryHandlerFunctor
{
public:
PolKitInstallFunctor(QMap<QString, QString> &, Akabei::Operation *, PolKitArchiveHandler &);
void run();
void newMessage(const QString &archive, const QString &message);
void updateProgress(const QString &archive, int progress);
private:
QVariantMap backup;
};
/**
* @class PolKitReinstallUpgradeFunctor
* @extends PolKitEntryHandlerFunctor
* @brief perform the operations needed on archive entries during a reinstallation or an upgrade via polkit.
*/
class PolKitReinstallUpgradeFunctor : public PolKitEntryHandlerFunctor
{
public:
PolKitReinstallUpgradeFunctor(QMap<QString, QString> &, Akabei::Operation *, PolKitArchiveHandler &);
void run();
void newMessage(const QString &archive, const QString &message);
void updateProgress(const QString &archive, int progress);
private:
QVariantMap backup;
};
/**
* @class InstallFunctor
* @extends EntryHandlerFunctor
......
......@@ -15,6 +15,7 @@
#include <QDBusInterface>
#include <QVariantMap>
#include <qmetaobject.h>
#include <QTimer>
#include <akabeiconfig.h>
#include <akabeihelpers.h>
#include <PolkitQt1/Authority>
......@@ -26,7 +27,7 @@
class PolKitArchiveHandler::Private
{
public:
Private(const QString &file) : filename(file), readLocally(true), handler(0), functor(0) {
Private(const QString &file, PolKitArchiveHandler * parent) : filename(file), readLocally(true), handler(0), q(parent) {
readLocally = Akabei::Helpers::permissionsOfPath(file).testFlag(Akabei::Helpers::ReadPermission);//We check whether we have at least read access to the archive
handler = new ArchiveHandler(file);
......@@ -40,20 +41,20 @@ public:
void __k__newMessage(const QString&, const QString&);
void __k__updateProgress(const QString&, int);
void __k__finished(const QString &);
QString filename;
bool readLocally;
ArchiveHandler * handler;
Akabei::Error::List errors;
Akabei::PolKitEntryHandlerFunctor * functor;
QDBusInterface * iface;
QEventLoop * loop;
PolKitArchiveHandler * q;
};
//TODO: Just connect once to the dbusinterface, and just keep the connection in tact for the whole time
PolKitArchiveHandler::PolKitArchiveHandler(const QString &f, QObject * parent)
: QObject(parent),
d(new Private(f))
d(new Private(f, this))
{
}
......@@ -224,39 +225,6 @@ void PolKitArchiveHandler::extractAll(const QString& pathPrefix, bool overwrite)
}
}
void PolKitArchiveHandler::handleEntries(Akabei::PolKitEntryHandlerFunctor& handler)
{
//TODO: Reuse this interface in the handlers, give it as parameter
//if (!Akabei::Config::instance()->needsPrivileges())
// d->handler->handleEntries();//WHAT TO DO HERE WITH THAT SHIT?!
/*Okay we have 2 ways of implementing this:
a) the current way, aka we call extract() each time the operator() is called
the downside of this is that we need to transfer massive amounts of data over dbus
b) the other way would be to handle all that is necessary for the installation to go correctly
(move old configs etc) before the actual extraction, after that we can simply call install() in the helper
the downside here would be that we need all the information before hand (but this is the chosen way)*/
d->functor = &handler;
connect(d->iface, SIGNAL(updateProgress(QString, int)), SLOT(__k__updateProgress(QString, int)));
connect(d->iface, SIGNAL(newMessage(QString, QString)), SLOT(__k__newMessage(QString, QString)));
handler.runFunctor();
disconnect(d->iface, SIGNAL(updateProgress(QString, int)), this, SLOT(__k__updateProgress(QString, int)));
disconnect(d->iface, SIGNAL(newMessage(QString, QString)), this, SLOT(__k__newMessage(QString, QString)));
}
void PolKitArchiveHandler::Private::__k__updateProgress(const QString &archive, int progress)
{
qDebug() << "PROGRESS" << archive << progress;
if (archive == filename)
functor->updateProgress(archive, progress);
}
void PolKitArchiveHandler::Private::__k__newMessage(const QString &archive, const QString &message)
{
qDebug() << "MESSAGE" << archive << message;
if (archive == filename)
functor->newMessage(archive, message);
}
QList<QByteArray> PolKitArchiveHandler::md5(const QStringList& files)
{
if (!Akabei::Config::instance()->needsPrivileges() || d->readLocally)
......@@ -312,84 +280,5 @@ Akabei::Error::List PolKitArchiveHandler::errors()
return errs;
}
namespace Akabei {
PolKitEntryHandlerFunctor::PolKitEntryHandlerFunctor(Akabei::Operation *op, PolKitArchiveHandler &handler)
: m_caller(op),
m_handle(handler)
{
}
void PolKitEntryHandlerFunctor::runFunctor()
{
run();
}
PolKitInstallFunctor::PolKitInstallFunctor(QMap<QString, QString> &b, Akabei::Operation * operation, PolKitArchiveHandler &handle)
: PolKitEntryHandlerFunctor(operation, handle)
{
foreach (const QString &k, b)
backup.insert(k, b[k]);
}
void PolKitInstallFunctor::run()
{
if (Akabei::Helpers::checkAuthorizationSync("org.chakraproject.akabeicorehelper.archive.extract")) {
qDebug() << "Authorization granted";
QDBusInterface iface("org.chakraproject.akabeicorehelper", "/archive", "org.chakraproject.akabeicorehelper.archive", QDBusConnection::systemBus());
iface.setProperty("filename", m_handle.filename());
QDBusMessage mes = iface.call("install", Akabei::Config::instance()->root(), backup, (int) m_caller->processingOptions());
} else {
qDebug() << "Authorization not granted" << PolkitQt1::Authority::instance()->errorDetails();
Akabei::ErrorQueue::instance()->appendError(Akabei::Error(Akabei::Error::PermissionError, PolkitQt1::Authority::instance()->errorDetails()));
}
}
void PolKitInstallFunctor::newMessage(const QString &archive, const QString &message)
{
if (archive == m_handle.filename())
m_caller->addMessage(message);
}
void PolKitInstallFunctor::updateProgress(const QString &archive, int progress)
{
if (archive == m_handle.filename())
m_caller->setProgress(progress);
}
PolKitReinstallUpgradeFunctor::PolKitReinstallUpgradeFunctor(QMap<QString, QString> &b, Akabei::Operation *op, PolKitArchiveHandler &handler)
: PolKitEntryHandlerFunctor(op, handler)
{
foreach (const QString &k, b)
backup.insert(k, b[k]);
}
void PolKitReinstallUpgradeFunctor::run()
{
if (Akabei::Helpers::checkAuthorizationSync("org.chakraproject.akabeicorehelper.archive.extract")) {
qDebug() << "Authorization granted";
QDBusInterface iface("org.chakraproject.akabeicorehelper", "/archive", "org.chakraproject.akabeicorehelper.archive", QDBusConnection::systemBus());
iface.setProperty("filename", m_handle.filename());
QDBusMessage mes = iface.call("upgrade", Akabei::Config::instance()->root(), backup, (int) m_caller->processingOptions());
} else {
qDebug() << "Authorization not granted" << PolkitQt1::Authority::instance()->errorDetails();
Akabei::ErrorQueue::instance()->appendError(Akabei::Error(Akabei::Error::PermissionError, PolkitQt1::Authority::instance()->errorDetails()));
}
}
void PolKitReinstallUpgradeFunctor::newMessage(const QString &archive, const QString &message)
{
if (archive == m_handle.filename())
m_caller->addMessage(message);
}
void PolKitReinstallUpgradeFunctor::updateProgress(const QString &archive, int progress)
{
if (archive == m_handle.filename())
m_caller->setProgress(progress);
}
}
#include "polkitarchivehandler.moc"
......@@ -85,13 +85,6 @@ public:
*/
void extractAll(const QString&, bool overwrite);
/**
* Scans all the archive entries and calls a functor for each of them.
* @param handler the functor.
* @throw ArchiveException if something goes wrong in the functor code.
*/
void handleEntries(Akabei::PolKitEntryHandlerFunctor& handler);//FIXME: EntryHandlerFunctor should move into this file and be exported?
/**
* Computes the MD5 hash of some archive entries.
* @param files the files to be computed.
......@@ -122,9 +115,6 @@ private:
class Private;
Private *d;
Q_PRIVATE_SLOT(d, void __k__updateProgress(QString, int))
Q_PRIVATE_SLOT(d, void __k__newMessage(QString, QString))
};
Q_DECLARE_METATYPE(QList<QByteArray>);
......
......@@ -145,4 +145,4 @@ void PlainHookOperation::validate()
}
}
#include "akabeiplainhookoperation.moc"
\ No newline at end of file
#include "akabeiplainhookoperation.moc"
......@@ -20,7 +20,7 @@
#include <akabeibackend.h>
#include <akabeierror.h>
#include <akabeilog.h>
#include <libarchive++/polkitarchivehandler.h>
#include <libarchive++/archivehandler.h>
#include <QFile>
#include <QDir>
......@@ -63,6 +63,7 @@ PlainInstallOperation::~PlainInstallOperation()
void PlainInstallOperation::run()
{
qDebug() << "Run install";
OperationUtils util;
if (!(processingOptions() & Akabei::DatabaseOnly)) {
......@@ -164,7 +165,6 @@ void PlainInstallOperation::run()
// Simply copy it over to our cachedir.
Cache cache;
cache.writePackage(p->pathToArchive(), p->filename());
QFile::copy(p->pathToArchive(), Config::instance()->cacheDir().absoluteFilePath(p->filename()));
}
// Delete Package object.
......
......@@ -18,7 +18,7 @@
#include <akabeidatabase.h>
#include <akabeilog.h>
#include <akabeipackage.h>
#include <libarchive++/polkitarchivehandler.h>
#include <libarchive++/archivehandler.h>
#include <akabeiconfig.h>
#include <akabeibackend.h>
#include <akabeihelpers.h>
......@@ -29,6 +29,7 @@
#include <QDir>
#include <akabeidebug.h>
#include <QTemporaryFile>
#include <QThread>
#include <sqlite3.h>
#include <md5.h>
......@@ -63,6 +64,7 @@ PlainReInstallOperation::~PlainReInstallOperation()
void PlainReInstallOperation::run()
{
qDebug() << "Let's reinstall" << QThread::currentThread();
OperationUtils util;
if (!(processingOptions().testFlag(Akabei::DatabaseOnly))) {
......
......@@ -70,9 +70,9 @@ void PlainRemoveOperation::run()
continue;
}
if (!Akabei::Helpers::removeFile(file) && !(processingOptions().testFlag(Akabei::Force))) {
akabeiDebug() << "Couldn't remove" << file;
QString translated = QObject::tr("Removing file %1 failed!").arg(file);
QFile f(file);
if (!f.remove() && !(processingOptions().testFlag(Akabei::Force))) {
QString translated = QObject::tr("Removing %1 failed: %2").arg(file, f.errorString());
setErrors(Error::List() << Error(Error::UnknownError, translated, this));
setFinished(false);
}
......
......@@ -49,6 +49,7 @@ void ChrootedProcess::setupChildProcess()
{
::chroot(m_chroot.toUtf8().data());
::chdir("/");
::setuid(QFileInfo(m_chroot).ownerId());
umask(0022);
}
......
......@@ -61,6 +61,7 @@ PlainUpgradeOperation::~PlainUpgradeOperation()
void PlainUpgradeOperation::run()
{
qDebug() << "Run upgrade";
OperationUtils util;
if (!(processingOptions().testFlag(Akabei::DatabaseOnly))) {
......@@ -90,8 +91,9 @@ void PlainUpgradeOperation::run()
continue;
}
if (!Akabei::Helpers::removeFile(file) && !(processingOptions().testFlag(Akabei::Force))) {
QString translated = QObject::tr("Removing file %1 failed!").arg(file);
QFile f(file);
if (!f.remove() && !(processingOptions().testFlag(Akabei::Force))) {
QString translated = QObject::tr("Removing %1 failed: %2").arg(file, f.errorString());
setErrors(Error::List() << Error(Error::UnknownError, translated, this));
setFinished(false);
}
......@@ -206,10 +208,13 @@ void PlainUpgradeOperation::run()
setFinished(false);
return;
}
// Add the archive to the cache
// TODO: See if we have to remove stuff here
// QFile::copy(p->pathToArchive(), Config::instance()->cacheDir().absoluteFilePath(p->filename()));
if (!(processingOptions().testFlag(Akabei::DatabaseOnly))) {
// Add the archive to the cache.
// Simply copy it over to our cachedir.
Cache cache;
cache.writePackage(p->pathToArchive(), p->filename());
}
// Delete the package object
delete p;
......
/* This file is part of the Chakra project
Copyright (C) 2010 Dario Freddi <drf@chakra-project.org>
Copyright (C) 2013 Lukas Appelhans <boom1992@chakra-project.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
*/
#include "akabeipolkitinstalloperation.h"
#include "akabeiplainhookoperation.h"
#include "akabeiplainscriptletoperation.h"
#include "akabeioperationutils.h"
#include <akabeipackage.h>
#include <akabeicache.h>
#include <akabeiconfig.h>
#include <akabeihelpers.h>
#include <akabeibackend.h>
#include <akabeierror.h>
#include <akabeilog.h>
#include <akabeidebug.h>
#include <QDateTime>
#include <QStringList>
#include <QDBusInterface>
#include <QDBusPendingCall>
namespace Akabei {
class PolkitInstallOperation::Private
{
public:
Private(Package *p, Akabei::Package::InstallReason installReason, PolkitInstallOperation * op)
: package(p), reason(installReason), iface(0), q(op) {}
~Private() {
delete iface;
}
void __k__installFinished(const QString &archive);
void __k__installProgress(const QString &archive, int progress);
void __k__installMessage(const QString &archive, const QString &message);
Package *package;
Akabei::Package::InstallReason reason;
QDBusInterface * iface;
PolkitInstallOperation * q;
};
PolkitInstallOperation::PolkitInstallOperation(Package *package, Akabei::Package::InstallReason installReason)
: QObject(0)
, Operation(package->name())
, d(new Private(package, installReason, this))
{
setPhase(Phase3); // Installation happens in phase 3.
setPriority(50); // Installation has a low priority.
setCanBeConcurrent(false); // And it can not be concurrent.
setTargetVersion(package->version().toByteArray());
setDescription(QObject::tr("Installing %1...").arg(package->name()));
}
PolkitInstallOperation::~PolkitInstallOperation()
{
delete d;
}
void PolkitInstallOperation::run()
{
qDebug() << "Run install";
OperationUtils util;
if (!(processingOptions().testFlag(Akabei::DatabaseOnly))) {
if (!util.validatePackage(d->package)) {
setErrors(Error::List() << Error(Error::UnknownError, util.errorMessage(), this));
setFinished(false);
return;
}
QMap<QString, QString> backup = d->package->backupFiles();
QVariantMap b;
foreach (const QString &k, backup)
b.insert(k, backup[k]);
qDebug() << "Now let's do the dbus stuff";
if (!Akabei::Helpers::checkAuthorizationSync("org.chakraproject.akabeicorehelper.archive.extract")) {
setErrors(Error::List() << Error(Error::PermissionError, QObject::tr("There has been an error with your polkit configuration!"), this));
setFinished(false);
return;
}
d->iface = new QDBusInterface("org.chakraproject.akabeicorehelper", "/archive", "org.chakraproject.akabeicorehelper.archive", QDBusConnection::systemBus());
d->iface->setProperty("filename", d->package->pathToArchive());
connect(d->iface, SIGNAL(finished(QString)), SLOT(__k__installFinished(QString)));
connect(d->iface, SIGNAL(newMessage(QString, QString)), SLOT(__k__installMessage(QString, QString)));
connect(d->iface, SIGNAL(updateProgress(QString, int)), SLOT(__k__installProgress(QString, int)));
d->iface->asyncCall("install", Akabei::Config::instance()->root(), b, (int) processingOptions());
} else {
d->__k__installFinished(d->package->pathToArchive());
}
}
void PolkitInstallOperation::Private::__k__installProgress(const QString &archive, int progress)