Show the executed opkg-commands in the text edit.

This commit is contained in:
Gerhard Hoffmann 2023-08-18 11:53:32 +02:00
parent 337bdd1bb0
commit 631ade1954

View File

@ -891,14 +891,18 @@ bool Worker::updateFiles(quint8 percent) {
if (f.open(QIODevice::ReadOnly)) { if (f.open(QIODevice::ReadOnly)) {
QTextStream in(&f); QTextStream in(&f);
int cmdCount = 0; int cmdCount = 0;
QStringList opkgCommands;
while (!in.atEnd()) { while (!in.atEnd()) {
QString line = in.readLine(); QString line = in.readLine();
static const QRegularExpression comment("^\\s*#.*$"); static const QRegularExpression comment("^\\s*#.*$");
if (line.indexOf(comment, 0) == -1) { if (line.indexOf(comment, 0) == -1) {
// found opkg command // found opkg command
QString opkgCommand = line.trimmed(); QString opkgCommand = line.trimmed();
executeOpkgCommand(opkgCommand);
++cmdCount; ++cmdCount;
executeOpkgCommand(opkgCommand);
QString cmd = "\n " + opkgCommand;
emit appendText(cmd);
opkgCommands << cmd;
m_ismasClient.setProgressInPercent(++percent); m_ismasClient.setProgressInPercent(++percent);
m_updateStatus = UpdateStatus(UPDATE_STATUS::EXEC_OPKG_COMMAND, m_updateStatus = UpdateStatus(UPDATE_STATUS::EXEC_OPKG_COMMAND,
@ -911,8 +915,10 @@ bool Worker::updateFiles(quint8 percent) {
f.close(); f.close();
if (cmdCount > 0) { if (cmdCount > 0) {
m_displayIndex = 1; m_displayIndex = 1;
emit replaceLast(QString("(") + QString("%1").arg(m_displayIndex).rightJustified(2, ' ') + QString(")") QString prepend = QString("(") + QString("%1").arg(m_displayIndex).rightJustified(2, ' ') + QString(")")
+ QString(" Update opkg pakets ... "), UPDATE_STEP_DONE); + QString(" Update opkg pakets ... ");
opkgCommands.prepend(prepend);
emit replaceLast(opkgCommands, UPDATE_STEP_DONE);
} else { } else {
m_displayIndex = 1; m_displayIndex = 1;
emit replaceLast(QString("(") + QString("%1").arg(m_displayIndex).rightJustified(2, ' ') + QString(")") emit replaceLast(QString("(") + QString("%1").arg(m_displayIndex).rightJustified(2, ' ') + QString(")")