Improve the CMakeLists.txt. Cleanup unused variables. Removed som debug messages.

Sun, 27 Mar 2022 11:59:15 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sun, 27 Mar 2022 11:59:15 +0200
changeset 88
64cf5468fd22
parent 87
5e0ae285aaaf
child 89
231a0b1292f3

Improve the CMakeLists.txt. Cleanup unused variables. Removed som debug messages.

CMakeLists.txt file | annotate | diff | comparison | revisions
src/MainWindow.cpp file | annotate | diff | comparison | revisions
src/PrinterDialog.cpp file | annotate | diff | comparison | revisions
--- a/CMakeLists.txt	Sat Mar 26 22:45:02 2022 +0100
+++ b/CMakeLists.txt	Sun Mar 27 11:59:15 2022 +0200
@@ -14,7 +14,6 @@
 
 # Compile flags
 
-OPTION(DO_RELEASE_BUILD "If on, will do a release build. Otherwise, debug build." OFF)
 option(UPDATE_TRANSLATIONS "Enable rescanning sources to update .ts files" OFF)
 
 # Automatically run moc on source files when necessary
@@ -25,23 +24,6 @@
 SET( CMAKE_CXX_FLAGS_RELEASE "-Wall -ansi -pedantic -Wno-long-long -O2 -pipe" )
 SET( CMAKE_CXX_FLAGS_DEBUG "-Wall -g3 -pipe" )
 
-#====================================================Set build type=====================================================
-# We might always to tell the compiler to include debugging information (eg via the -g option on gcc).  It makes the
-# binaries slightly bigger on Linux, but helps greatly in analysing core dumps etc.  (In closed-source projects people
-# sometimes turn it off for release builds to make it harder to reverse engineer the software, but obviously that's not
-# an issue for us.)
-#
-# However, setting CMAKE_BUILD_TYPE to "Debug", also changes other things, such as the default location for config
-# files, which we don't want on a release build, so we would probably need to set compiler flags directly.
-#
-# .:TBD:. Investigate whether setting CMAKE_BUILD_TYPE to "RelWithDebInfo" does what we want.
-#
-#IF( ${DO_RELEASE_BUILD} )
-#   SET(CMAKE_BUILD_TYPE "Release")
-#ELSE()
-#   SET(CMAKE_BUILD_TYPE "Debug")
-#ENDIF()
-
 # ===== Directories =====
 
 IF( NOT EXEC_PREFIX )
--- a/src/MainWindow.cpp	Sat Mar 26 22:45:02 2022 +0100
+++ b/src/MainWindow.cpp	Sun Mar 27 11:59:15 2022 +0200
@@ -262,14 +262,14 @@
 void MainWindow::on_actionSupplies_list_triggered()
 {
     qDebug() << Q_FUNC_INFO;
-    QDialog *printer = new PrinterDialog(PR_SUPPLIES, -1, this);
+    PrinterDialog(PR_SUPPLIES, -1, this);
 }
 
 
 void MainWindow::on_actionYeast_bank_triggered()
 {
     qDebug() << Q_FUNC_INFO;
-    QDialog *printer = new PrinterDialog(PR_YEASTBANK, -1, this);
+    PrinterDialog(PR_YEASTBANK, -1, this);
 }
 
 
--- a/src/PrinterDialog.cpp	Sat Mar 26 22:45:02 2022 +0100
+++ b/src/PrinterDialog.cpp	Sun Mar 27 11:59:15 2022 +0200
@@ -30,18 +30,12 @@
 
     QPrinter printer(QPrinter::ScreenResolution);
     QPrintPreviewDialog preview(&printer, this);
-    connect(&preview, &QPrintPreviewDialog::paintRequested,
-            this, &PrinterDialog::printDocument);
+    connect(&preview, &QPrintPreviewDialog::paintRequested, this, &PrinterDialog::printDocument);
     preview.exec();
-
-    qDebug() << "return";
 }
 
 
-PrinterDialog::~PrinterDialog()
-{
-    qDebug() << "PrinterDialog done";
-}
+PrinterDialog::~PrinterDialog() {}
 
 
 void PrinterDialog::printDocument(QPrinter *printer)

mercurial