Show the executed opkg-commands in the text edit.
This commit is contained in:
parent
337bdd1bb0
commit
631ade1954
12
worker.cpp
12
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(")")
|
||||
|
Loading…
Reference in New Issue
Block a user