From 39c84aa2c2c0386f3bb32100e3bee2bd5f1cc99e Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 25 Jun 2016 17:16:20 +0300 Subject: [PATCH] Refactoring. Use C++11 lambdas. --HG-- branch : feature --- src/app/valentina/mainwindow.cpp | 21 ++++++--------------- src/app/valentina/mainwindow.h | 3 --- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 4da6d58e2..fdacde006 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -2973,18 +2973,6 @@ void MainWindow::ChangedHeight(const QString &text) } } -//--------------------------------------------------------------------------------------------------------------------- -void MainWindow::DockToolOptionsVisibilityChanged(bool visible) -{ - isDockToolOptionsVisible = visible; -} - -//--------------------------------------------------------------------------------------------------------------------- -void MainWindow::DockGropsVisibilityChanged(bool visible) -{ - isDockGroupsVisible = visible; -} - //--------------------------------------------------------------------------------------------------------------------- void MainWindow::SetDefaultHeight() { @@ -3610,12 +3598,15 @@ void MainWindow::AddDocks() //Add dock actionDockWidgetToolOptions = ui->dockWidgetToolOptions->toggleViewAction(); ui->menuPatternPiece->insertAction(ui->actionPattern_properties, actionDockWidgetToolOptions); - connect(ui->dockWidgetToolOptions, &QDockWidget::visibilityChanged, this, - &MainWindow::DockToolOptionsVisibilityChanged); + connect(ui->dockWidgetToolOptions, &QDockWidget::visibilityChanged, [this](bool visible){ + isDockToolOptionsVisible = visible; + }); actionDockWidgetGroups = ui->dockWidgetGroups->toggleViewAction(); ui->menuPatternPiece->insertAction(ui->actionPattern_properties, actionDockWidgetGroups); - connect(ui->dockWidgetGroups, &QDockWidget::visibilityChanged, this, &MainWindow::DockGropsVisibilityChanged); + connect(ui->dockWidgetGroups, &QDockWidget::visibilityChanged, [this](bool visible){ + isDockGroupsVisible = visible; + }); separatorAct = new QAction(this); separatorAct->setSeparator(true); diff --git a/src/app/valentina/mainwindow.h b/src/app/valentina/mainwindow.h index 943245dc9..828766427 100644 --- a/src/app/valentina/mainwindow.h +++ b/src/app/valentina/mainwindow.h @@ -207,9 +207,6 @@ private slots: void ChangedSize(const QString &text); void ChangedHeight(const QString & text); - void DockToolOptionsVisibilityChanged(bool visible); - void DockGropsVisibilityChanged(bool visible); - private: Q_DISABLE_COPY(MainWindow) /** @brief ui keeps information about user interface */