changeset 83:83044206479e

Add some comments.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 24 Apr 2017 12:36:06 +0300
parents d65e053209ea
children 00db2c012481
files src/main.cpp
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/main.cpp	Mon Apr 24 12:26:28 2017 +0300
+++ b/src/main.cpp	Mon Apr 24 12:36:06 2017 +0300
@@ -16,6 +16,9 @@
 double setScale;
 
 
+//
+// Display an error dialog with given title and message
+//
 int errorMsg(QString title, QString msg)
 {
     QMessageBox dlg;
@@ -31,6 +34,9 @@
 }
 
 
+//
+// Convert QString to a double value, replacing comma
+//
 double moneyStrToValue(const QString &str)
 {
     QString str2 = str;
@@ -38,12 +44,18 @@
 }
 
 
+//
+// Convert double value to formatted QString
+//
 QString moneyValueToStr(double val)
 {
     return QStringLiteral("%1").arg(val, 1, 'f', 2);
 }
 
 
+//
+// Trim and cleanup given QString (removing double whitespace etc.)
+//
 QString cleanupStr(const QString &str)
 {
     return str.simplified().trimmed();
@@ -58,6 +70,11 @@
 }
 
 
+//
+// Check if an SQL error has occured (for given QSqlError) and
+// report it to stdout if so. Return "false" if error has occured,
+// true otherwise.
+//
 bool checkAndReportSQLError(const QString where, const QSqlError &err)
 {
     if (err.isValid())