mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-02-02 10:27:15 +01:00
Work on feed-on-page detection.
This commit is contained in:
parent
06fb567eac
commit
0b15e72d30
@ -32,6 +32,14 @@
|
|||||||
NetworkFactory::NetworkFactory() {
|
NetworkFactory::NetworkFactory() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStringList NetworkFactory::extractFeedLinksFromHtmlPage(const QString &html) {
|
||||||
|
QStringList feeds;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return feeds;
|
||||||
|
}
|
||||||
|
|
||||||
QString NetworkFactory::networkErrorText(QNetworkReply::NetworkError error_code) {
|
QString NetworkFactory::networkErrorText(QNetworkReply::NetworkError error_code) {
|
||||||
switch (error_code) {
|
switch (error_code) {
|
||||||
case QNetworkReply::ProtocolUnknownError:
|
case QNetworkReply::ProtocolUnknownError:
|
||||||
|
@ -34,6 +34,8 @@ class NetworkFactory {
|
|||||||
explicit NetworkFactory();
|
explicit NetworkFactory();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
static QStringList extractFeedLinksFromHtmlPage(const QString &html);
|
||||||
|
|
||||||
// Returns human readable text for given network error.
|
// Returns human readable text for given network error.
|
||||||
static QString networkErrorText(QNetworkReply::NetworkError error_code);
|
static QString networkErrorText(QNetworkReply::NetworkError error_code);
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "network-web/webbrowsernetworkaccessmanager.h"
|
#include "network-web/webbrowsernetworkaccessmanager.h"
|
||||||
#include "network-web/webpage.h"
|
#include "network-web/webpage.h"
|
||||||
#include "network-web/webview.h"
|
#include "network-web/webview.h"
|
||||||
|
#include "network-web/networkfactory.h"
|
||||||
#include "miscellaneous/skinfactory.h"
|
#include "miscellaneous/skinfactory.h"
|
||||||
#include "gui/formmain.h"
|
#include "gui/formmain.h"
|
||||||
#include "gui/tabwidget.h"
|
#include "gui/tabwidget.h"
|
||||||
@ -158,6 +159,15 @@ void WebBrowser::onLoadingProgress(int progress) {
|
|||||||
void WebBrowser::onLoadingFinished(bool success) {
|
void WebBrowser::onLoadingFinished(bool success) {
|
||||||
Q_UNUSED(success)
|
Q_UNUSED(success)
|
||||||
|
|
||||||
|
if (success) {
|
||||||
|
// Let's check if there are any feeds defined on the web and eventually
|
||||||
|
// display "Add feeds" button.
|
||||||
|
QString loaded_html = m_webView->page()->toHtml();
|
||||||
|
QStringList feeds_on_page = NetworkFactory::extractFeedLinksFromHtmlPage(loaded_html);
|
||||||
|
|
||||||
|
// TODO: mame načteno html, nyni z něj funkcí vytáhneme seznam adres kanálů. dodelat tu fci.
|
||||||
|
}
|
||||||
|
|
||||||
m_loadingProgress->hide();
|
m_loadingProgress->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user