Add printing-utils that also take string-lists

This commit is contained in:
Gerhard Hoffmann 2023-10-18 16:20:49 +02:00
parent a78040a037
commit 1d4f50fb9f
2 changed files with 22 additions and 3 deletions

View File

@ -52,9 +52,19 @@ void Utils::printCriticalErrorMsg(QString const &errorMsg) {
qCritical() << QString(80, 'E'); qCritical() << QString(80, 'E');
} }
void Utils::printUpdateStatusMsg(QString const &updateMsg) { void Utils::printCriticalErrorMsg(QStringList const &errorMsg) {
qCritical() << QString(80, 'E');
for (int i = 0; i < errorMsg.size(); ++i) {
qCritical() << errorMsg.at(i);
}
qCritical() << QString(80, 'E');
}
void Utils::printUpdateStatusMsg(QStringList const &updateMsg) {
qCritical() << QString(80, 'U'); qCritical() << QString(80, 'U');
qCritical() << updateMsg; for (int i = 0; i < updateMsg.size(); ++i) {
qCritical() << updateMsg.at(i);
}
qCritical() << QString(80, 'U'); qCritical() << QString(80, 'U');
} }
@ -62,7 +72,14 @@ void Utils::printInfoMsg(QString const &infoMsg) {
qCritical() << QString(80, 'I'); qCritical() << QString(80, 'I');
qCritical() << infoMsg; qCritical() << infoMsg;
qCritical() << QString(80, 'I'); qCritical() << QString(80, 'I');
}
void Utils::printInfoMsg(QStringList const &infoMsg) {
qCritical() << QString(80, 'I');
for (int i = 0; i < infoMsg.size(); ++i) {
qCritical() << infoMsg.at(i);
}
qCritical() << QString(80, 'I');
} }
void Utils::printLineEditInfo(QStringList const &lines) { void Utils::printLineEditInfo(QStringList const &lines) {

View File

@ -13,8 +13,10 @@ namespace Utils {
int read1stLineOfFile(QString fileName); int read1stLineOfFile(QString fileName);
QString zoneName(quint8 i); QString zoneName(quint8 i);
void printCriticalErrorMsg(QString const &errorMsg); void printCriticalErrorMsg(QString const &errorMsg);
void printCriticalErrorMsg(QStringList const &errorMsg);
void printInfoMsg(QString const &infoMsg); void printInfoMsg(QString const &infoMsg);
void printUpdateStatusMsg(QString const &updateMsg); void printInfoMsg(QStringList const &infoMsg);
void printUpdateStatusMsg(QStringList const &updateMsg);
void printLineEditInfo(QStringList const &lines); void printLineEditInfo(QStringList const &lines);
QString getTariffLoadTime(QString fileName); QString getTariffLoadTime(QString fileName);
QString rstrip(QString const &str); QString rstrip(QString const &str);