diff --git a/src/libcalamares/utils/Runner.cpp b/src/libcalamares/utils/Runner.cpp index db783f676..36bb1bd2b 100644 --- a/src/libcalamares/utils/Runner.cpp +++ b/src/libcalamares/utils/Runner.cpp @@ -94,12 +94,6 @@ namespace Calamares namespace Utils { -struct Runner::Private -{ - QProcess m_process; -}; - - Runner::Runner() {} @@ -147,6 +141,20 @@ Calamares::Utils::Runner::run() process.setArguments( m_command ); } + if ( m_output ) + { + connect( &process, &QProcess::readyReadStandardOutput, [this, &process]() { + while ( process.canReadLine() ) + { + QString s = process.readLine(); + if ( !s.isEmpty() ) + { + Q_EMIT this->output( s ); + } + } + } ); + } + cDebug() << Logger::SubEntry << "Running" << Logger::Redacted( m_command ); process.start(); if ( !process.waitForStarted() ) diff --git a/src/libcalamares/utils/Runner.h b/src/libcalamares/utils/Runner.h index b41da07ab..510ddf098 100644 --- a/src/libcalamares/utils/Runner.h +++ b/src/libcalamares/utils/Runner.h @@ -109,10 +109,6 @@ private: QString m_input; std::chrono::milliseconds m_timeout { 0 }; bool m_output = false; - - // Internals for when it really does run - struct Private; - std::unique_ptr< Private > d; }; } // namespace Utils