diff options
Diffstat (limited to 'src/plugins')
| -rw-r--r-- | src/plugins/General/converter/converterdialog.cpp | 12 | ||||
| -rw-r--r-- | src/plugins/General/listenbrainz/listenbrainz.cpp | 12 | ||||
| -rw-r--r-- | src/plugins/General/lyrics/lyricswindow.cpp | 4 | ||||
| -rw-r--r-- | src/plugins/General/scrobbler/scrobbler.cpp | 8 | ||||
| -rw-r--r-- | src/plugins/General/streambrowser/streamwindow.cpp | 4 | ||||
| -rw-r--r-- | src/plugins/General/trackchange/trackchange.cpp | 14 | ||||
| -rw-r--r-- | src/plugins/Ui/skinned/skinnedfactory.cpp | 2 |
7 files changed, 51 insertions, 5 deletions
diff --git a/src/plugins/General/converter/converterdialog.cpp b/src/plugins/General/converter/converterdialog.cpp index bfd4a6211..19383772b 100644 --- a/src/plugins/General/converter/converterdialog.cpp +++ b/src/plugins/General/converter/converterdialog.cpp @@ -340,13 +340,17 @@ QString ConverterDialog::uniqueName(const QString &name) bool ConverterDialog::checkPreset(const QVariantMap &preset) { - QStringList programAndArgs = preset["command"].toString().split(" ", QString::SkipEmptyParts); - if(programAndArgs.isEmpty()) +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) + QStringList tokens = QProcess::splitCommand(preset["command"].toString()); +#else + QStringList tokens = preset["command"].toString().split(" ", QString::SkipEmptyParts); +#endif + if(tokens.isEmpty()) return false; - QString program = programAndArgs.first(); + QString program = tokens.takeFirst(); - int result = QProcess::execute(program); + int result = QProcess::execute(program, tokens); if(result == -2) { diff --git a/src/plugins/General/listenbrainz/listenbrainz.cpp b/src/plugins/General/listenbrainz/listenbrainz.cpp index 4bb43d1d6..521bbe0d9 100644 --- a/src/plugins/General/listenbrainz/listenbrainz.cpp +++ b/src/plugins/General/listenbrainz/listenbrainz.cpp @@ -140,7 +140,11 @@ void ListenBrainz::updateMetaData() void ListenBrainz::processResponse(QNetworkReply *reply) { +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) + if (reply->networkError() != QNetworkReply::NoError) +#else if (reply->error() != QNetworkReply::NoError) +#endif { qWarning("ListenBrainz: http error: %s", qPrintable(reply->errorString())); } @@ -148,11 +152,19 @@ void ListenBrainz::processResponse(QNetworkReply *reply) QByteArray data = reply->readAll(); QJsonDocument document = QJsonDocument::fromJson(data); QString status = document.object().value("status").toString(); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) + if(status != "ok" || reply->networkError() != QNetworkReply::NoError) +#else if(status != "ok" || reply->error() != QNetworkReply::NoError) +#endif { status.clear(); qWarning("ListenBrainz: server reply: %s", data.constData()); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) + if(reply->networkError() == QNetworkReply::AuthenticationRequiredError) +#else if(reply->error() == QNetworkReply::AuthenticationRequiredError) +#endif { m_token.clear(); qWarning("ListenBrainz: invalid user token, submitting has been disabled"); diff --git a/src/plugins/General/lyrics/lyricswindow.cpp b/src/plugins/General/lyrics/lyricswindow.cpp index 750d91835..35bf51681 100644 --- a/src/plugins/General/lyrics/lyricswindow.cpp +++ b/src/plugins/General/lyrics/lyricswindow.cpp @@ -94,7 +94,11 @@ void LyricsWindow::onRequestFinished(QNetworkReply *reply) QVariant redirectTarget = reply->attribute(QNetworkRequest::RedirectionTargetAttribute); int code = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) + if(reply->networkError() == QNetworkReply::NoError && code == 200) +#else if(reply->error() == QNetworkReply::NoError && code == 200) +#endif { QByteArray data = reply->readAll(); LyricsProvider *provider = m_parser.provider(name); diff --git a/src/plugins/General/scrobbler/scrobbler.cpp b/src/plugins/General/scrobbler/scrobbler.cpp index 61c60cdff..4616c3951 100644 --- a/src/plugins/General/scrobbler/scrobbler.cpp +++ b/src/plugins/General/scrobbler/scrobbler.cpp @@ -181,7 +181,11 @@ void Scrobbler::updateMetaData() void Scrobbler::processResponse(QNetworkReply *reply) { +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) + if (reply->networkError() != QNetworkReply::NoError) +#else if (reply->error() != QNetworkReply::NoError) +#endif { qWarning("Scrobbler[%s]: http error: %s", qPrintable(m_name), qPrintable(reply->errorString())); } @@ -497,7 +501,11 @@ QString ScrobblerAuth::session() const void ScrobblerAuth::processResponse(QNetworkReply *reply) { +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) + if (reply->networkError() != QNetworkReply::NoError) +#else if (reply->error() != QNetworkReply::NoError) +#endif { qWarning("ScrobblerAuth[%s]: http error: %s", qPrintable(m_name), qPrintable(reply->errorString())); } diff --git a/src/plugins/General/streambrowser/streamwindow.cpp b/src/plugins/General/streambrowser/streamwindow.cpp index 814196132..54090ab63 100644 --- a/src/plugins/General/streambrowser/streamwindow.cpp +++ b/src/plugins/General/streambrowser/streamwindow.cpp @@ -153,7 +153,11 @@ StreamWindow::~StreamWindow() void StreamWindow::showText(QNetworkReply *reply) { m_ui->statusLabel->setText(tr("Done")); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) + if (reply->networkError() != QNetworkReply::NoError) +#else if (reply->error() != QNetworkReply::NoError) +#endif { m_ui->statusLabel->setText(tr("Error")); QMessageBox::warning (this, tr("Error"), reply->errorString()); diff --git a/src/plugins/General/trackchange/trackchange.cpp b/src/plugins/General/trackchange/trackchange.cpp index 5c8168129..601a646f8 100644 --- a/src/plugins/General/trackchange/trackchange.cpp +++ b/src/plugins/General/trackchange/trackchange.cpp @@ -107,13 +107,27 @@ void TrackChange::onFinised() void TrackChange::onAppStartup() { if(QApplication::allWindows().count() == 1 && !m_appStartupCommand.isEmpty()) //detect startup + { +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) + QStringList tokens = QProcess::splitCommand(m_appStartupCommand); + QProcess::startDetached(tokens.first(), tokens.mid(1)); +#else QProcess::startDetached(m_appStartupCommand); +#endif + } } void TrackChange::onAppExit() { if(!m_appExitCommand.isEmpty()) + { +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) + QStringList tokens = QProcess::splitCommand(m_appExitCommand); + QProcess::startDetached(tokens.first(), tokens.mid(1)); +#else QProcess::startDetached(m_appExitCommand); +#endif + } } bool TrackChange::executeCommand(const TrackInfo &info, const QString &format) diff --git a/src/plugins/Ui/skinned/skinnedfactory.cpp b/src/plugins/Ui/skinned/skinnedfactory.cpp index dce20c438..ab0a6324c 100644 --- a/src/plugins/Ui/skinned/skinnedfactory.cpp +++ b/src/plugins/Ui/skinned/skinnedfactory.cpp @@ -48,7 +48,7 @@ QObject *SkinnedFactory::SkinnedFactory::create() if(QFile::exists(kwinScript)) { qDebug("SkinnedFactory: adding kwin rules..."); - QProcess::execute(QString("sh %1").arg(QFileInfo(kwinScript).canonicalFilePath())); + QProcess::execute(QString("sh"), QStringList() << QFileInfo(kwinScript).canonicalFilePath()); } } #endif |
