diff options
Diffstat (limited to 'src/session')
-rw-r--r-- | src/session/session.cpp | 2 | ||||
-rw-r--r-- | src/session/sessiondialog.cpp | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/session/session.cpp b/src/session/session.cpp index 51575bf..67cea70 100644 --- a/src/session/session.cpp +++ b/src/session/session.cpp @@ -120,7 +120,7 @@ void Session::restoreView(WebView *view, const QJsonObject &data) Q_CHECK_PTR(profileManager); auto *profile = profileManager->profile(data["profile"].toString()); - if(profile) + if(profile != nullptr) view->setProfile(profile); auto url = data.value("url"); diff --git a/src/session/sessiondialog.cpp b/src/session/sessiondialog.cpp index 184c44d..b734088 100644 --- a/src/session/sessiondialog.cpp +++ b/src/session/sessiondialog.cpp @@ -35,11 +35,11 @@ SessionDialog::SessionDialog(QWidget *parent) connect(ui->listWidget, &QListWidget::currentItemChanged, this, [this](QListWidgetItem *currentItem, QListWidgetItem *previousItem) { auto *currentWidget = qobject_cast<SessionForm *>(ui->listWidget->itemWidget(currentItem)); - if(currentWidget) + if(currentWidget != nullptr) currentWidget->ui->delete_toolButton->show(); auto *previousWidget = qobject_cast<SessionForm *>(ui->listWidget->itemWidget(previousItem)); - if(previousWidget) + if(previousWidget != nullptr) previousWidget->ui->delete_toolButton->hide(); }); @@ -53,7 +53,7 @@ SessionDialog::SessionDialog(QWidget *parent) accepted_connection = connect(this, &SessionDialog::accepted, this, [this, browser]() { auto *currentWidget = qobject_cast<SessionForm *>(ui->listWidget->itemWidget(ui->listWidget->currentItem())); - if(currentWidget) + if(currentWidget != nullptr) this->openSession(currentWidget->ui->label->text()); else browser->createWindow(); @@ -76,7 +76,7 @@ std::optional<QJsonObject> SessionDialog::pickSession() } auto *currentWidget = qobject_cast<SessionForm *>(ui->listWidget->itemWidget(ui->listWidget->currentItem())); - if(currentWidget) { + if(currentWidget != nullptr) { QFile json(currentWidget->ui->label->text()); if(json.open(QIODevice::ReadOnly | QIODevice::Text)) { auto doc = QJsonDocument::fromJson(json.readAll()); |