aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2018-09-14 16:47:23 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-09-15 15:51:26 -0700
commit6d552d61b941dbc3a018ba46afdf27812bee2073 (patch)
tree391e1b418d4fe8429c38755ebd820ab7f69c4388 /desktop-widgets
parent858740e8a1ad9b0febb1f805cccf1f943062375b (diff)
downloadsubsurface-6d552d61b941dbc3a018ba46afdf27812bee2073.tar.gz
code cleanup: allocate the vector in one go
The << alternative can reallocate the vector, but we know it's size, so preallocate. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/mainwindow.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index afdf02668..944a41a6f 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -142,15 +142,15 @@ MainWindow::MainWindow() : QMainWindow(),
// what is a sane order for those icons? we should have the ones the user is
// most likely to want towards the top so they are always visible
// and the ones that someone likely sets and then never touches again towards the bottom
- profileToolbarActions << ui.profCalcCeiling << ui.profCalcAllTissues << // start with various ceilings
- ui.profIncrement3m << ui.profDcCeiling <<
- ui.profPhe << ui.profPn2 << ui.profPO2 << // partial pressure graphs
- ui.profRuler << ui.profScaled << // measuring and scaling
- ui.profTogglePicture << ui.profTankbar <<
- ui.profMod << ui.profNdl_tts << // various values that a user is either interested in or not
- ui.profEad << ui.profSAC <<
- ui.profHR << // very few dive computers support this
- ui.profTissues; // maybe less frequently used
+ profileToolbarActions = { ui.profCalcCeiling, ui.profCalcAllTissues, // start with various ceilings
+ ui.profIncrement3m, ui.profDcCeiling,
+ ui.profPhe, ui.profPn2, ui.profPO2, // partial pressure graphs
+ ui.profRuler, ui.profScaled, // measuring and scaling
+ ui.profTogglePicture, ui.profTankbar,
+ ui.profMod, ui.profNdl_tts, // various values that a user is either interested in or not
+ ui.profEad, ui.profSAC,
+ ui.profHR, // very few dive computers support this
+ ui.profTissues}; // maybe less frequently used
QToolBar *toolBar = new QToolBar();
Q_FOREACH (QAction *a, profileToolbarActions)