rename, fix build

This commit is contained in:
Martin Rotter 2023-03-17 08:45:43 +01:00
parent c1f5029e8b
commit f896860f75
14 changed files with 72 additions and 63 deletions

View File

@ -44,14 +44,11 @@ QStringList NetworkFactory::extractFeedLinksFromHtmlPage(const QUrl& url, const
return feeds;
}
QPair<QByteArray, QByteArray> NetworkFactory::generateBasicAuthHeader(Feed::Protection protection,
QPair<QByteArray, QByteArray> NetworkFactory::generateBasicAuthHeader(NetworkAuthentication protection,
const QString& username,
const QString& password) {
switch (protection) {
case Feed::Protection::NoProtection:
return {};
case Feed::Protection::BasicProtection: {
case NetworkFactory::NetworkAuthentication::Basic: {
if (username.isEmpty()) {
return {};
}
@ -63,11 +60,15 @@ QPair<QByteArray, QByteArray> NetworkFactory::generateBasicAuthHeader(Feed::Prot
}
}
case Feed::Protection::TokenProtection: {
case NetworkFactory::NetworkAuthentication::Token: {
QString header_value = QSL("Bearer ") + username;
return QPair<QByteArray, QByteArray>(HTTP_HEADERS_AUTHORIZATION, header_value.toLocal8Bit());
}
case NetworkFactory::NetworkAuthentication::NoAuthentication:
default:
return {};
}
}

View File

@ -38,8 +38,10 @@ class NetworkFactory {
explicit NetworkFactory() = default;
public:
enum class NetworkAuthentication { NoAuthentication = 0, Basic = 1, Token = 2 };
static QStringList extractFeedLinksFromHtmlPage(const QUrl& url, const QString& html);
static QPair<QByteArray, QByteArray> generateBasicAuthHeader(Feed::Protection protection,
static QPair<QByteArray, QByteArray> generateBasicAuthHeader(NetworkAuthentication protection,
const QString& username,
const QString& password);
@ -81,4 +83,6 @@ class NetworkFactory {
QNetworkProxy::ProxyType::DefaultProxy);
};
Q_DECLARE_METATYPE(NetworkFactory::NetworkAuthentication)
#endif // NETWORKFACTORY_H

View File

@ -175,7 +175,7 @@ void OAuth2Service::retrieveAccessToken(const QString& auth_code) {
network_request.setHeader(QNetworkRequest::KnownHeaders::ContentTypeHeader, "application/x-www-form-urlencoded");
if (m_useHttpBasicAuthWithClientData) {
auto basic_auth = NetworkFactory::generateBasicAuthHeader(Feed::Protection::BasicProtection,
auto basic_auth = NetworkFactory::generateBasicAuthHeader(NetworkFactory::NetworkAuthentication::Basic,
properClientId(),
properClientSecret());
@ -205,7 +205,7 @@ void OAuth2Service::refreshAccessToken(const QString& refresh_token) {
network_request.setHeader(QNetworkRequest::KnownHeaders::ContentTypeHeader, "application/x-www-form-urlencoded");
if (m_useHttpBasicAuthWithClientData) {
auto basic_auth = NetworkFactory::generateBasicAuthHeader(Feed::Protection::BasicProtection,
auto basic_auth = NetworkFactory::generateBasicAuthHeader(NetworkFactory::NetworkAuthentication::Basic,
properClientId(),
properClientSecret());

View File

@ -19,8 +19,6 @@ class Feed : public RootItem {
// Specifies the auto-download strategy for the feed.
enum class AutoUpdateType { DontAutoUpdate = 0, DefaultAutoUpdate = 1, SpecificAutoUpdate = 2 };
enum class Protection { NoProtection = 0, BasicProtection = 1, TokenProtection = 2 };
// Specifies the actual "status" of the feed.
// For example if it has new messages, error
// occurred, and so on.
@ -107,5 +105,6 @@ class Feed : public RootItem {
};
Q_DECLARE_METATYPE(Feed::AutoUpdateType)
Q_DECLARE_METATYPE(Feed::Status)
#endif // FEED_H

View File

@ -12,11 +12,12 @@ AuthenticationDetails::AuthenticationDetails(bool only_basic, QWidget* parent) :
m_txtPassword->lineEdit()->setPlaceholderText(tr("Password"));
m_txtPassword->lineEdit()->setToolTip(tr("Set password to access the feed."));
m_cbAuthType->addItem(tr("No authentication"), QVariant::fromValue(Feed::Protection::NoProtection));
m_cbAuthType->addItem(tr("HTTP Basic"), QVariant::fromValue(Feed::Protection::BasicProtection));
m_cbAuthType->addItem(tr("No authentication"),
QVariant::fromValue(NetworkFactory::NetworkAuthentication::NoAuthentication));
m_cbAuthType->addItem(tr("HTTP Basic"), QVariant::fromValue(NetworkFactory::NetworkAuthentication::Basic));
if (!only_basic) {
m_cbAuthType->addItem(tr("Token"), QVariant::fromValue(Feed::Protection::TokenProtection));
m_cbAuthType->addItem(tr("Token"), QVariant::fromValue(NetworkFactory::NetworkAuthentication::Token));
}
connect(m_txtUsername->lineEdit(), &BaseLineEdit::textChanged, this, &AuthenticationDetails::onUsernameChanged);
@ -26,7 +27,7 @@ AuthenticationDetails::AuthenticationDetails(bool only_basic, QWidget* parent) :
onAuthenticationSwitched();
}
void AuthenticationDetails::setAuthenticationType(Feed::Protection protect) {
void AuthenticationDetails::setAuthenticationType(NetworkFactory::NetworkAuthentication protect) {
auto fnd = m_cbAuthType->findData(QVariant::fromValue(protect));
if (fnd >= 0) {
@ -34,12 +35,13 @@ void AuthenticationDetails::setAuthenticationType(Feed::Protection protect) {
}
}
Feed::Protection AuthenticationDetails::authenticationType() const {
return m_cbAuthType->currentData().value<Feed::Protection>();
NetworkFactory::NetworkFactory::NetworkAuthentication AuthenticationDetails::authenticationType() const {
return m_cbAuthType->currentData().value<NetworkFactory::NetworkAuthentication>();
}
void AuthenticationDetails::onUsernameChanged(const QString& new_username) {
bool is_username_ok = authenticationType() == Feed::Protection::NoProtection || !new_username.simplified().isEmpty();
bool is_username_ok = authenticationType() == NetworkFactory::NetworkAuthentication::NoAuthentication ||
!new_username.simplified().isEmpty();
m_txtUsername->setStatus(is_username_ok ? LineEditWithStatus::StatusType::Ok
: LineEditWithStatus::StatusType::Warning,
@ -48,7 +50,8 @@ void AuthenticationDetails::onUsernameChanged(const QString& new_username) {
}
void AuthenticationDetails::onPasswordChanged(const QString& new_password) {
bool is_password_ok = authenticationType() == Feed::Protection::NoProtection || !new_password.simplified().isEmpty();
bool is_password_ok = authenticationType() == NetworkFactory::NetworkAuthentication::NoAuthentication ||
!new_password.simplified().isEmpty();
m_txtPassword->setStatus(is_password_ok ? LineEditWithStatus::StatusType::Ok
: LineEditWithStatus::StatusType::Warning,
@ -61,15 +64,15 @@ void AuthenticationDetails::onAuthenticationSwitched() {
auto prot = authenticationType();
m_lblPassword->setVisible(prot != Feed::Protection::TokenProtection);
m_txtPassword->setVisible(prot != Feed::Protection::TokenProtection);
m_lblPassword->setVisible(prot != NetworkFactory::NetworkAuthentication::Token);
m_txtPassword->setVisible(prot != NetworkFactory::NetworkAuthentication::Token);
if (prot == Feed::Protection::TokenProtection) {
if (prot == NetworkFactory::NetworkAuthentication::Token) {
m_lblUsername->setText(tr("Access token"));
}
else {
m_lblUsername->setText(tr("Username"));
}
m_gbAuthentication->setEnabled(prot != Feed::Protection::NoProtection);
m_gbAuthentication->setEnabled(prot != NetworkFactory::NetworkAuthentication::NoAuthentication);
}

View File

@ -7,6 +7,7 @@
#include "ui_authenticationdetails.h"
#include "network-web/networkfactory.h"
#include "services/abstract/feed.h"
class AuthenticationDetails : public QWidget, public Ui::AuthenticationDetails {
@ -15,8 +16,8 @@ class AuthenticationDetails : public QWidget, public Ui::AuthenticationDetails {
public:
explicit AuthenticationDetails(bool only_basic, QWidget* parent = nullptr);
void setAuthenticationType(Feed::Protection protect);
Feed::Protection authenticationType() const;
void setAuthenticationType(NetworkFactory::NetworkFactory::NetworkAuthentication protect);
NetworkFactory::NetworkFactory::NetworkAuthentication authenticationType() const;
private slots:
void onUsernameChanged(const QString& new_username);

View File

@ -79,7 +79,7 @@ OwnCloudStatusResponse OwnCloudNetworkFactory::status(const QNetworkProxy& custo
QList<QPair<QByteArray, QByteArray>> headers;
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, OWNCLOUD_CONTENT_TYPE_JSON);
headers << NetworkFactory::generateBasicAuthHeader(Feed::Protection::BasicProtection, m_authUsername, m_authPassword);
headers << NetworkFactory::generateBasicAuthHeader(NetworkFactory::NetworkAuthentication::Basic, m_authUsername, m_authPassword);
NetworkResult network_reply =
NetworkFactory::performNetworkOperation(m_urlStatus,
@ -111,7 +111,7 @@ OwnCloudGetFeedsCategoriesResponse OwnCloudNetworkFactory::feedsCategories(const
QList<QPair<QByteArray, QByteArray>> headers;
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, OWNCLOUD_CONTENT_TYPE_JSON);
headers << NetworkFactory::generateBasicAuthHeader(Feed::Protection::BasicProtection, m_authUsername, m_authPassword);
headers << NetworkFactory::generateBasicAuthHeader(NetworkFactory::NetworkAuthentication::Basic, m_authUsername, m_authPassword);
NetworkResult network_reply =
NetworkFactory::performNetworkOperation(m_urlFolders,
@ -166,7 +166,7 @@ bool OwnCloudNetworkFactory::deleteFeed(const QString& feed_id, const QNetworkPr
QList<QPair<QByteArray, QByteArray>> headers;
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, OWNCLOUD_CONTENT_TYPE_JSON);
headers << NetworkFactory::generateBasicAuthHeader(Feed::Protection::BasicProtection, m_authUsername, m_authPassword);
headers << NetworkFactory::generateBasicAuthHeader(NetworkFactory::NetworkAuthentication::Basic, m_authUsername, m_authPassword);
NetworkResult network_reply =
NetworkFactory::performNetworkOperation(final_url,
@ -210,7 +210,7 @@ bool OwnCloudNetworkFactory::createFeed(const QString& url, int parent_id, const
QList<QPair<QByteArray, QByteArray>> headers;
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, OWNCLOUD_CONTENT_TYPE_JSON);
headers << NetworkFactory::generateBasicAuthHeader(Feed::Protection::BasicProtection, m_authUsername, m_authPassword);
headers << NetworkFactory::generateBasicAuthHeader(NetworkFactory::NetworkAuthentication::Basic, m_authUsername, m_authPassword);
NetworkResult network_reply =
NetworkFactory::performNetworkOperation(m_urlFeeds,
@ -248,7 +248,7 @@ bool OwnCloudNetworkFactory::renameFeed(const QString& new_name,
QList<QPair<QByteArray, QByteArray>> headers;
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, OWNCLOUD_CONTENT_TYPE_JSON);
headers << NetworkFactory::generateBasicAuthHeader(Feed::Protection::BasicProtection, m_authUsername, m_authPassword);
headers << NetworkFactory::generateBasicAuthHeader(NetworkFactory::NetworkAuthentication::Basic, m_authUsername, m_authPassword);
NetworkResult network_reply =
NetworkFactory::performNetworkOperation(final_url,
@ -287,7 +287,7 @@ OwnCloudGetMessagesResponse OwnCloudNetworkFactory::getMessages(int feed_id, con
QList<QPair<QByteArray, QByteArray>> headers;
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, OWNCLOUD_CONTENT_TYPE_JSON);
headers << NetworkFactory::generateBasicAuthHeader(Feed::Protection::BasicProtection, m_authUsername, m_authPassword);
headers << NetworkFactory::generateBasicAuthHeader(NetworkFactory::NetworkAuthentication::Basic, m_authUsername, m_authPassword);
NetworkResult network_reply =
NetworkFactory::performNetworkOperation(final_url,
@ -318,7 +318,7 @@ QNetworkReply::NetworkError OwnCloudNetworkFactory::triggerFeedUpdate(int feed_i
QList<QPair<QByteArray, QByteArray>> headers;
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, OWNCLOUD_CONTENT_TYPE_JSON);
headers << NetworkFactory::generateBasicAuthHeader(Feed::Protection::BasicProtection, m_authUsername, m_authPassword);
headers << NetworkFactory::generateBasicAuthHeader(NetworkFactory::NetworkAuthentication::Basic, m_authUsername, m_authPassword);
NetworkResult network_reply =
NetworkFactory::performNetworkOperation(m_urlFeedsUpdate.arg(authUsername(), QString::number(feed_id)),
@ -365,7 +365,7 @@ NetworkResult OwnCloudNetworkFactory::markMessagesRead(RootItem::ReadStatus stat
QList<QPair<QByteArray, QByteArray>> headers;
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, OWNCLOUD_CONTENT_TYPE_JSON);
headers << NetworkFactory::generateBasicAuthHeader(Feed::Protection::BasicProtection, m_authUsername, m_authPassword);
headers << NetworkFactory::generateBasicAuthHeader(NetworkFactory::NetworkAuthentication::Basic, m_authUsername, m_authPassword);
QByteArray output;
@ -411,7 +411,7 @@ NetworkResult OwnCloudNetworkFactory::markMessagesStarred(RootItem::Importance i
QList<QPair<QByteArray, QByteArray>> headers;
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, OWNCLOUD_CONTENT_TYPE_JSON);
headers << NetworkFactory::generateBasicAuthHeader(Feed::Protection::BasicProtection, m_authUsername, m_authPassword);
headers << NetworkFactory::generateBasicAuthHeader(NetworkFactory::NetworkAuthentication::Basic, m_authUsername, m_authPassword);
QByteArray output;

View File

@ -131,7 +131,7 @@ StandardFeedDetails::StandardFeedDetails(QWidget* parent) : QWidget(parent) {
void StandardFeedDetails::guessIconOnly(StandardFeed::SourceType source_type,
const QString& source,
const QString& post_process_script,
Feed::Protection protection,
NetworkFactory::NetworkAuthentication protection,
const QString& username,
const QString& password,
const QNetworkProxy& custom_proxy) {
@ -168,7 +168,7 @@ void StandardFeedDetails::guessIconOnly(StandardFeed::SourceType source_type,
void StandardFeedDetails::guessFeed(StandardFeed::SourceType source_type,
const QString& source,
const QString& post_process_script,
Feed::Protection protection,
NetworkFactory::NetworkAuthentication protection,
const QString& username,
const QString& password,
const QNetworkProxy& custom_proxy) {

View File

@ -28,14 +28,14 @@ class StandardFeedDetails : public QWidget {
void guessIconOnly(StandardFeed::SourceType source_type,
const QString& source,
const QString& post_process_script,
Feed::Protection protection,
NetworkFactory::NetworkAuthentication protection,
const QString& username,
const QString& password,
const QNetworkProxy& custom_proxy = QNetworkProxy::ProxyType::DefaultProxy);
void guessFeed(StandardFeed::SourceType source_type,
const QString& source,
const QString& post_process_script,
Feed::Protection protection,
NetworkFactory::NetworkAuthentication protection,
const QString& username,
const QString& password,
const QNetworkProxy& custom_proxy = QNetworkProxy::ProxyType::DefaultProxy);

View File

@ -14,7 +14,6 @@
#include "miscellaneous/iconfactory.h"
#include "miscellaneous/settings.h"
#include "miscellaneous/textfactory.h"
#include "network-web/networkfactory.h"
#include "services/abstract/recyclebin.h"
#include "services/standard/definitions.h"
#include "services/standard/gui/formstandardfeeddetails.h"
@ -42,7 +41,7 @@ StandardFeed::StandardFeed(RootItem* parent_item) : Feed(parent_item) {
m_sourceType = SourceType::Url;
m_encoding = m_postProcessScript = QString();
m_protection = Protection::NoProtection;
m_protection = NetworkFactory::NetworkAuthentication::NoAuthentication;
m_username = QString();
m_password = QString();
}
@ -95,11 +94,11 @@ bool StandardFeed::deleteViaGui() {
}
}
StandardFeed::Protection StandardFeed::protection() const {
NetworkFactory::NetworkAuthentication StandardFeed::protection() const {
return m_protection;
}
void StandardFeed::setProtection(Protection protect) {
void StandardFeed::setProtection(NetworkFactory::NetworkAuthentication protect) {
m_protection = protect;
}
@ -138,7 +137,7 @@ void StandardFeed::setCustomDatabaseData(const QVariantHash& data) {
setType(Type(data[QSL("type")].toInt()));
setEncoding(data[QSL("encoding")].toString());
setPostProcessScript(data[QSL("post_process")].toString());
setProtection(Protection(data[QSL("protected")].toInt()));
setProtection(NetworkFactory::NetworkAuthentication(data[QSL("protected")].toInt()));
setUsername(data[QSL("username")].toString());
setPassword(TextFactory::decrypt(data[QSL("password")].toString()));
}
@ -231,7 +230,7 @@ void StandardFeed::setSourceType(SourceType source_type) {
StandardFeed* StandardFeed::guessFeed(StandardFeed::SourceType source_type,
const QString& source,
const QString& post_process_script,
Feed::Protection protection,
NetworkFactory::NetworkFactory::NetworkAuthentication protection,
const QString& username,
const QString& password,
const QNetworkProxy& custom_proxy) {

View File

@ -5,6 +5,8 @@
#include "services/abstract/feed.h"
#include "network-web/networkfactory.h"
#include <QCoreApplication>
#include <QDateTime>
#include <QMetaType>
@ -58,8 +60,8 @@ class StandardFeed : public Feed {
QString postProcessScript() const;
void setPostProcessScript(const QString& post_process_script);
Protection protection() const;
void setProtection(Protection protect);
NetworkFactory::NetworkAuthentication protection() const;
void setProtection(NetworkFactory::NetworkAuthentication protect);
QString username() const;
void setUsername(const QString& username);
@ -75,7 +77,7 @@ class StandardFeed : public Feed {
static StandardFeed* guessFeed(SourceType source_type,
const QString& url,
const QString& post_process_script,
Protection protection,
NetworkFactory::NetworkAuthentication protection,
const QString& username = QString(),
const QString& password = QString(),
const QNetworkProxy& custom_proxy = QNetworkProxy::ProxyType::DefaultProxy);
@ -108,7 +110,7 @@ class StandardFeed : public Feed {
Type m_type;
QString m_postProcessScript;
QString m_encoding;
Protection m_protection = Protection::NoProtection;
NetworkFactory::NetworkAuthentication m_protection = NetworkFactory::NetworkAuthentication::NoAuthentication;
QString m_username;
QString m_password;
};

View File

@ -184,7 +184,7 @@ bool FeedsImportExportModel::produceFeed(const FeedLookup& feed_lookup) {
new_feed = StandardFeed::guessFeed(StandardFeed::SourceType::Url,
feed_lookup.url,
feed_lookup.post_process_script,
Feed::Protection::NoProtection,
NetworkFactory::NetworkAuthentication::NoAuthentication,
{},
{},
feed_lookup.custom_proxy);

View File

@ -39,7 +39,7 @@ void FormTtRssFeedDetails::apply() {
root->network()->subscribeToFeed(m_feedDetails->ui.m_txtUrl->lineEdit()->text(),
category_id,
m_serviceRoot->networkProxy(),
m_authDetails->authenticationType() == Feed::Protection::BasicProtection,
m_authDetails->authenticationType() == NetworkFactory::NetworkAuthentication::Basic,
m_authDetails->m_txtUsername->lineEdit()->text(),
m_authDetails->m_txtPassword->lineEdit()->text());

View File

@ -87,7 +87,7 @@ TtRssLoginResponse TtRssNetworkFactory::login(const QNetworkProxy& proxy) {
QList<QPair<QByteArray, QByteArray>> headers;
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
headers << NetworkFactory::generateBasicAuthHeader(Feed::Protection::BasicProtection, m_authUsername, m_authPassword);
headers << NetworkFactory::generateBasicAuthHeader(NetworkFactory::NetworkAuthentication::Basic, m_authUsername, m_authPassword);
NetworkResult network_reply =
NetworkFactory::performNetworkOperation(m_fullUrl,
@ -126,7 +126,7 @@ TtRssResponse TtRssNetworkFactory::logout(const QNetworkProxy& proxy) {
QList<QPair<QByteArray, QByteArray>> headers;
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
headers << NetworkFactory::generateBasicAuthHeader(Feed::Protection::BasicProtection,
headers << NetworkFactory::generateBasicAuthHeader(NetworkFactory::NetworkAuthentication::Basic,
m_authUsername,
m_authPassword);
@ -173,7 +173,7 @@ TtRssGetLabelsResponse TtRssNetworkFactory::getLabels(const QNetworkProxy& proxy
QList<QPair<QByteArray, QByteArray>> headers;
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
headers << NetworkFactory::generateBasicAuthHeader(Feed::Protection::BasicProtection, m_authUsername, m_authPassword);
headers << NetworkFactory::generateBasicAuthHeader(NetworkFactory::NetworkAuthentication::Basic, m_authUsername, m_authPassword);
NetworkResult network_reply =
NetworkFactory::performNetworkOperation(m_fullUrl,
@ -224,7 +224,7 @@ TtRssResponse TtRssNetworkFactory::shareToPublished(const TtRssNoteToPublish& no
QList<QPair<QByteArray, QByteArray>> headers;
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
headers << NetworkFactory::generateBasicAuthHeader(Feed::Protection::BasicProtection, m_authUsername, m_authPassword);
headers << NetworkFactory::generateBasicAuthHeader(NetworkFactory::NetworkAuthentication::Basic, m_authUsername, m_authPassword);
NetworkResult network_reply =
NetworkFactory::performNetworkOperation(m_fullUrl,
@ -277,7 +277,7 @@ TtRssGetFeedsCategoriesResponse TtRssNetworkFactory::getFeedsCategories(const QN
QList<QPair<QByteArray, QByteArray>> headers;
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
headers << NetworkFactory::generateBasicAuthHeader(Feed::Protection::BasicProtection, m_authUsername, m_authPassword);
headers << NetworkFactory::generateBasicAuthHeader(NetworkFactory::NetworkAuthentication::Basic, m_authUsername, m_authPassword);
NetworkResult network_reply =
NetworkFactory::performNetworkOperation(m_fullUrl,
@ -337,7 +337,7 @@ TtRssGetCompactHeadlinesResponse TtRssNetworkFactory::getCompactHeadlines(int fe
QList<QPair<QByteArray, QByteArray>> headers;
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
headers << NetworkFactory::generateBasicAuthHeader(Feed::Protection::BasicProtection, m_authUsername, m_authPassword);
headers << NetworkFactory::generateBasicAuthHeader(NetworkFactory::NetworkAuthentication::Basic, m_authUsername, m_authPassword);
NetworkResult network_reply =
NetworkFactory::performNetworkOperation(m_fullUrl,
@ -399,7 +399,7 @@ TtRssGetHeadlinesResponse TtRssNetworkFactory::getArticle(const QStringList& art
QList<QPair<QByteArray, QByteArray>> headers;
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
headers << NetworkFactory::generateBasicAuthHeader(Feed::Protection::BasicProtection, m_authUsername, m_authPassword);
headers << NetworkFactory::generateBasicAuthHeader(NetworkFactory::NetworkAuthentication::Basic, m_authUsername, m_authPassword);
NetworkResult network_reply =
NetworkFactory::performNetworkOperation(m_fullUrl,
@ -466,7 +466,7 @@ TtRssGetHeadlinesResponse TtRssNetworkFactory::getHeadlines(int feed_id,
QList<QPair<QByteArray, QByteArray>> headers;
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
headers << NetworkFactory::generateBasicAuthHeader(Feed::Protection::BasicProtection, m_authUsername, m_authPassword);
headers << NetworkFactory::generateBasicAuthHeader(NetworkFactory::NetworkAuthentication::Basic, m_authUsername, m_authPassword);
NetworkResult network_reply =
NetworkFactory::performNetworkOperation(m_fullUrl,
@ -524,7 +524,7 @@ TtRssResponse TtRssNetworkFactory::setArticleLabel(const QStringList& article_id
QList<QPair<QByteArray, QByteArray>> headers;
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
headers << NetworkFactory::generateBasicAuthHeader(Feed::Protection::BasicProtection, m_authUsername, m_authPassword);
headers << NetworkFactory::generateBasicAuthHeader(NetworkFactory::NetworkAuthentication::Basic, m_authUsername, m_authPassword);
NetworkResult network_reply =
NetworkFactory::performNetworkOperation(m_fullUrl,
@ -583,7 +583,7 @@ TtRssUpdateArticleResponse TtRssNetworkFactory::updateArticles(const QStringList
QList<QPair<QByteArray, QByteArray>> headers;
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
headers << NetworkFactory::generateBasicAuthHeader(Feed::Protection::BasicProtection, m_authUsername, m_authPassword);
headers << NetworkFactory::generateBasicAuthHeader(NetworkFactory::NetworkAuthentication::Basic, m_authUsername, m_authPassword);
NetworkResult network_reply =
NetworkFactory::performNetworkOperation(m_fullUrl,
@ -647,7 +647,7 @@ TtRssSubscribeToFeedResponse TtRssNetworkFactory::subscribeToFeed(const QString&
QList<QPair<QByteArray, QByteArray>> headers;
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
headers << NetworkFactory::generateBasicAuthHeader(Feed::Protection::BasicProtection, m_authUsername, m_authPassword);
headers << NetworkFactory::generateBasicAuthHeader(NetworkFactory::NetworkAuthentication::Basic, m_authUsername, m_authPassword);
NetworkResult network_reply =
NetworkFactory::performNetworkOperation(m_fullUrl,
@ -699,7 +699,7 @@ TtRssUnsubscribeFeedResponse TtRssNetworkFactory::unsubscribeFeed(int feed_id, c
QList<QPair<QByteArray, QByteArray>> headers;
headers << QPair<QByteArray, QByteArray>(HTTP_HEADERS_CONTENT_TYPE, TTRSS_CONTENT_TYPE_JSON);
headers << NetworkFactory::generateBasicAuthHeader(Feed::Protection::BasicProtection, m_authUsername, m_authPassword);
headers << NetworkFactory::generateBasicAuthHeader(NetworkFactory::NetworkAuthentication::Basic, m_authUsername, m_authPassword);
NetworkResult network_reply =
NetworkFactory::performNetworkOperation(m_fullUrl,
@ -949,7 +949,7 @@ RootItem* TtRssGetFeedsCategoriesResponse::feedsCategories(TtRssNetworkFactory*
QList<QPair<QByteArray, QByteArray>> headers;
if (network->authIsUsed()) {
headers << NetworkFactory::generateBasicAuthHeader(Feed::Protection::BasicProtection,
headers << NetworkFactory::generateBasicAuthHeader(NetworkFactory::NetworkAuthentication::Basic,
network->authUsername(),
network->authPassword());
}