|
|
|
@ -32,6 +32,7 @@
@@ -32,6 +32,7 @@
|
|
|
|
|
#define RSSSETTINGS_H |
|
|
|
|
|
|
|
|
|
#include <QStringList> |
|
|
|
|
#include <QNetworkCookie> |
|
|
|
|
#include "qinisettings.h" |
|
|
|
|
|
|
|
|
|
class RssSettings: public QIniSettings{ |
|
|
|
@ -94,6 +95,19 @@ public:
@@ -94,6 +95,19 @@ public:
|
|
|
|
|
return raw_cookies.split(':'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QList<QNetworkCookie> getHostNameQNetworkCookies(const QString& host_name) const { |
|
|
|
|
QList<QNetworkCookie> cookies; |
|
|
|
|
const QList<QByteArray> raw_cookies = getHostNameCookies(host_name); |
|
|
|
|
foreach (const QByteArray& raw_cookie, raw_cookies) { |
|
|
|
|
QList<QByteArray> cookie_parts = raw_cookie.split('='); |
|
|
|
|
if (cookie_parts.size() == 2) { |
|
|
|
|
qDebug("Loading cookie: %s = %s", cookie_parts.first().constData(), cookie_parts.last().constData()); |
|
|
|
|
cookies << QNetworkCookie(cookie_parts.first(), cookie_parts.last()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return cookies; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void setHostNameCookies(const QString &host_name, const QList<QByteArray> &cookies) { |
|
|
|
|
QMap<QString, QVariant> hosts_table = value("Rss/hosts_cookies").toMap(); |
|
|
|
|
QByteArray raw_cookies = ""; |
|
|
|
|