Commit cf445ce6 authored by Lukas Appelhans's avatar Lukas Appelhans
Browse files

Definitely emit the finished signal

parent cff9a487
......@@ -271,6 +271,9 @@ void Operation::setFinished(bool result)
} else {
d->setStatus(StatusError);
}
if (d->runner) {
d->runner->d_func()->emitFinished(this, result);
}
if (!d->runLoop.isNull()) {
d->runLoop.data()->quit();
}
......
......@@ -56,6 +56,12 @@ void OperationRunnerPrivate::emitProgress(Operation *op, int progress)
emit q->operationProgress(op, progress);
}
void OperationRunnerPrivate::emitFinished(Operation *op, bool result)
{
Q_Q(OperationRunner);
emit q->operationProgress(op, result);
}
void OperationRunnerPrivate::emitMessage(Akabei::Operation* op, const QString &message)
{
Q_Q(OperationRunner);
......
......@@ -48,6 +48,7 @@ public:
QTime antiFlicker;
void emitProgress(Akabei::Operation* op, int progress);
void emitFinished(Akabei::Operation* op, bool success);
void emitMessage(Akabei::Operation* op, const QString &message);
void emitStatus(Akabei::Operation* op, Operation::Status status);
......
......@@ -113,13 +113,13 @@ void PlainInstallOperation::run()
for (int i = 0; archive_read_next_header(archive, &entry) == ARCHIVE_OK; ++i) {
int percent;
if(d->package->size() != 0) {
if (d->package->size() != 0) {
/* Using compressed size for calculations here, as newpkg->isize is not
* exact when it comes to comparing to the ACTUAL uncompressed size
* (missing metadata sizes) */
int64_t pos = archive_position_compressed(archive);
percent = (pos * 100) / d->package->size();
if(percent >= 100) {
if (percent >= 100) {
percent = 100;
}
} else {
......
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