diff options
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r-- | src/mainwindow.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 861f7cf..6944ac7 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -90,8 +90,7 @@ MainWindow::MainWindow(QUrl defaultUrl, QWidget *parent) : connect(tabBar, SIGNAL(currentTabChanged(WebView*)), this, SLOT(handleTabChanged(WebView*))); // Load profile - m_profile = qApp->profile(sSettings->value("browser.profile.default").toString()); - tabBar->setProfile(m_profile); + tabBar->setProfile(qApp->profile(sSettings->value("browser.profile.default").toString())); // loading bar ui->statusBar->addPermanentWidget(progressBar); @@ -181,8 +180,8 @@ void MainWindow::about() void MainWindow::setProfile(WebEngineProfile *profile) { - m_profile = profile; - tabBar->setProfile(m_profile); + Q_ASSERT(profile != nullptr); + tabBar->setProfile(profile); } void MainWindow::toggleFullscreen() @@ -201,7 +200,7 @@ void MainWindow::newWindow(const QUrl &url) void MainWindow::handleTabChanged(WebView *view) { - Q_ASSERT(view); + Q_ASSERT(view != nullptr); // centralWidget can be a nullptr if(centralWidget()) { @@ -235,15 +234,15 @@ void MainWindow::handleUrlChanged() void MainWindow::handleTitleUpdated(const QString &title) { - setWindowTitle(sSettings->value("window.title").toString().replace("title", title).replace("profile", m_profile->name())); + setWindowTitle(sSettings->value("window.title").toString().replace("title", title).replace("profile", tabBar->profile()->name())); } void MainWindow::profileAction() { - m_profile->dialog()->showProfile(); + tabBar->profile()->dialog()->showProfile(); } void MainWindow::cookiesAction() { - m_profile->dialog()->showCookies(); + tabBar->profile()->dialog()->showCookies(); } |