Skip to content

Commit

Permalink
Use QStringLiteral instead
Browse files Browse the repository at this point in the history
  • Loading branch information
kraxarn authored Sep 21, 2024
1 parent 23870b1 commit dceb58e
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/spotifyclient/runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,29 +242,36 @@ void SpotifyClient::Runner::onStarted()

void SpotifyClient::Runner::onErrorOccurred(QProcess::ProcessError error)
{
std::string_view message;
QString message;

switch (error)
{
case QProcess::FailedToStart:
message = "Process failed to start";
message = QStringLiteral("Process failed to start");
break;

case QProcess::Crashed:
message = "Process stopped or crashed";
message = QStringLiteral("Process stopped or crashed");
break;

case QProcess::Timedout:
message = "Process timed out";
message = QStringLiteral("Process timed out");
break;

case QProcess::WriteError:
message = "Process with write error";
message = QStringLiteral("Process with write error");
break;

case QProcess::ReadError:
message = "Process with read error";
message = QStringLiteral("Process with read error");
break;

default:
message = "Process with unknown error";
message = QStringLiteral("Process with unknown error");
break;
}
emit statusChanged(QString::fromUtf8(message.data(), message.size()));

emit statusChanged(message);
}

auto SpotifyClient::Runner::getLog() -> const std::vector<lib::log_message> &
Expand Down

0 comments on commit dceb58e

Please sign in to comment.