Thu, 29 Mar 2018 10:42:45 +0300
refactor
src/generics/functions.h | file | annotate | diff | comparison | revisions | |
src/mainwindow.cpp | file | annotate | diff | comparison | revisions | |
src/mainwindow.h | file | annotate | diff | comparison | revisions |
--- 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;
--- 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<void(QAction*)> function) +void MainWindow::applyToActions(function<void(QAction*)> function) { for (QAction* act : findChildren<QAction*>()) {
--- 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<void(QAction*)> function); + void applyToActions(function<void(QAction*)> function); void changeDocument (LDDocument* f); void clearSelection(); void closeInitialDocument();