Skip to content

Commit

Permalink
Always attach events
Browse files Browse the repository at this point in the history
  • Loading branch information
kraxarn committed Nov 17, 2024
1 parent c79c4ac commit ca414b8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions src/spotifyclient/runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ SpotifyClient::Runner::Runner(const lib::settings &settings,
path = QString::fromStdString(settings.spotify.path);
process = new QProcess(parent);
clientType = SpotifyClient::Helper::clientType(path);

connect(process, &QProcess::readyReadStandardOutput,
this, &Runner::onReadyReadOutput);

connect(process, &QProcess::readyReadStandardError,
this, &Runner::onReadyReadError);

connect(process, &QProcess::started,
this, &Runner::onStarted);

connect(process, &QProcess::errorOccurred,
this, &Runner::onErrorOccurred);
}

SpotifyClient::Runner::~Runner()
Expand Down Expand Up @@ -126,18 +138,6 @@ void SpotifyClient::Runner::start()
arguments.append(additional_arguments.split(' '));
}

QProcess::connect(process, &QProcess::readyReadStandardOutput,
this, &Runner::onReadyReadOutput);

QProcess::connect(process, &QProcess::readyReadStandardError,
this, &Runner::onReadyReadError);

QProcess::connect(process, &QProcess::started,
this, &Runner::onStarted);

QProcess::connect(process, &QProcess::errorOccurred,
this, &Runner::onErrorOccurred);

lib::log::debug("starting: {} {}", path.toStdString(),
joinArgs(arguments).toStdString());

Expand Down
2 changes: 1 addition & 1 deletion src/spotifyclient/runner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace SpotifyClient
void statusChanged(const QString &status);

private:
QProcess *process = nullptr;
QProcess *process;
QWidget *parentWidget = nullptr;
QString path;
static std::vector<lib::log_message> log;
Expand Down

0 comments on commit ca414b8

Please sign in to comment.