summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorSimon Rettberg2025-11-13 13:48:37 +0100
committerSimon Rettberg2025-11-13 14:00:03 +0100
commit2c3b026349349729141ca46bd9d292327da2dfe2 (patch)
treeaf0650430c311a319bda68c89b4fd39036a9ec2c /src/main.cpp
parentFix: error page not showing HTTP error codes, but "Unknown Error" (diff)
downloadslxbrowser-2c3b026349349729141ca46bd9d292327da2dfe2.tar.gz
slxbrowser-2c3b026349349729141ca46bd9d292327da2dfe2.tar.xz
slxbrowser-2c3b026349349729141ca46bd9d292327da2dfe2.zip
Port to QtWebEngine (thx Junie), bump to C++20HEADmaster
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 4d3b6e8..f9659d8 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -8,11 +8,11 @@
class KeyHandler : public QObject
{
public:
- KeyHandler(SlxBrowser *win) : QObject(), _win(win) {}
- bool eventFilter(QObject *obj, QEvent *event)
+ explicit KeyHandler(SlxBrowser *win) : _win(win) {}
+ bool eventFilter(QObject *obj, QEvent *event) override
{
if (event->type() == QEvent::KeyPress) {
- QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
+ auto *keyEvent = dynamic_cast<QKeyEvent*>(event);
if ( keyEvent->key() == Qt::Key_Q && (keyEvent->modifiers() & Qt::ControlModifier))
exit(0);
_win->activity();
@@ -86,7 +86,7 @@ QStringList loadUrlList(const QString &file)
QFile textFile(file);
if (!textFile.open(QFile::ReadOnly)) {
QTextStream(stdout) << "Cannot open URL list\n";
- return QStringList();
+ return {};
}
QTextStream textStream(&textFile);
while (true)