summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-03-13 18:13:46 +0100
committerSimon Rettberg2019-03-13 18:13:46 +0100
commit2976c897389bb13562c045ce29a4139d79a9a04c (patch)
tree6f4fe8eaad887c0b85ef11ff691a9e5c4e70f30b
parentUpdate signal/slot connect to Qt5 style (diff)
downloadslxbrowser-2976c897389bb13562c045ce29a4139d79a9a04c.tar.gz
slxbrowser-2976c897389bb13562c045ce29a4139d79a9a04c.tar.xz
slxbrowser-2976c897389bb13562c045ce29a4139d79a9a04c.zip
SLXbrowser -> SlxBrowser
-rw-r--r--src/main.cpp2
-rw-r--r--src/slxbrowser.cpp28
-rw-r--r--src/slxbrowser.h6
3 files changed, 18 insertions, 18 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 208a635..2bf94f8 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -61,7 +61,7 @@ int main(int argc, char** argv)
settings.urlList = loadUrlList(parser.value(blacklist));
}
settings.isWhitelist = parser.isSet(whitelist);
- SLXbrowser main(settings);
+ SlxBrowser main(settings);
main.show();
app.installEventFilter(new KeyHandler());
app.exec();
diff --git a/src/slxbrowser.cpp b/src/slxbrowser.cpp
index c56d5da..1fe179f 100644
--- a/src/slxbrowser.cpp
+++ b/src/slxbrowser.cpp
@@ -10,7 +10,7 @@
static QRegularExpression urlListToRegExp(const QStringList &list);
-SLXbrowser::SLXbrowser(BrowserSettings settings)
+SlxBrowser::SlxBrowser(BrowserSettings settings)
: QMainWindow(nullptr),
_settings(settings),
_unsupportedUri(false),
@@ -38,11 +38,11 @@ SLXbrowser::SLXbrowser(BrowserSettings settings)
this->setCentralWidget(w);
_reset.setSingleShot(true);
- connect(&_reset, &QTimer::timeout, this, &SLXbrowser::reloadInitial);
+ connect(&_reset, &QTimer::timeout, this, &SlxBrowser::reloadInitial);
- connect(_browser, &WebView::loadStarted, this, &SLXbrowser::loadStarted);
- connect(_browser, &WebView::loadFinished, this, &SLXbrowser::loadFinished);
- connect(_browser, &WebView::loadProgress, this, &SLXbrowser::loadProgress);
+ connect(_browser, &WebView::loadStarted, this, &SlxBrowser::loadStarted);
+ connect(_browser, &WebView::loadFinished, this, &SlxBrowser::loadFinished);
+ connect(_browser, &WebView::loadProgress, this, &SlxBrowser::loadProgress);
//
QWebPage *page = _browser->page();
QNetworkAccessManager *nam;
@@ -55,19 +55,19 @@ SLXbrowser::SLXbrowser(BrowserSettings settings)
}
nam = new SlxNetworkAccessManager(urlListToRegExp(_settings.urlList), _settings.isWhitelist);
}
- connect(nam, &QNetworkAccessManager::sslErrors, this, &SLXbrowser::sslErrors);
- connect(nam, &QNetworkAccessManager::finished, this, &SLXbrowser::requestFinished);
+ connect(nam, &QNetworkAccessManager::sslErrors, this, &SlxBrowser::sslErrors);
+ connect(nam, &QNetworkAccessManager::finished, this, &SlxBrowser::requestFinished);
page->setNetworkAccessManager(nam);
page->mainFrame()->load(_settings.url);
//
_browser->show();
}
-SLXbrowser::~SLXbrowser()
+SlxBrowser::~SlxBrowser()
{
}
-void SLXbrowser::loadStarted()
+void SlxBrowser::loadStarted()
{
_reset.stop();
if (_settings.reloadInterval > 0) {
@@ -79,7 +79,7 @@ void SLXbrowser::loadStarted()
_progress->show();
}
-void SLXbrowser::loadFinished(bool ok)
+void SlxBrowser::loadFinished(bool ok)
{
_progress->hide();
qint64 now = QDateTime::currentMSecsSinceEpoch();
@@ -141,12 +141,12 @@ void SLXbrowser::loadFinished(bool ok)
_lastPageLoad = now;
}
-void SLXbrowser::loadProgress(int progress)
+void SlxBrowser::loadProgress(int progress)
{
_progress->setValue(progress);
}
-void SLXbrowser::sslErrors(QNetworkReply* reply, const QList<QSslError>& errors)
+void SlxBrowser::sslErrors(QNetworkReply* reply, const QList<QSslError>& errors)
{
if (_settings.ignoreSslErrors) {
reply->ignoreSslErrors();
@@ -155,7 +155,7 @@ void SLXbrowser::sslErrors(QNetworkReply* reply, const QList<QSslError>& errors)
_sslErrors.append(errors);
}
-void SLXbrowser::requestFinished(QNetworkReply *reply)
+void SlxBrowser::requestFinished(QNetworkReply *reply)
{
if (reply->error() == QNetworkReply::ProtocolUnknownError) {
_unsupportedUri = true;
@@ -167,7 +167,7 @@ void SLXbrowser::requestFinished(QNetworkReply *reply)
}
}
-void SLXbrowser::reloadInitial()
+void SlxBrowser::reloadInitial()
{
_browser->page()->mainFrame()->load(_settings.url);
}
diff --git a/src/slxbrowser.h b/src/slxbrowser.h
index f68e186..2c14465 100644
--- a/src/slxbrowser.h
+++ b/src/slxbrowser.h
@@ -21,12 +21,12 @@ struct BrowserSettings
QStringList urlList;
};
-class SLXbrowser : public QMainWindow
+class SlxBrowser : public QMainWindow
{
Q_OBJECT
public:
- SLXbrowser(BrowserSettings settings);
- virtual ~SLXbrowser();
+ SlxBrowser(BrowserSettings settings);
+ virtual ~SlxBrowser();
private slots:
void loadStarted();