Fix copyblocks exit status check
This commit is contained in:
parent
ac6dc0eb87
commit
72da110996
|
@ -45,7 +45,11 @@ bool Job::copyBlocks(Report& report, CopyTarget& target, CopySource& source)
|
|||
ExternalCommand copyCmd(source, target, QProcess::SeparateChannels);
|
||||
connect(©Cmd, &ExternalCommand::progress, this, &Job::progress, Qt::QueuedConnection);
|
||||
connect(©Cmd, &ExternalCommand::reportSignal, this, &Job::updateReport, Qt::QueuedConnection);
|
||||
return copyCmd.startCopyBlocks();
|
||||
if (copyCmd.startCopyBlocks() && copyCmd.exitCode() == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Job::rollbackCopyBlocks(Report& report, CopyTarget& origTarget, CopySource& origSource)
|
||||
|
|
|
@ -114,11 +114,11 @@ bool ExternalCommand::copyBlocks()
|
|||
return false;
|
||||
}
|
||||
|
||||
m_Output = job->data()[QStringLiteral("output")].toByteArray();
|
||||
setExitCode(job->data()[QStringLiteral("exitCode")].toInt());
|
||||
rval = job->data()[QStringLiteral("success")].toInt();
|
||||
setExitCode(!rval);
|
||||
|
||||
emit finished();
|
||||
return true;
|
||||
return rval;
|
||||
}
|
||||
|
||||
/** Creates a new ExternalCommand instance without Report.
|
||||
|
|
|
@ -166,6 +166,8 @@ ActionReply ExternalCommandHelper::copyblockshelper(const QVariantMap& args)
|
|||
report[QStringLiteral("report")] = xi18ncp("@info:progress argument 2 is a string such as 7 bytes (localized accordingly)", "Copying 1 block (%2) finished.", "Copying %1 blocks (%2) finished.", blocksCopied, i18np("1 byte", "%1 bytes", bytesWritten));
|
||||
HelperSupport::progressStep(report);
|
||||
|
||||
reply.addData(QStringLiteral("success"), rval);
|
||||
|
||||
return reply;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue