Cover `folder/pullerrors` as well in option for deprecated routes

This commit is contained in:
Martchus 2023-02-03 14:55:48 +01:00
parent 734fc170a4
commit d7c5a66cc8
2 changed files with 10 additions and 1 deletions

View File

@ -351,6 +351,7 @@ private Q_SLOTS:
void recalculateStatus();
QString configPath() const;
QByteArray changeConfigVerb() const;
QString folderErrorsPath() const;
private:
// internal helper methods

View File

@ -224,6 +224,14 @@ QByteArray SyncthingConnection::changeConfigVerb() const
return isUsingDeprecatedRoutes() ? QByteArray("POST") : QByteArray("PUT");
}
/*!
* \brief Returns the path to Syncthing's route to retrieve errors depending on whether deprecated routes should be used.
*/
QString SyncthingConnection::folderErrorsPath() const
{
return isUsingDeprecatedRoutes() ? QStringLiteral("folder/pullerrors") : QStringLiteral("folder/errors");
}
// pause/resume devices
/*!
@ -1113,7 +1121,7 @@ void SyncthingConnection::requestDirPullErrors(const QString &dirId, int page, i
query.addQueryItem(QStringLiteral("page"), QString::number(page));
query.addQueryItem(QStringLiteral("perpage"), QString::number(perPage));
}
auto *const reply = requestData(QStringLiteral("folder/pullerrors"), query);
auto *const reply = requestData(folderErrorsPath(), query);
reply->setProperty("dirId", dirId);
QObject::connect(reply, &QNetworkReply::finished, this, &SyncthingConnection::readDirPullErrors);
}