From 8036d3e88d6d744e54a5595c23652c7c028efa49 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Thu, 19 Apr 2018 09:45:53 +0200 Subject: Removed MainWindow::titleChangedConnection --- src/mainwindow/mainwindow.cpp | 10 +--------- src/mainwindow/mainwindow.h | 2 -- 2 files changed, 1 insertion(+), 11 deletions(-) (limited to 'src/mainwindow') diff --git a/src/mainwindow/mainwindow.cpp b/src/mainwindow/mainwindow.cpp index c43e001..0052d13 100644 --- a/src/mainwindow/mainwindow.cpp +++ b/src/mainwindow/mainwindow.cpp @@ -36,8 +36,7 @@ MainWindow::MainWindow(std::shared_ptr &config, QWidget *parent) // create UI resize(config->value("mainwindow.width").value(), config->value("mainwindow.height").value()); - titleSuffix = QString::fromStdString(config->value("mainwindow.title").value()); - setWindowTitle(tr("smolbote")); + setWindowTitle(QString::fromStdString(config->value("mainwindow.title").value())); if(config->value("mainwindow.maximized").value()) showMaximized(); else @@ -63,7 +62,6 @@ MainWindow::MainWindow(std::shared_ptr &config, QWidget *parent) // connect signlas connect(mdiArea, &QMdiArea::subWindowActivated, this, [this, navigationToolBar](QMdiSubWindow *window) { - disconnect(titleChangedConnection); disconnect(addressBarConnection); disconnect(navigationBarConnection); disconnect(searchBoxConnection); @@ -77,11 +75,6 @@ MainWindow::MainWindow(std::shared_ptr &config, QWidget *parent) navigationToolBar->connectWebView(nullptr); searchBox->setView(nullptr); } else { - setWindowTitle(w->windowTitle() + titleSuffix); - titleChangedConnection = connect(w, &Window::windowTitleChanged, this, [this](const QString &title) { - this->setWindowTitle(title + titleSuffix); - }); - addressBar->connectWebView(w->currentView()); addressBarConnection = connect(w, &Window::currentViewChanged, addressBar, &AddressBar::connectWebView); navigationToolBar->connectWebView(w->currentView()); @@ -105,7 +98,6 @@ MainWindow::MainWindow(std::shared_ptr &config, QWidget *parent) MainWindow::~MainWindow() { - disconnect(titleChangedConnection); disconnect(addressBarConnection); disconnect(navigationBarConnection); disconnect(searchBoxConnection); diff --git a/src/mainwindow/mainwindow.h b/src/mainwindow/mainwindow.h index ee7d332..0d7939c 100644 --- a/src/mainwindow/mainwindow.h +++ b/src/mainwindow/mainwindow.h @@ -46,7 +46,6 @@ protected: void closeEvent(QCloseEvent *event) override; private: - QString titleSuffix; QMenu *toolsMenu = nullptr; AddressBar *addressBar = nullptr; SearchForm *searchBox = nullptr; @@ -54,7 +53,6 @@ private: std::shared_ptr m_config; - QMetaObject::Connection titleChangedConnection; QMetaObject::Connection addressBarConnection, navigationBarConnection; QMetaObject::Connection searchBoxConnection; QMetaObject::Connection statusBarConnection; -- cgit v1.2.1