Add commented (so far) getConfig method.
This commit is contained in:
parent
9fee3af759
commit
7ce8c13f27
@ -229,6 +229,36 @@ TtRssUpdateArticleResponse TtRssNetworkFactory::updateArticles(const QStringList
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
TtRssGetConfigResponse TtRssNetworkFactory::getConfig() {
|
||||||
|
QtJson::JsonObject json;
|
||||||
|
json["op"] = "getConfig";
|
||||||
|
json["sid"] = m_sessionId;
|
||||||
|
|
||||||
|
QByteArray result_raw;
|
||||||
|
NetworkResult network_reply = NetworkFactory::uploadData(m_url, DOWNLOAD_TIMEOUT, QtJson::serialize(json), CONTENT_TYPE, result_raw,
|
||||||
|
m_authIsUsed, m_authUsername, m_authPassword);
|
||||||
|
TtRssGetConfigResponse result(QString::fromUtf8(result_raw));
|
||||||
|
|
||||||
|
if (result.isNotLoggedIn()) {
|
||||||
|
// We are not logged in.
|
||||||
|
login();
|
||||||
|
json["sid"] = m_sessionId;
|
||||||
|
|
||||||
|
network_reply = NetworkFactory::uploadData(m_url, DOWNLOAD_TIMEOUT, QtJson::serialize(json), CONTENT_TYPE, result_raw,
|
||||||
|
m_authIsUsed, m_authUsername, m_authPassword);
|
||||||
|
result = TtRssGetConfigResponse(QString::fromUtf8(result_raw));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (network_reply.first != QNetworkReply::NoError) {
|
||||||
|
qWarning("TT-RSS: getConfig failed with error %d.", network_reply.first);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_lastError = network_reply.first;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
bool TtRssNetworkFactory::forceServerSideUpdate() const {
|
bool TtRssNetworkFactory::forceServerSideUpdate() const {
|
||||||
return m_forceServerSideUpdate;
|
return m_forceServerSideUpdate;
|
||||||
}
|
}
|
||||||
@ -495,3 +525,11 @@ int TtRssUpdateArticleResponse::articlesUpdated() const {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
TtRssGetConfigResponse::TtRssGetConfigResponse(const QString &raw_content) : TtRssResponse(raw_content) {
|
||||||
|
}
|
||||||
|
|
||||||
|
TtRssGetConfigResponse::~TtRssGetConfigResponse() {
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
@ -83,6 +83,14 @@ class TtRssUpdateArticleResponse : public TtRssResponse {
|
|||||||
int articlesUpdated() const;
|
int articlesUpdated() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
class TtRssGetConfigResponse : public TtRssResponse {
|
||||||
|
public:
|
||||||
|
explicit TtRssGetConfigResponse(const QString &raw_content = QString());
|
||||||
|
virtual ~TtRssGetConfigResponse();
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
namespace UpdateArticle {
|
namespace UpdateArticle {
|
||||||
enum Mode {
|
enum Mode {
|
||||||
SetToFalse = 0,
|
SetToFalse = 0,
|
||||||
@ -148,6 +156,8 @@ class TtRssNetworkFactory {
|
|||||||
TtRssUpdateArticleResponse updateArticles(const QStringList &ids, UpdateArticle::OperatingField field,
|
TtRssUpdateArticleResponse updateArticles(const QStringList &ids, UpdateArticle::OperatingField field,
|
||||||
UpdateArticle::Mode mode);
|
UpdateArticle::Mode mode);
|
||||||
|
|
||||||
|
//TtRssGetConfigResponse getConfig();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_url;
|
QString m_url;
|
||||||
QString m_username;
|
QString m_username;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user