From 9e6a3bee0d029205169896dc9d2b39f421a3039a Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Sat, 15 Sep 2018 08:26:35 -0700 Subject: code cleanup: remove allocations Simply create the string in one go. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- desktop-widgets/mainwindow.cpp | 80 ++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 41 deletions(-) (limited to 'desktop-widgets') diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 72001ff4b..4e2365356 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -1342,26 +1342,25 @@ void MainWindow::on_actionHash_images_triggered() QString MainWindow::filter_open() { - QString f; - f += tr("Dive log files"); - f += " (*.ssrf"; - f += " *.xml"; - f += " *.can"; - f += " *.db" ; - f += " *.sql" ; - f += " *.dld"; - f += " *.jlb"; - f += " *.lvd"; - f += " *.sde"; - f += " *.udcf"; - f += " *.uddf"; - f += " *.dlf"; - f += " *.log"; - f += " *.txt"; - f += " *.apd"; - f += " *.dive"; - f += " *.zxu *.zxl"; - f += ");;"; + QString f = tr("Dive log files") + + " (*.ssrf" + " *.xml" + " *.can" + " *.db" + " *.sql" + " *.dld" + " *.jlb" + " *.lvd" + " *.sde" + " *.udcf" + " *.uddf" + " *.dlf" + " *.log" + " *.txt" + " *.apd" + " *.dive" + " *.zxu *.zxl" + ");;"; f += tr("Subsurface files") + " (*.ssrf *.xml);;"; f += tr("Cochran") + " (*.can);;"; @@ -1384,27 +1383,26 @@ QString MainWindow::filter_open() QString MainWindow::filter_import() { - QString f; - f += tr("Dive log files"); - f += " (*.ssrf"; - f += " *.xml"; - f += " *.can"; - f += " *.csv"; - f += " *.db" ; - f += " *.sql" ; - f += " *.dld"; - f += " *.jlb"; - f += " *.lvd"; - f += " *.sde"; - f += " *.udcf"; - f += " *.uddf"; - f += " *.dlf"; - f += " *.log"; - f += " *.txt"; - f += " *.apd"; - f += " *.dive"; - f += " *.zxu *.zxl"; - f += ");;"; + QString f = tr("Dive log files") + + " (*.ssrf" + " *.xml" + " *.can" + " *.csv" + " *.db" + " *.sql" + " *.dld" + " *.jlb" + " *.lvd" + " *.sde" + " *.udcf" + " *.uddf" + " *.dlf" + " *.log" + " *.txt" + " *.apd" + " *.dive" + " *.zxu *.zxl" + ");;"; f += tr("Subsurface files") + " (*.ssrf *.xml);;"; f += tr("Cochran") + " (*.can);;"; -- cgit v1.2.3-70-g09d2