From 631ade1954964c3478aeaf43720516d91fa58040 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Fri, 18 Aug 2023 11:53:32 +0200 Subject: [PATCH] Show the executed opkg-commands in the text edit. --- worker.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/worker.cpp b/worker.cpp index cbf9dbd..d6d4156 100644 --- a/worker.cpp +++ b/worker.cpp @@ -891,14 +891,18 @@ bool Worker::updateFiles(quint8 percent) { if (f.open(QIODevice::ReadOnly)) { QTextStream in(&f); int cmdCount = 0; + QStringList opkgCommands; while (!in.atEnd()) { QString line = in.readLine(); static const QRegularExpression comment("^\\s*#.*$"); if (line.indexOf(comment, 0) == -1) { // found opkg command QString opkgCommand = line.trimmed(); - executeOpkgCommand(opkgCommand); ++cmdCount; + executeOpkgCommand(opkgCommand); + QString cmd = "\n " + opkgCommand; + emit appendText(cmd); + opkgCommands << cmd; m_ismasClient.setProgressInPercent(++percent); m_updateStatus = UpdateStatus(UPDATE_STATUS::EXEC_OPKG_COMMAND, @@ -911,8 +915,10 @@ bool Worker::updateFiles(quint8 percent) { f.close(); if (cmdCount > 0) { m_displayIndex = 1; - emit replaceLast(QString("(") + QString("%1").arg(m_displayIndex).rightJustified(2, ' ') + QString(")") - + QString(" Update opkg pakets ... "), UPDATE_STEP_DONE); + QString prepend = QString("(") + QString("%1").arg(m_displayIndex).rightJustified(2, ' ') + QString(")") + + QString(" Update opkg pakets ... "); + opkgCommands.prepend(prepend); + emit replaceLast(opkgCommands, UPDATE_STEP_DONE); } else { m_displayIndex = 1; emit replaceLast(QString("(") + QString("%1").arg(m_displayIndex).rightJustified(2, ' ') + QString(")")