mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-01-22 05:37:03 +01:00
Work on feed-on-page detection.
This commit is contained in:
parent
06fb567eac
commit
0b15e72d30
@ -32,6 +32,14 @@
|
||||
NetworkFactory::NetworkFactory() {
|
||||
}
|
||||
|
||||
QStringList NetworkFactory::extractFeedLinksFromHtmlPage(const QString &html) {
|
||||
QStringList feeds;
|
||||
|
||||
|
||||
|
||||
return feeds;
|
||||
}
|
||||
|
||||
QString NetworkFactory::networkErrorText(QNetworkReply::NetworkError error_code) {
|
||||
switch (error_code) {
|
||||
case QNetworkReply::ProtocolUnknownError:
|
||||
|
@ -34,6 +34,8 @@ class NetworkFactory {
|
||||
explicit NetworkFactory();
|
||||
|
||||
public:
|
||||
static QStringList extractFeedLinksFromHtmlPage(const QString &html);
|
||||
|
||||
// Returns human readable text for given network error.
|
||||
static QString networkErrorText(QNetworkReply::NetworkError error_code);
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "network-web/webbrowsernetworkaccessmanager.h"
|
||||
#include "network-web/webpage.h"
|
||||
#include "network-web/webview.h"
|
||||
#include "network-web/networkfactory.h"
|
||||
#include "miscellaneous/skinfactory.h"
|
||||
#include "gui/formmain.h"
|
||||
#include "gui/tabwidget.h"
|
||||
@ -158,6 +159,15 @@ void WebBrowser::onLoadingProgress(int progress) {
|
||||
void WebBrowser::onLoadingFinished(bool 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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user