aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwindow/mainwindow.cpp')
-rw-r--r--src/mainwindow/mainwindow.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mainwindow/mainwindow.cpp b/src/mainwindow/mainwindow.cpp
index 71b594a..7fb7d9e 100644
--- a/src/mainwindow/mainwindow.cpp
+++ b/src/mainwindow/mainwindow.cpp
@@ -69,7 +69,7 @@ MainWindow::MainWindow(const std::unique_ptr<Configuration> &config, QWidget *pa
config->setShortcut(subwindowMenuAction, "subwindow.shortcuts.menu");
connect(subwindowMenuAction, &QAction::triggered, this, [this]() {
QMdiSubWindow *window = mdiArea->currentSubWindow();
- if(window) {
+ if(window != nullptr) {
// show the menu at the subwindow position
// position has to be global, and mapped by the mdiArea (parentWidget() of the subwindow)
const auto position = mdiArea->mapToGlobal(window->pos());
@@ -114,20 +114,20 @@ MainWindow::MainWindow(const std::unique_ptr<Configuration> &config, QWidget *pa
// address bar
connect(addressBar, &AddressBar::search, this, [this](const QString &term) {
- if(this->currentView) {
+ if(this->currentView != nullptr) {
currentView->search(term);
currentView->setFocus();
}
});
connect(addressBar, &AddressBar::load, this, [this](const QUrl &url) {
- if(this->currentView) {
+ if(this->currentView != nullptr) {
currentView->load(url);
currentView->setFocus();
}
});
connect(addressBar, &AddressBar::giveFocus, this, [this]() {
- if(this->currentView) {
+ if(this->currentView != nullptr) {
currentView->setFocus();
}
});
@@ -244,13 +244,13 @@ SubWindow *MainWindow::createSubWindow(WebProfile *profile, bool openProfileNewt
void MainWindow::setView(WebView *view)
{
- if(currentView) {
+ if(currentView != nullptr) {
// disconnect old view
- disconnect(currentView, 0, addressBar, 0);
+ disconnect(currentView, nullptr, addressBar, nullptr);
}
currentView = view;
- if(view) {
+ if(view != nullptr) {
connect(view, &WebView::urlChanged, addressBar, &AddressBar::setUrl);
addressBar->setUrl(view->url());
@@ -277,7 +277,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
}
mdiArea->closeAllSubWindows();
- if(mdiArea->currentSubWindow())
+ if(mdiArea->currentSubWindow() != nullptr)
event->ignore();
else
event->accept();