aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwindow')
-rw-r--r--src/mainwindow/mainwindow.cpp10
-rw-r--r--src/mainwindow/subwindow.cpp2
2 files changed, 6 insertions, 6 deletions
diff --git a/src/mainwindow/mainwindow.cpp b/src/mainwindow/mainwindow.cpp
index 7e49ab8..0234f13 100644
--- a/src/mainwindow/mainwindow.cpp
+++ b/src/mainwindow/mainwindow.cpp
@@ -116,7 +116,7 @@ void MainWindow::createMenuBar()
createSubWindow();
}, QKeySequence(m_config->value<std::string>("mainwindow.shortcuts.newGroup").value().c_str()));
- smolboteMenu->addAction(tr("New window"), this, [this]() {
+ smolboteMenu->addAction(tr("New window"), this, []() {
auto *browser = qobject_cast<Browser *>(qApp);
if(browser)
browser->createWindow();
@@ -158,20 +158,20 @@ void MainWindow::addAction(ActionLocation where, QAction *action)
void MainWindow::addDockWidget(Qt::DockWidgetArea area, QWidget *widget)
{
- QList<QDockWidget *> docks;
+ QDockWidget *lastDock = nullptr;
for(QDockWidget *dock : findChildren<QDockWidget *>()) {
if(dockWidgetArea(dock) == area)
- docks.append(dock);
+ lastDock = dock;
}
DockWidget *dock = new DockWidget(widget->windowTitle(), this);
dock->setMinimumWidth(460);
dock->setWidget(widget);
- if(docks.empty())
+ if(lastDock == nullptr)
QMainWindow::addDockWidget(area, dock);
else
- tabifyDockWidget(docks.last(), dock);
+ tabifyDockWidget(lastDock, dock);
}
void MainWindow::removeDockWidget(QWidget *widget)
diff --git a/src/mainwindow/subwindow.cpp b/src/mainwindow/subwindow.cpp
index 497e6d0..17a2268 100644
--- a/src/mainwindow/subwindow.cpp
+++ b/src/mainwindow/subwindow.cpp
@@ -196,7 +196,7 @@ void SubWindow::restoreSession(const QJsonObject &sessionData)
return;
}
- for(const auto tab : tabs) {
+ for(const auto &tab : tabs) {
auto *view = new WebView(profile, this);
view->load(QUrl::fromUserInput(tab.toString()));
tabWidget->addTab(view);