# HG changeset patch # User Teemu Piippo # Date 1522309365 -10800 # Node ID 48374309f3d19f943ad10f7e80c7d08dae49445b # Parent 55fbbd4bdf86e7eced03fb06b2c74a5fd4ce12f4 refactor diff -r 55fbbd4bdf86 -r 48374309f3d1 src/generics/functions.h --- a/src/generics/functions.h Thu Mar 29 10:31:01 2018 +0300 +++ b/src/generics/functions.h Thu Mar 29 10:42:45 2018 +0300 @@ -4,11 +4,18 @@ #include "../basics.h" using std::abs; +using std::acos; +using std::asin; +using std::atan; using std::atan2; using std::ceil; using std::cos; using std::floor; +using std::function; using std::hypot; +using std::log; +using std::log2; +using std::log10; using std::pow; using std::sin; using std::sort; diff -r 55fbbd4bdf86 -r 48374309f3d1 src/mainwindow.cpp --- a/src/mainwindow.cpp Thu Mar 29 10:31:01 2018 +0300 +++ b/src/mainwindow.cpp Thu Mar 29 10:42:45 2018 +0300 @@ -85,10 +85,10 @@ updateActions(); // Connect all actions and save default sequences - applyToActions ([&](QAction* act) + applyToActions([&](QAction* action) { - connect (act, SIGNAL (triggered()), this, SLOT (actionTriggered())); - m_defaultShortcuts[act] = act->shortcut(); + connect(action, SIGNAL (triggered()), this, SLOT (actionTriggered())); + m_defaultShortcuts[action] = action->shortcut(); }); connect( ui.header, @@ -776,12 +776,12 @@ // void MainWindow::saveShortcuts() { - applyToActions ([&](QAction* act) + applyToActions([&](QAction* action) { - QString const key = "shortcut_" + act->objectName(); + QString const key = "shortcut_" + action->objectName(); - if (m_defaultShortcuts[act] != act->shortcut()) - settingsObject().setValue(key, act->shortcut()); + if (m_defaultShortcuts[action] != action->shortcut()) + settingsObject().setValue(key, action->shortcut()); else settingsObject().remove(key); }); @@ -789,7 +789,7 @@ // --------------------------------------------------------------------------------------------------------------------- // -void MainWindow::applyToActions (std::function function) +void MainWindow::applyToActions(function function) { for (QAction* act : findChildren()) { diff -r 55fbbd4bdf86 -r 48374309f3d1 src/mainwindow.h --- a/src/mainwindow.h Thu Mar 29 10:31:01 2018 +0300 +++ b/src/mainwindow.h Thu Mar 29 10:42:45 2018 +0300 @@ -63,7 +63,7 @@ ~MainWindow(); void addMessage (QString msg); - void applyToActions (std::function function); + void applyToActions(function function); void changeDocument (LDDocument* f); void clearSelection(); void closeInitialDocument();