aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-04-19 09:45:53 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-04-19 09:45:53 +0200
commit8036d3e88d6d744e54a5595c23652c7c028efa49 (patch)
treefb5ed3194c44674124ffd03260ceddd69ed53080
parentLoad URL/Search page menu actions (diff)
downloadsmolbote-8036d3e88d6d744e54a5595c23652c7c028efa49.tar.xz
Removed MainWindow::titleChangedConnection
-rw-r--r--.hgignore3
-rw-r--r--lib/configuration/configuration.cpp2
-rw-r--r--src/mainwindow/mainwindow.cpp10
-rw-r--r--src/mainwindow/mainwindow.h2
4 files changed, 5 insertions, 12 deletions
diff --git a/.hgignore b/.hgignore
index 3b2deab..94233be 100644
--- a/.hgignore
+++ b/.hgignore
@@ -5,3 +5,6 @@ cmake-build-*
# kdevelop
build*
.kdev4
+
+# qtcreator
+.user
diff --git a/lib/configuration/configuration.cpp b/lib/configuration/configuration.cpp
index 7c7c760..fdcb5b5 100644
--- a/lib/configuration/configuration.cpp
+++ b/lib/configuration/configuration.cpp
@@ -24,7 +24,7 @@ Configuration::Configuration()
("mainwindow.height", po::value<int>()->default_value(720))
("mainwindow.width", po::value<int>()->default_value(1280))
("mainwindow.maximized", po::value<bool>()->default_value(true))
- ("mainwindow.title", po::value<std::string>()->default_value(" — smolbote"))
+ ("mainwindow.title", po::value<std::string>()->default_value("smolbote"))
// main window shortcuts
("mainwindow.shortcuts.newTab", po::value<std::string>()->default_value("Ctrl+T"))
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<Configuration> &config, QWidget *parent)
// create UI
resize(config->value<int>("mainwindow.width").value(), config->value<int>("mainwindow.height").value());
- titleSuffix = QString::fromStdString(config->value<std::string>("mainwindow.title").value());
- setWindowTitle(tr("smolbote"));
+ setWindowTitle(QString::fromStdString(config->value<std::string>("mainwindow.title").value()));
if(config->value<bool>("mainwindow.maximized").value())
showMaximized();
else
@@ -63,7 +62,6 @@ MainWindow::MainWindow(std::shared_ptr<Configuration> &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<Configuration> &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<Configuration> &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<Configuration> m_config;
- QMetaObject::Connection titleChangedConnection;
QMetaObject::Connection addressBarConnection, navigationBarConnection;
QMetaObject::Connection searchBoxConnection;
QMetaObject::Connection statusBarConnection;