From 9fa3221abc0ef815414d460365412758405c242a Mon Sep 17 00:00:00 2001 From: Roland Rossgotterer Date: Thu, 2 Apr 2020 10:54:07 +0200 Subject: [PATCH] Replace deprecated endl with Qt::endl --- samples/blackmisc/main.cpp | 34 ++--- samples/blackmisc/samplesfile.cpp | 4 +- samples/blackmisc/samplesmetadata.cpp | 2 +- samples/blackmisc/samplesperformance.cpp | 136 +++++++++--------- samples/blackmiscdbus/main.cpp | 30 ++-- samples/blackmiscdbus/servicetool.cpp | 76 +++++----- .../blackmiscquantities/samplesaviation.cpp | 40 +++--- samples/blackmiscquantities/samplesgeo.cpp | 18 +-- .../samplesphysicalquantities.cpp | 40 +++--- samples/blackmiscsim/main.cpp | 28 ++-- samples/blackmiscsim/samplesfscommon.cpp | 16 +-- samples/blackmiscsim/samplesfsuipc.cpp | 10 +- samples/blackmiscsim/samplesfsx.cpp | 6 +- samples/blackmiscsim/samplesmodelmapping.cpp | 14 +- samples/blackmiscsim/samplesp3d.cpp | 6 +- samples/blackmiscsim/samplesvpilotrules.cpp | 4 +- samples/weatherdata/main.cpp | 6 +- samples/weatherdata/reader.cpp | 4 +- samples/weatherdata/weatherdataprinter.cpp | 4 +- src/blackcore/fsd/fsdclient.cpp | 2 +- src/blackmisc/dbusutils.cpp | 24 ++-- src/blackmisc/filelogger.cpp | 12 +- src/blackmisc/sampleutils.cpp | 2 +- .../xplane/xswiftbusconfigwriter.cpp | 32 ++--- src/blackmisc/test/testservice.cpp | 94 ++++++------ src/blackmisc/test/testserviceinterface.cpp | 46 +++--- src/blackmisc/test/testserviceinterface.h | 2 +- 27 files changed, 346 insertions(+), 346 deletions(-) diff --git a/samples/blackmisc/main.cpp b/samples/blackmisc/main.cpp index 76437389e..b7abf373d 100644 --- a/samples/blackmisc/main.cpp +++ b/samples/blackmisc/main.cpp @@ -42,23 +42,23 @@ int main(int argc, char *argv[]) do { - qtout << endl; - qtout << "1 .. JSON" << endl; - qtout << "2 .. Change object" << endl; - qtout << "3a .. Containers" << endl; - qtout << "3b .. Callsign QMap vs QHash" << endl; - qtout << "4 .. Metadata" << endl; - qtout << "6a .. Performance create / copy / ..." << endl; - qtout << "6b .. 40/20 Interpolator scenario" << endl; - qtout << "6c .. JSON performance" << endl; - qtout << "6d .. JSON model performance (database vs. own JSON)" << endl; - qtout << "6e .. string utils vs.regex" << endl; - qtout << "6f .. string concatenation (+=, arg, ..)" << endl; - qtout << "6g .. const &QString vs. QStringLiteral" << endl; - qtout << "7 .. Algorithms" << endl; - qtout << "8 .. File/Directory" << endl; - qtout << "-----" << endl; - qtout << "x .. Bye" << endl; + qtout << Qt::endl; + qtout << "1 .. JSON" << Qt::endl; + qtout << "2 .. Change object" << Qt::endl; + qtout << "3a .. Containers" << Qt::endl; + qtout << "3b .. Callsign QMap vs QHash" << Qt::endl; + qtout << "4 .. Metadata" << Qt::endl; + qtout << "6a .. Performance create / copy / ..." << Qt::endl; + qtout << "6b .. 40/20 Interpolator scenario" << Qt::endl; + qtout << "6c .. JSON performance" << Qt::endl; + qtout << "6d .. JSON model performance (database vs. own JSON)" << Qt::endl; + qtout << "6e .. string utils vs.regex" << Qt::endl; + qtout << "6f .. string concatenation (+=, arg, ..)" << Qt::endl; + qtout << "6g .. const &QString vs. QStringLiteral" << Qt::endl; + qtout << "7 .. Algorithms" << Qt::endl; + qtout << "8 .. File/Directory" << Qt::endl; + qtout << "-----" << Qt::endl; + qtout << "x .. Bye" << Qt::endl; const QString s = qtin.readLine().toLower().trimmed(); if (s.startsWith("1")) { CSamplesJson::samples(); } diff --git a/samples/blackmisc/samplesfile.cpp b/samples/blackmisc/samplesfile.cpp index 47cf693d5..95264a71b 100644 --- a/samples/blackmisc/samplesfile.cpp +++ b/samples/blackmisc/samplesfile.cpp @@ -20,9 +20,9 @@ namespace BlackSample int CSamplesFile::samples(QTextStream &out) { const QString dir = "R:/temp"; - out << "Testing directory search " << dir << endl; + out << "Testing directory search " << dir << Qt::endl; const bool f = CDirectoryUtils::containsFileInDir(dir, "*.air", true); - out << "Found " << boolToYesNo(f) << endl; + out << "Found " << boolToYesNo(f) << Qt::endl; return 0; } diff --git a/samples/blackmisc/samplesmetadata.cpp b/samples/blackmisc/samplesmetadata.cpp index 6a961d1f7..f9782d021 100644 --- a/samples/blackmisc/samplesmetadata.cpp +++ b/samples/blackmisc/samplesmetadata.cpp @@ -26,7 +26,7 @@ namespace BlackSample BlackMisc::displayAllUserMetatypesTypes(cout); cin.readLine(); - cout << "------- Enter --------" << endl; + cout << "------- Enter --------" << Qt::endl; return 0; } diff --git a/samples/blackmisc/samplesperformance.cpp b/samples/blackmisc/samplesperformance.cpp index b157a79ca..9e70c68ca 100644 --- a/samples/blackmisc/samplesperformance.cpp +++ b/samples/blackmisc/samplesperformance.cpp @@ -66,88 +66,88 @@ namespace BlackSample timer.start(); CAtcStationList atcs1 = CTesting::createAtcStations(10000); ms = timer.elapsed(); - out << "created (copy) " << atcs1.size() << " ATC stations in " << ms << "ms" << endl; + out << "created (copy) " << atcs1.size() << " ATC stations in " << ms << "ms" << Qt::endl; timer.start(); CAtcStationList atcs2 = CTesting::createAtcStations(100000); ms = timer.elapsed(); - out << "created (copy) " << atcs2.size() << " ATC stations in " << ms << "ms" << endl; + out << "created (copy) " << atcs2.size() << " ATC stations in " << ms << "ms" << Qt::endl; // ATC stations, property index created timer.start(); CAtcStationList atcs3 = CTesting::createAtcStations(10000, true); ms = timer.elapsed(); - out << "created (propertyIndex) " << atcs3.size() << " ATC stations in " << ms << "ms" << endl; + out << "created (propertyIndex) " << atcs3.size() << " ATC stations in " << ms << "ms" << Qt::endl; timer.start(); CAtcStationList atcs4 = CTesting::createAtcStations(100000, true); ms = timer.elapsed(); - out << "created (propertyIndex) " << atcs4.size() << " ATC stations in " << ms << "ms" << endl; + out << "created (propertyIndex) " << atcs4.size() << " ATC stations in " << ms << "ms" << Qt::endl; // Sort by timer.start(); atcs1.sortBy(&CAtcStation::getCallsign); ms = timer.elapsed(); - out << "Sorted by callsign " << atcs1.size() << " ATC stations in " << ms << "ms" << endl; + out << "Sorted by callsign " << atcs1.size() << " ATC stations in " << ms << "ms" << Qt::endl; timer.start(); atcs2.sortBy(&CAtcStation::getCallsign); ms = timer.elapsed(); - out << "Sorted by callsign " << atcs2.size() << " ATC stations in " << ms << "ms" << endl; + out << "Sorted by callsign " << atcs2.size() << " ATC stations in " << ms << "ms" << Qt::endl; // Read data, this is what all our models do when displaying in a table view timer.start(); CSamplesPerformance::accessStationsData(atcs1, false); ms = timer.elapsed(); - out << "Read (getters) " << atcs1.size() << " ATC stations in " << ms << "ms" << endl; + out << "Read (getters) " << atcs1.size() << " ATC stations in " << ms << "ms" << Qt::endl; timer.start(); CSamplesPerformance::accessStationsData(atcs2, false); ms = timer.elapsed(); - out << "Read (getters) " << atcs2.size() << " ATC stations in " << ms << "ms" << endl; + out << "Read (getters) " << atcs2.size() << " ATC stations in " << ms << "ms" << Qt::endl; timer.start(); CSamplesPerformance::accessStationsData(atcs1, true); ms = timer.elapsed(); - out << "Read (propertyIndex) " << atcs1.size() << " ATC stations in " << ms << "ms" << endl; + out << "Read (propertyIndex) " << atcs1.size() << " ATC stations in " << ms << "ms" << Qt::endl; timer.start(); CSamplesPerformance::accessStationsData(atcs2, true); ms = timer.elapsed(); - out << "Read (propertyIndex) " << atcs2.size() << " ATC stations in " << ms << "ms" << endl; + out << "Read (propertyIndex) " << atcs2.size() << " ATC stations in " << ms << "ms" << Qt::endl; // calculate number = 10000; timer.start(); CSamplesPerformance::calculateDistance(number); ms = timer.elapsed(); - out << "Calculated distances " << number << " in " << ms << "ms" << endl; + out << "Calculated distances " << number << " in " << ms << "ms" << Qt::endl; number = 100000; timer.start(); CSamplesPerformance::calculateDistance(number); ms = timer.elapsed(); - out << "Calculated distances " << number << "in " << ms << "ms" << endl; + out << "Calculated distances " << number << "in " << ms << "ms" << Qt::endl; // parse number = 100000; timer.start(); CSamplesPerformance::parseWgs(number); ms = timer.elapsed(); - out << "Parse WGS coordinates " << number << " in " << ms << "ms" << endl; + out << "Parse WGS coordinates " << number << " in " << ms << "ms" << Qt::endl; // copy timer.start(); number = 20; CSamplesPerformance::copy10kStations(number); ms = timer.elapsed(); - out << "Copied 10k stations " << number << " times in " << ms << "ms" << endl; + out << "Copied 10k stations " << number << " times in " << ms << "ms" << Qt::endl; timer.start(); number = 100; CSamplesPerformance::copy10kStations(number); ms = timer.elapsed(); - out << "Copied 10k stations " << number << " times in " << ms << "ms" << endl; + out << "Copied 10k stations " << number << " times in " << ms << "ms" << Qt::endl; // Regex pattern matching with lists of 10000 strings containing random hex numbers auto generator = []() { return QString::number(CMathUtils::randomGenerator().generate(), 16); }; @@ -164,24 +164,24 @@ namespace BlackSample timer.start(); for (const auto &str : as_const(strList1)) { if (newRegex.match(str).hasMatch()) number++; } ms = timer.elapsed(); - out << "new regex matched " << number << " of" << strList1.size() << " strings in " << ms << "ms" << endl; + out << "new regex matched " << number << " of" << strList1.size() << " strings in " << ms << "ms" << Qt::endl; number = 0; timer.start(); for (const auto &str : as_const(strList2)) { if (fullRegex.exactMatch(str)) number++; } ms = timer.elapsed(); - out << "full regex matched " << number << " of" << strList2.size() << " strings in " << ms << "ms" << endl; + out << "full regex matched " << number << " of" << strList2.size() << " strings in " << ms << "ms" << Qt::endl; number = 0; timer.start(); for (const auto &str : as_const(strList3)) { if (wildcardRegex.exactMatch(str)) number++; } ms = timer.elapsed(); - out << "wildcard matched " << number << " of " << strList3.size() << " strings in " << ms << "ms" << endl; + out << "wildcard matched " << number << " of " << strList3.size() << " strings in " << ms << "ms" << Qt::endl; number = 0; timer.start(); for (const auto &str : as_const(strList4)) { if (str.contains(containsStr)) number++; } ms = timer.elapsed(); - out << "contains matched " << number << " of " << strList4.size() << " strings in " << ms << "ms" << endl; + out << "contains matched " << number << " of " << strList4.size() << " strings in " << ms << "ms" << Qt::endl; - out << "-----------------------------------------------" << endl; + out << "-----------------------------------------------" << Qt::endl; return EXIT_SUCCESS; } @@ -202,7 +202,7 @@ namespace BlackSample situationsBefore = situations.findBefore(halfTime).findByCallsign(callsign); situationsAfter = situations.findAfter(halfTime - 1).findByCallsign(callsign); } - out << "Reads by time, callsigns: " << timer.elapsed() << "ms" << endl; + out << "Reads by time, callsigns: " << timer.elapsed() << "ms" << Qt::endl; timer.start(); situationsBefore = situations.findBefore(halfTime); @@ -215,7 +215,7 @@ namespace BlackSample Q_UNUSED(csSituationsBefore); Q_UNUSED(csSituationsAfter); } - out << "Split by time upfront, then callsigns: " << timer.elapsed() << "ms" << endl; + out << "Split by time upfront, then callsigns: " << timer.elapsed() << "ms" << Qt::endl; int b = situationsBefore.size(); int a = situationsAfter.size(); Q_ASSERT(a + b == numberOfTimes * numberOfCallsigns); @@ -224,7 +224,7 @@ namespace BlackSample timer.start(); const QHash csSituations = situations.splitPerCallsign(); - out << "Split by " << csSituations.size() << " callsigns, " << timer.elapsed() << "ms" << endl; + out << "Split by " << csSituations.size() << " callsigns, " << timer.elapsed() << "ms" << Qt::endl; timer.start(); for (const CAircraftSituationList &csl : csSituations) @@ -237,9 +237,9 @@ namespace BlackSample Q_UNUSED(csSituationsBefore); Q_UNUSED(csSituationsAfter); } - out << "Split by callsign, by time: " << timer.elapsed() << "ms" << endl; + out << "Split by callsign, by time: " << timer.elapsed() << "ms" << Qt::endl; - out << endl; + out << Qt::endl; return EXIT_SUCCESS; } @@ -251,27 +251,27 @@ namespace BlackSample timer.start(); QJsonObject json = situations.toJson(); - out << "Convert 100,000 aircraft situations to JSON: " << timer.elapsed() << "ms" << endl; + out << "Convert 100,000 aircraft situations to JSON: " << timer.elapsed() << "ms" << Qt::endl; timer.start(); situations.convertFromJson(json); - out << "Convert 100,000 aircraft situations from JSON: " << timer.elapsed() << "ms" << endl << endl; + out << "Convert 100,000 aircraft situations from JSON: " << timer.elapsed() << "ms" << endl << Qt::endl; timer.start(); json = models.toJson(); - out << "Convert 10,000 aircraft models to JSON (naive): " << timer.elapsed() << "ms" << endl; + out << "Convert 10,000 aircraft models to JSON (naive): " << timer.elapsed() << "ms" << Qt::endl; timer.start(); models.convertFromJson(json); - out << "Convert 10,000 aircraft models from JSON (naive): " << timer.elapsed() << "ms" << endl << endl; + out << "Convert 10,000 aircraft models from JSON (naive): " << timer.elapsed() << "ms" << endl << Qt::endl; timer.start(); json = models.toMemoizedJson(); - out << "Convert 10,000 aircraft models to JSON (memoize): " << timer.elapsed() << "ms" << endl; + out << "Convert 10,000 aircraft models to JSON (memoize): " << timer.elapsed() << "ms" << Qt::endl; timer.start(); models.convertFromMemoizedJson(json); - out << "Convert 10,000 aircraft models from JSON (memoize): " << timer.elapsed() << "ms" << endl << endl; + out << "Convert 10,000 aircraft models from JSON (memoize): " << timer.elapsed() << "ms" << endl << Qt::endl; return EXIT_SUCCESS; } @@ -287,11 +287,11 @@ namespace BlackSample QFile liveryFile(liveriesFileName); Q_ASSERT_X(liveryFile.exists(), Q_FUNC_INFO, "Liveries file does not exist"); - out << "Loaded DB JSON model file " << modelFile.fileName() << endl; + out << "Loaded DB JSON model file " << modelFile.fileName() << Qt::endl; const QString modelData = CFileUtils::readFileToString(modelFile.fileName()); Q_ASSERT_X(!modelData.isEmpty(), Q_FUNC_INFO, "Model file empty"); - out << "Loaded DB JSON livery file " << liveryFile.fileName() << endl; + out << "Loaded DB JSON livery file " << liveryFile.fileName() << Qt::endl; const QString liveryData = CFileUtils::readFileToString(liveryFile.fileName()); Q_ASSERT_X(!liveryData.isEmpty(), Q_FUNC_INFO, "Livery file empty"); @@ -303,41 +303,41 @@ namespace BlackSample timer.start(); const CLiveryList dbLiveries = CLiveryList::fromDatabaseJson(response); int ms = timer.elapsed(); - out << "Read via DB JSON format: " << dbLiveries.size() << " liveries in " << ms << "ms" << endl; + out << "Read via DB JSON format: " << dbLiveries.size() << " liveries in " << ms << "ms" << Qt::endl; // does not result in better performance, liveries/airlines have almost a 1:1 ratio // unlike models' fromDatabaseJsonCaching not many airlines will be recycled timer.start(); const CLiveryList dbLiveries2 = CLiveryList::fromDatabaseJsonCaching(response); ms = timer.elapsed(); - out << "Read via DB JSON format (new): " << dbLiveries2.size() << " liveries in " << ms << "ms" << endl; + out << "Read via DB JSON format (new): " << dbLiveries2.size() << " liveries in " << ms << "ms" << Qt::endl; const CAirlineIcaoCodeList liveryAirlines = dbLiveries2.getAirlines(); timer.start(); const CLiveryList dbLiveries3 = CLiveryList::fromDatabaseJsonCaching(response, liveryAirlines); ms = timer.elapsed(); - out << "Read via DB JSON format (new, passing airlines): " << dbLiveries3.size() << " liveries in " << ms << "ms" << endl; + out << "Read via DB JSON format (new, passing airlines): " << dbLiveries3.size() << " liveries in " << ms << "ms" << Qt::endl; CDatabaseReader::stringToDatastoreResponse(modelData, response); timer.start(); const CAircraftModelList dbModels = CAircraftModelList::fromDatabaseJson(response); ms = timer.elapsed(); - out << "Read via DB JSON format: " << dbModels.size() << " models in " << ms << "ms" << endl; + out << "Read via DB JSON format: " << dbModels.size() << " models in " << ms << "ms" << Qt::endl; timer.start(); const CAircraftModelList dbModels2 = CAircraftModelList::fromDatabaseJsonCaching(response); ms = timer.elapsed(); - out << "Read via DB JSON format (new): " << dbModels2.size() << " models in " << ms << "ms" << endl; + out << "Read via DB JSON format (new): " << dbModels2.size() << " models in " << ms << "ms" << Qt::endl; // swift JSON format const QJsonObject swiftJsonObject = dbModels.toJson(); - out << "Converted to swift JSON" << endl; + out << "Converted to swift JSON" << Qt::endl; CAircraftModelList swiftModels; timer.start(); swiftModels.convertFromJson(swiftJsonObject); ms = timer.elapsed(); - out << "Read via swift JSON format: " << swiftModels.size() << " models in " << ms << "ms" << endl; + out << "Read via swift JSON format: " << swiftModels.size() << " models in " << ms << "ms" << Qt::endl; Q_ASSERT_X(swiftModels.size() == dbModels.size(), Q_FUNC_INFO, "Mismatching container size"); return EXIT_SUCCESS; @@ -365,7 +365,7 @@ namespace BlackSample auto c = containsChar(s, [](QChar c) { return c.isUpper(); }); Q_UNUSED(c); } - out << "Check 100,000 strings for containing uppercase letter: (utility) " << timer.elapsed() << "ms" << endl; + out << "Check 100,000 strings for containing uppercase letter: (utility) " << timer.elapsed() << "ms" << Qt::endl; timer.start(); for (const QString &s : as_const(strings)) @@ -373,7 +373,7 @@ namespace BlackSample auto c = s.contains(upperRegex); Q_UNUSED(c); } - out << "Check 100,000 strings for containing uppercase letter: (regex) " << timer.elapsed() << "ms" << endl << endl; + out << "Check 100,000 strings for containing uppercase letter: (regex) " << timer.elapsed() << "ms" << endl << Qt::endl; timer.start(); for (const QString &s : as_const(strings)) @@ -381,7 +381,7 @@ namespace BlackSample auto i = indexOfChar(s, [](QChar c) { return c.isUpper(); }); Q_UNUSED(i); } - out << "Check 100,000 strings for index of first uppercase letter: (utility) " << timer.elapsed() << "ms" << endl; + out << "Check 100,000 strings for index of first uppercase letter: (utility) " << timer.elapsed() << "ms" << Qt::endl; timer.start(); for (const QString &s : as_const(strings)) @@ -389,7 +389,7 @@ namespace BlackSample auto i = s.indexOf(upperRegex); Q_UNUSED(i); } - out << "Check 100,000 strings for index of first uppercase letter: (regex) " << timer.elapsed() << "ms" << endl << endl; + out << "Check 100,000 strings for index of first uppercase letter: (regex) " << timer.elapsed() << "ms" << endl << Qt::endl; auto temp = strings; timer.start(); @@ -397,7 +397,7 @@ namespace BlackSample { removeChars(s, [](QChar c) { return c.isUpper(); }); } - out << "Remove from 100,000 strings all uppercase letters: (utility) " << timer.elapsed() << "ms" << endl; + out << "Remove from 100,000 strings all uppercase letters: (utility) " << timer.elapsed() << "ms" << Qt::endl; strings = temp; timer.start(); @@ -405,21 +405,21 @@ namespace BlackSample { s.remove(upperRegex); } - out << "Remove from 100,000 strings all uppercase letters: (regex) " << timer.elapsed() << "ms" << endl << endl; + out << "Remove from 100,000 strings all uppercase letters: (regex) " << timer.elapsed() << "ms" << endl << Qt::endl; timer.start(); { auto lines = splitLines(bigString); Q_UNUSED(lines); } - out << "Split 100,000 line string into list of lines: (QStringList) " << timer.elapsed() << "ms" << endl; + out << "Split 100,000 line string into list of lines: (QStringList) " << timer.elapsed() << "ms" << Qt::endl; timer.start(); { auto lines = splitLinesRefs(bigString); Q_UNUSED(lines); } - out << "Split 100,000 line string into list of lines: (QList) " << timer.elapsed() << "ms" << endl; + out << "Split 100,000 line string into list of lines: (QList) " << timer.elapsed() << "ms" << Qt::endl; return EXIT_SUCCESS; } @@ -444,7 +444,7 @@ namespace BlackSample { x += "12-1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; } - out << "+= String " << time.elapsed() << "ms" << endl; + out << "+= String " << time.elapsed() << "ms" << Qt::endl; x.clear(); time.start(); @@ -452,7 +452,7 @@ namespace BlackSample { x += QLatin1String("12-1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); } - out << "+= QLatin1String " << time.elapsed() << "ms" << endl; + out << "+= QLatin1String " << time.elapsed() << "ms" << Qt::endl; x.clear(); time.start(); @@ -460,7 +460,7 @@ namespace BlackSample { x += QStringLiteral("12-1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); } - out << "+= QStringLiteral " << time.elapsed() << "ms" << endl; + out << "+= QStringLiteral " << time.elapsed() << "ms" << Qt::endl; x.clear(); time.start(); @@ -468,7 +468,7 @@ namespace BlackSample { x = x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9; } - out << "+ String multiple " << time.elapsed() << "ms" << endl; + out << "+ String multiple " << time.elapsed() << "ms" << Qt::endl; x.clear(); time.start(); @@ -476,7 +476,7 @@ namespace BlackSample { x = x1 % x2 % x3 % x4 % x5 % x6 % x7 % x8 % x9; } - out << "% String multiple " << time.elapsed() << "ms" << endl; + out << "% String multiple " << time.elapsed() << "ms" << Qt::endl; x.clear(); time.start(); @@ -484,7 +484,7 @@ namespace BlackSample { x = x.append(x1).append(x2).append(x3).append(x4).append(x5).append(x6).append(x7).append(x8).append(x9); } - out << "append String multiple " << time.elapsed() << "ms" << endl; + out << "append String multiple " << time.elapsed() << "ms" << Qt::endl; x.clear(); static const QString xArgString("%1 %2 %3 %4 %5 %6 %7 %8 %9"); @@ -493,7 +493,7 @@ namespace BlackSample { x = xArgString.arg(x1, x2, x3, x4, x5, x6, x7, x8, x9); } - out << "arg String multiple " << time.elapsed() << "ms" << endl; + out << "arg String multiple " << time.elapsed() << "ms" << Qt::endl; x.clear(); time.start(); @@ -501,7 +501,7 @@ namespace BlackSample { x = QStringLiteral("%1 %2 %3 %4 %5 %6 %7 %8 %9").arg(x1, x2, x3, x4, x5, x6, x7, x8, x9); } - out << "arg QStringLiteral multiple " << time.elapsed() << "ms" << endl; + out << "arg QStringLiteral multiple " << time.elapsed() << "ms" << Qt::endl; x.clear(); return EXIT_SUCCESS; @@ -517,7 +517,7 @@ namespace BlackSample { x = fooString(); } - out << "by constQString " << time.elapsed() << "ms" << endl; + out << "by constQString " << time.elapsed() << "ms" << Qt::endl; x.clear(); time.start(); @@ -525,7 +525,7 @@ namespace BlackSample { x = fooStringLiteral(); } - out << "by QStringLiteral " << time.elapsed() << "ms" << endl; + out << "by QStringLiteral " << time.elapsed() << "ms" << Qt::endl; x.clear(); time.start(); @@ -533,7 +533,7 @@ namespace BlackSample { x = QString("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi."); } - out << "by QString(\"...\") " << time.elapsed() << "ms" << endl; + out << "by QString(\"...\") " << time.elapsed() << "ms" << Qt::endl; x.clear(); time.start(); @@ -541,7 +541,7 @@ namespace BlackSample { x = QStringLiteral("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi."); } - out << "by QStringLiteral(\"...\") " << time.elapsed() << "ms" << endl; + out << "by QStringLiteral(\"...\") " << time.elapsed() << "ms" << Qt::endl; x.clear(); time.start(); @@ -550,7 +550,7 @@ namespace BlackSample QStringList foo = generateList(); Q_UNUSED(foo.size()); } - out << "generated list " << time.elapsed() << "ms" << endl; + out << "generated list " << time.elapsed() << "ms" << Qt::endl; time.start(); for (int i = 0; i < loop; i++) @@ -558,7 +558,7 @@ namespace BlackSample QStringList foo = replacedList(); Q_UNUSED(foo.size()); } - out << "replaced list " << time.elapsed() << "ms" << endl; + out << "replaced list " << time.elapsed() << "ms" << Qt::endl; return EXIT_SUCCESS; } @@ -607,7 +607,7 @@ namespace BlackSample Q_ASSERT_X(s.getCallsign() == cs, Q_FUNC_INFO, "Wromg callsign"); } } - out << "map 100 out of 10: " << time.elapsed() << "ms" << endl; + out << "map 100 out of 10: " << time.elapsed() << "ms" << Qt::endl; time.start(); for (int i = 1; i < 10000; ++i) @@ -618,7 +618,7 @@ namespace BlackSample Q_ASSERT_X(s.getCallsign() == cs, Q_FUNC_INFO, "Wromg callsign"); } } - out << "hash 100 out of 10: " << time.elapsed() << "ms" << endl; + out << "hash 100 out of 10: " << time.elapsed() << "ms" << Qt::endl; time.start(); for (int i = 1; i < 10000; ++i) @@ -629,7 +629,7 @@ namespace BlackSample Q_ASSERT_X(s.getCallsign() == cs, Q_FUNC_INFO, "Wromg callsign"); } } - out << "map 100 out of 25: " << time.elapsed() << "ms" << endl; + out << "map 100 out of 25: " << time.elapsed() << "ms" << Qt::endl; time.start(); for (int i = 1; i < 10000; ++i) @@ -640,7 +640,7 @@ namespace BlackSample Q_ASSERT_X(s.getCallsign() == cs, Q_FUNC_INFO, "Wromg callsign"); } } - out << "hash 100 out of 25: " << time.elapsed() << "ms" << endl; + out << "hash 100 out of 25: " << time.elapsed() << "ms" << Qt::endl; time.start(); for (int i = 1; i < 10000; ++i) @@ -651,7 +651,7 @@ namespace BlackSample Q_ASSERT_X(s.getCallsign() == cs, Q_FUNC_INFO, "Wromg callsign"); } } - out << "map 100 out of 50: " << time.elapsed() << "ms" << endl; + out << "map 100 out of 50: " << time.elapsed() << "ms" << Qt::endl; time.start(); for (int i = 1; i < 10000; ++i) @@ -662,7 +662,7 @@ namespace BlackSample Q_ASSERT_X(s.getCallsign() == cs, Q_FUNC_INFO, "Wromg callsign"); } } - out << "hash 100 out of 50: " << time.elapsed() << "ms" << endl; + out << "hash 100 out of 50: " << time.elapsed() << "ms" << Qt::endl; return EXIT_SUCCESS; } diff --git a/samples/blackmiscdbus/main.cpp b/samples/blackmiscdbus/main.cpp index ccafd391f..c01e817a0 100644 --- a/samples/blackmiscdbus/main.cpp +++ b/samples/blackmiscdbus/main.cpp @@ -81,7 +81,7 @@ int main(int argc, char *argv[]) { // 2nd Process !!! Running on the client's side // This runs in a second process, hence cannot be directly debugged within Qt Creator - out << "Running client side " << QCoreApplication::applicationPid() << endl; + out << "Running client side " << QCoreApplication::applicationPid() << Qt::endl; // run tests if (cmdlineArgs.contains("testservice", Qt::CaseInsensitive)) @@ -95,16 +95,16 @@ int main(int argc, char *argv[]) else { Menu: - out << "Pid: " << QCoreApplication::applicationPid() << endl; - out << "1 .. Run testservice to test data transfer" << addressTcp << endl; - out << "1sb. Run testservice via session bus" << endl; - out << "2 .. Show signatures" << endl; - out << "----- Change address / port (no validation, do before starting server)" << endl; - out << "loop Address to loopback, 127.0.0.1" << endl; - out << "ip some IP address, e.g " << ip << endl; - out << "port some port, e.g 12345" << endl; - out << "-----" << endl; - out << "x .. Bye" << endl; + out << "Pid: " << QCoreApplication::applicationPid() << Qt::endl; + out << "1 .. Run testservice to test data transfer" << addressTcp << Qt::endl; + out << "1sb. Run testservice via session bus" << Qt::endl; + out << "2 .. Show signatures" << Qt::endl; + out << "----- Change address / port (no validation, do before starting server)" << Qt::endl; + out << "loop Address to loopback, 127.0.0.1" << Qt::endl; + out << "ip some IP address, e.g " << ip << Qt::endl; + out << "port some port, e.g 12345" << Qt::endl; + out << "-----" << Qt::endl; + out << "x .. Bye" << Qt::endl; QString mode = qtin.readLine().toLower().trimmed(); if (mode.startsWith("l")) @@ -135,9 +135,9 @@ int main(int argc, char *argv[]) } if (mode.startsWith("2")) { - out << "---------------------------------" << endl; + out << "---------------------------------" << Qt::endl; BlackMisc::CDBusUtils::showDBusSignatures(out); - out << "---------------------------------" << endl; + out << "---------------------------------" << Qt::endl; goto Menu; } @@ -155,13 +155,13 @@ int main(int argc, char *argv[]) // I know I am in the "server process here", so I can safely create a CDBusServer // this runs in the original process and can be directly debugged - out << "--------------------------------------------------------" << endl; + out << "--------------------------------------------------------" << Qt::endl; CDBusServer *dBusServer = new CDBusServer(useSessionBusForServer ? "session" : address); if (dBusServer->hasQDBusServer()) { out << "server" << dBusServer->qDBusServer()->address() - << " connected:" << dBusServer->qDBusServer()->isConnected() << endl; + << " connected:" << dBusServer->qDBusServer()->isConnected() << Qt::endl; } // start client process QStringList args; diff --git a/samples/blackmiscdbus/servicetool.cpp b/samples/blackmiscdbus/servicetool.cpp index 85040e79d..791bf2e80 100644 --- a/samples/blackmiscdbus/servicetool.cpp +++ b/samples/blackmiscdbus/servicetool.cpp @@ -105,31 +105,31 @@ namespace BlackSample // We send this as a non-replying message. This is used for sending errors, replys, signals. // Values can be seen on the receiver side - qtout << "----------------- receiver tests ----------------" << endl; + qtout << "----------------- receiver tests ----------------" << Qt::endl; // Low level test - if (connection.send(m)) { qtout << "Send via low level method " << endl; } + if (connection.send(m)) { qtout << "Send via low level method " << Qt::endl; } // same as interface message // but call the slot testServiceInterface.receiveStringMessage(msg); - qtout << "Send string via interface " << msg << endl; + qtout << "Send string via interface " << msg << Qt::endl; // a list testServiceInterface.receiveList(list); - qtout << "Send list via interface " << list.size() << endl; + qtout << "Send list via interface " << list.size() << Qt::endl; // PQs CSpeed speed(200, CSpeedUnit::km_h()); const CSpeed speedNull(0, nullptr); testServiceInterface.receiveSpeed(speed); - qtout << "Send speed via interface " << speed << endl; + qtout << "Send speed via interface " << speed << Qt::endl; testServiceInterface.receiveSpeed(speedNull); - qtout << "Send null speed via interface " << speedNull << endl; + qtout << "Send null speed via interface " << speedNull << Qt::endl; speed.switchUnit(CSpeedUnit::kts()); testServiceInterface.receiveSpeed(speed); - qtout << "Send speed via interface " << speed << endl; + qtout << "Send speed via interface " << speed << Qt::endl; speed.switchUnit(CSpeedUnit::km_h()); speed.addValueSameUnit(1.0); @@ -138,68 +138,68 @@ namespace BlackSample QVariant tsqv = QVariant::fromValue(trafficServer); QDBusVariant tsv(tsqv); testServiceInterface.receiveVariant(tsv, tsqv.userType()); - qtout << "Send server via interface and variant '" << trafficServer << QLatin1String("' ") << tsqv.userType() << endl; + qtout << "Send server via interface and variant '" << trafficServer << QLatin1String("' ") << tsqv.userType() << Qt::endl; // Aviation const CComSystem comSystem = CComSystem("DBUS COM1", CPhysicalQuantitiesConstants::FrequencyInternationalAirDistress(), CPhysicalQuantitiesConstants::FrequencyUnicom()); testServiceInterface.receiveComUnit(comSystem); - qtout << "Send COM via interface " << comSystem << endl; + qtout << "Send COM via interface " << comSystem << Qt::endl; CAltitude altitude(1000, CAltitude::MeanSeaLevel, CLengthUnit::ft()); QVariant qvAl = QVariant::fromValue(altitude); QDBusVariant qv(qvAl); testServiceInterface.receiveVariant(qv, qvAl.userType()); testServiceInterface.receiveAltitude(altitude); - qtout << "Send altitude via interface and variant " << altitude << qvAl.userType() << endl; + qtout << "Send altitude via interface and variant " << altitude << qvAl.userType() << Qt::endl; altitude.addValueSameUnit(1); const CTransponder transponder(7000, CTransponder::ModeC); testServiceInterface.receiveTransponder(transponder); - qtout << "Send transponder via interface " << transponder << endl; + qtout << "Send transponder via interface " << transponder << Qt::endl; const CTrack track(123.45, CTrack::Magnetic, CAngleUnit::deg()); testServiceInterface.receiveTrack(track); - qtout << "Send track via interface " << track << endl; + qtout << "Send track via interface " << track << Qt::endl; const CLength len(33, CLengthUnit::m()); testServiceInterface.receiveLength(len); - qtout << "Send length via interface " << len << endl; + qtout << "Send length via interface " << len << Qt::endl; const CAltitude alt(44, CAltitude::MeanSeaLevel, CLengthUnit::m()); testServiceInterface.receiveLength(alt); - qtout << "Send altitude via interface " << alt << endl; + qtout << "Send altitude via interface " << alt << Qt::endl; const CCallsign callsign = CTestData::getRandomPilotCallsign(); testServiceInterface.receiveCallsign(callsign); - qtout << "Send callsign via interface " << callsign << endl; + qtout << "Send callsign via interface " << callsign << Qt::endl; const CAtcStation station = CTestData::getMunichTower(); testServiceInterface.receiveAtcStation(station); - qtout << "Send ATC " << station << endl; + qtout << "Send ATC " << station << Qt::endl; // Geo const CCoordinateGeodetic geoPos = CTestData::getCoordinateFrankfurtTower(); testServiceInterface.receiveGeoPosition(geoPos); - qtout << "Send geo position " << geoPos << endl; + qtout << "Send geo position " << geoPos << Qt::endl; CApplication::processEventsFor(1000); - qtout << "----------------- variant tests ----------------" << endl; + qtout << "----------------- variant tests ----------------" << Qt::endl; const CVariantList cvList = CTestData::getCVariantList(); testServiceInterface.receiveVariantList(cvList); - qtout << "Send " << cvList.size() << " variants via interface as CVariantList" << endl; + qtout << "Send " << cvList.size() << " variants via interface as CVariantList" << Qt::endl; const CPropertyIndexVariantMap valueMap = CTestData::getCPropertyIndexVariantMap(); testServiceInterface.receiveValueMap(valueMap); - qtout << "Send " << valueMap.size() << " index variant map entries" << endl; + qtout << "Send " << valueMap.size() << " index variant map entries" << Qt::endl; CApplication::processEventsFor(1000); - qtout << "----------------- pings ----------------" << endl; + qtout << "----------------- pings ----------------" << Qt::endl; const int errors = ITestServiceInterface::pingTests(testServiceInterface, false); - qtout << "Ping errors " << errors << endl; + qtout << "Ping errors " << errors << Qt::endl; CApplication::processEventsFor(1000); // Performance tools - qtout << "----------------- performance ----------------" << endl; + qtout << "----------------- performance ----------------" << Qt::endl; QElapsedTimer timer; timer.start(); @@ -226,7 +226,7 @@ namespace BlackSample } qint64 t1000 = timer.elapsed(); // ms timer.invalidate(); - qtout << "Reading speed objects 10/100/1000 in ms: " << t10 << " " << t100 << " " << t1000 << endl; + qtout << "Reading speed objects 10/100/1000 in ms: " << t10 << " " << t100 << " " << t1000 << Qt::endl; timer.start(); for (int i = 0; i < 10; i++) @@ -249,52 +249,52 @@ namespace BlackSample Q_UNUSED(stationDummy); } t1000 = timer.elapsed(); // ms - qtout << "Reading station objects 10/100/1000 in ms: " << t10 << " " << t100 << " " << t1000 << endl; + qtout << "Reading station objects 10/100/1000 in ms: " << t10 << " " << t100 << " " << t1000 << Qt::endl; timer.restart(); CAtcStationList atcStationList = testServiceInterface.getAtcStationList(10); - if (atcStationList.size() != 10) qtout << "wrong list size" << atcStationList.size() << endl; + if (atcStationList.size() != 10) qtout << "wrong list size" << atcStationList.size() << Qt::endl; t10 = timer.elapsed(); // ms timer.restart(); atcStationList = testServiceInterface.getAtcStationList(100); - if (atcStationList.size() != 100) qtout << "wrong list size" << atcStationList.size() << endl; + if (atcStationList.size() != 100) qtout << "wrong list size" << atcStationList.size() << Qt::endl; t100 = timer.elapsed(); // ms timer.restart(); atcStationList = testServiceInterface.getAtcStationList(1000); - if (atcStationList.size() != 1000) qtout << "wrong list size" << atcStationList.size() << endl; + if (atcStationList.size() != 1000) qtout << "wrong list size" << atcStationList.size() << Qt::endl; t1000 = timer.elapsed(); // ms - qtout << "Reading station list 10/100/1000 in ms: " << t10 << " " << t100 << " " << t1000 << endl; + qtout << "Reading station list 10/100/1000 in ms: " << t10 << " " << t100 << " " << t1000 << Qt::endl; // test reading model entries with a realistic size timer.restart(); CAircraftCfgEntriesList entriesList = testServiceInterface.getAircraftCfgEntriesList(5000); - if (entriesList.size() != 5000) qtout << "wrong list size" << entriesList.size() << endl; + if (entriesList.size() != 5000) qtout << "wrong list size" << entriesList.size() << Qt::endl; qint64 t5000 = timer.elapsed(); // ms - qtout << "Reading aircraft cfg entries in ms: " << t5000 << endl; + qtout << "Reading aircraft cfg entries in ms: " << t5000 << Qt::endl; // object paths timer.restart(); QList objectPaths = testServiceInterface.getObjectPaths(10); - if (objectPaths.size() != 10) qtout << "wrong list size" << objectPaths.size() << endl; + if (objectPaths.size() != 10) qtout << "wrong list size" << objectPaths.size() << Qt::endl; t10 = timer.elapsed(); // ms timer.restart(); objectPaths = testServiceInterface.getObjectPaths(100); - if (objectPaths.size() != 100) qtout << "wrong list size" << objectPaths.size() << endl; + if (objectPaths.size() != 100) qtout << "wrong list size" << objectPaths.size() << Qt::endl; t100 = timer.elapsed(); // ms timer.restart(); objectPaths = testServiceInterface.getObjectPaths(1000); - if (objectPaths.size() != 1000) qtout << "wrong list size" << objectPaths.size() << endl; + if (objectPaths.size() != 1000) qtout << "wrong list size" << objectPaths.size() << Qt::endl; t1000 = timer.elapsed(); // ms - qtout << "Reading paths list 10/100/1000 in ms: " << t10 << " " << t100 << " " << t1000 << endl; + qtout << "Reading paths list 10/100/1000 in ms: " << t10 << " " << t100 << " " << t1000 << Qt::endl; timer.invalidate(); // next round? - qtout << "---------------------------------------" << endl; - qtout << "Key ....... x to exit" << endl; + qtout << "---------------------------------------" << Qt::endl; + qtout << "Key ....... x to exit" << Qt::endl; QString line = qtin.readLine().toLower().trimmed(); if (line.startsWith('x')) { - qtout << "Ending!" << endl; + qtout << "Ending!" << Qt::endl; break; } } diff --git a/samples/blackmiscquantities/samplesaviation.cpp b/samples/blackmiscquantities/samplesaviation.cpp index de04f4990..b9979b3c3 100644 --- a/samples/blackmiscquantities/samplesaviation.cpp +++ b/samples/blackmiscquantities/samplesaviation.cpp @@ -47,68 +47,68 @@ namespace BlackSample CHeading h1(180, CHeading::Magnetic, CAngleUnit::deg()); CHeading h2(180, CHeading::True, CAngleUnit::deg()); - out << h1 << endl; - out << h1 << " " << h2 << " " << (h1 == h2) << " " << (h1 != h2) << " " << (h1 == h1) << endl; + out << h1 << Qt::endl; + out << h1 << " " << h2 << " " << (h1 == h2) << " " << (h1 != h2) << " " << (h1 == h1) << Qt::endl; // COM system CComSystem c1 = CComSystem::getCom1System(125.3); - out << c1 << endl; + out << c1 << Qt::endl; c1.setActiveUnicom(); - out << c1 << endl; + out << c1 << Qt::endl; // NAV system CNavSystem nav1 = CNavSystem::getNav1System(110.0); - out << nav1 << endl; + out << nav1 << Qt::endl; // Transponder tests CTransponder tr1(7000, CTransponder::StateStandby); CTransponder tr2("4532", CTransponder::ModeMil3); - out << tr1 << " " << tr2 << endl; + out << tr1 << " " << tr2 << Qt::endl; // Callsign and ATC station CCallsign callsign1("d-ambz"); CCallsign callsign2("DAmbz"); - out << callsign1 << " " << callsign2 << " " << (callsign1 == callsign2) << endl; + out << callsign1 << " " << callsign2 << " " << (callsign1 == callsign2) << Qt::endl; CAtcStation station1 = CTestData::getFrankfurtTower(); CAtcStation station2(station1); CAtcStation station3(station1); station3.setController(CTestData::getRandomController()); - out << station1 << " " << station2 << " " << (station1.getCallsign() == station2.getCallsign()) << endl; + out << station1 << " " << station2 << " " << (station1.getCallsign() == station2.getCallsign()) << Qt::endl; // User parsing CUser user("12345", "Joe KING KGLC"); - out << user.getRealName() << user.getHomeBase() << endl; + out << user.getRealName() << user.getHomeBase() << Qt::endl; // ATC List CAtcStationList atcList = CTestData::getAtcStations(); atcList.push_back(CTestData::getAtcStations()); atcList = atcList.findBy(&CAtcStation::getCallsign, "eddm_twr", &CAtcStation::getFrequency, CFrequency(118.7, CFrequencyUnit::MHz())); atcList = atcList.sortedBy(&CAtcStation::getBookedFromUtc, &CAtcStation::getCallsign, &CAtcStation::getControllerRealName); - out << atcList << endl; - out << "-----------------------------------------------" << endl; + out << atcList << Qt::endl; + out << "-----------------------------------------------" << Qt::endl; // flight plan CAltitude alt("FL110"); CAltitude altMsl(alt); altMsl.toMeanSeaLevel(); - out << alt << " " << altMsl << endl; + out << alt << " " << altMsl << Qt::endl; CAirportIcaoCode frankfurt("eddf"); - out << frankfurt << endl; - out << "-----------------------------------------------" << endl; + out << frankfurt << Qt::endl; + out << "-----------------------------------------------" << Qt::endl; CMetaMemberComparator cmp; QList> list = cmp(station1, station3); - for (const auto &member : as_const(list)) { out << member.first << (member.second ? " equal" : " NOT equal") << endl; } - out << endl; + for (const auto &member : as_const(list)) { out << member.first << (member.second ? " equal" : " NOT equal") << Qt::endl; } + out << Qt::endl; list = cmp(station1, station3, { "controller" }); - for (const auto &member : as_const(list)) { out << member.first << (member.second ? " equal" : " NOT equal") << endl; } - out << endl; + for (const auto &member : as_const(list)) { out << member.first << (member.second ? " equal" : " NOT equal") << Qt::endl; } + out << Qt::endl; list = cmp(station1, station3, { "controller", "homebase" }); - for (const auto &member : as_const(list)) { out << member.first << (member.second ? " equal" : " NOT equal") << endl; } - out << "-----------------------------------------------" << endl; + for (const auto &member : as_const(list)) { out << member.first << (member.second ? " equal" : " NOT equal") << Qt::endl; } + out << "-----------------------------------------------" << Qt::endl; return 0; } diff --git a/samples/blackmiscquantities/samplesgeo.cpp b/samples/blackmiscquantities/samplesgeo.cpp index 6385da2e2..8680d333f 100644 --- a/samples/blackmiscquantities/samplesgeo.cpp +++ b/samples/blackmiscquantities/samplesgeo.cpp @@ -45,40 +45,40 @@ namespace BlackSample CLatitude deltaLat = geo.latitude() - lat; CLongitude deltaLng = geo.longitude() - lng; - out << latStr << " " << lngStr << endl; + out << latStr << " " << lngStr << Qt::endl; out << lat.value(CAngleUnit::deg()) << " " << lat.value(CAngleUnit::sexagesimalDeg()) << " " << - lng.value(CAngleUnit::deg()) << " " << lng.value(CAngleUnit::sexagesimalDeg()) << endl; + lng.value(CAngleUnit::deg()) << " " << lng.value(CAngleUnit::sexagesimalDeg()) << Qt::endl; out << geo.latitude().value(CAngleUnit::deg()) << " " << geo.latitude().value(CAngleUnit::sexagesimalDeg()) << " " << - geo.longitude().value(CAngleUnit::deg()) << " " << geo.longitude().value(CAngleUnit::sexagesimalDeg()) << endl; + geo.longitude().value(CAngleUnit::deg()) << " " << geo.longitude().value(CAngleUnit::sexagesimalDeg()) << Qt::endl; - out << deltaLat.valueRoundedWithUnit(digits) << " " << deltaLng.valueRoundedWithUnit(digits) << endl; + out << deltaLat.valueRoundedWithUnit(digits) << " " << deltaLng.valueRoundedWithUnit(digits) << Qt::endl; // equal test out << "Equal? " << BlackMisc::boolToYesNo(lat == geo.latitude()) << " " << - BlackMisc::boolToYesNo(lng == geo.longitude()) << endl; + BlackMisc::boolToYesNo(lng == geo.longitude()) << Qt::endl; // check if conversions to xyz have messed something up QVector3D geoVector = geo.normalVector(); CCoordinateGeodetic geo2(geoVector); deltaLat = geo2.latitude() - lat; deltaLng = geo2.longitude() - lng; - out << deltaLat.valueRoundedWithUnit(digits) << " " << deltaLng.valueRoundedWithUnit(digits) << endl; + out << deltaLat.valueRoundedWithUnit(digits) << " " << deltaLng.valueRoundedWithUnit(digits) << Qt::endl; // Heading/bearing of same values CAngle bearing = geo.calculateBearing(geo); CLength distance = geo.calculateGreatCircleDistance(geo); - out << bearing.valueRoundedWithUnit(CAngleUnit::deg(), 2) << " " << distance.valueRoundedWithUnit(CLengthUnit::m(), 2) << endl; + out << bearing.valueRoundedWithUnit(CAngleUnit::deg(), 2) << " " << distance.valueRoundedWithUnit(CLengthUnit::m(), 2) << Qt::endl; const CCoordinateGeodetic nullCoordinate; bearing = geo.calculateBearing(nullCoordinate); distance = geo.calculateGreatCircleDistance(nullCoordinate); - out << bearing.valueRoundedWithUnit(CAngleUnit::deg(), 2) << " " << distance.valueRoundedWithUnit(CLengthUnit::m(), 2) << endl; + out << bearing.valueRoundedWithUnit(CAngleUnit::deg(), 2) << " " << distance.valueRoundedWithUnit(CLengthUnit::m(), 2) << Qt::endl; // bye - out << "-----------------------------------------------" << endl; + out << "-----------------------------------------------" << Qt::endl; return 0; } } // namespace diff --git a/samples/blackmiscquantities/samplesphysicalquantities.cpp b/samples/blackmiscquantities/samplesphysicalquantities.cpp index cdc3fa3a4..692cbaaed 100644 --- a/samples/blackmiscquantities/samplesphysicalquantities.cpp +++ b/samples/blackmiscquantities/samplesphysicalquantities.cpp @@ -40,28 +40,28 @@ namespace BlackSample CLengthUnit lu2(CLengthUnit::ft()); QString lu1s = lu1.toQString(true); QString lu2s = lu2.toQString(true); - out << "units: " << lu1 << " " << lu2 << " " << lu1s << " " << lu2s << " " << lu1.getName(true) << " " << lu2.getName(true) << endl; + out << "units: " << lu1 << " " << lu2 << " " << lu1s << " " << lu2s << " " << lu1.getName(true) << " " << lu2.getName(true) << Qt::endl; const CLength l1(5.0, CLengthUnit::ft()); // 5 ft CLength l2(1, CLengthUnit::NM()); // 1NM CLength l3(1, CLengthUnit::km()); CLength l4(l3); - out << CLengthUnit::ft() << endl; - out << l1 << " " << l2 << " " << l3 << " " << l4 << endl; - out << l1.valueRoundedWithUnit(CLengthUnit::ft(), 5) << " " << l2.valueRoundedWithUnit(CLengthUnit::km()) << endl; - out << l3.getUnit() << endl; + out << CLengthUnit::ft() << Qt::endl; + out << l1 << " " << l2 << " " << l3 << " " << l4 << Qt::endl; + out << l1.valueRoundedWithUnit(CLengthUnit::ft(), 5) << " " << l2.valueRoundedWithUnit(CLengthUnit::km()) << Qt::endl; + out << l3.getUnit() << Qt::endl; l2.switchUnit(CLengthUnit::ft()); // now in ft l3 += l3; // 2km now l3 *= 1.5;// 3km now - out << l2 << " " << l3 << endl; + out << l2 << " " << l3 << Qt::endl; l3 = l3 * 2; - out << "doubled l3: " << l3 << endl; + out << "doubled l3: " << l3 << Qt::endl; // null test CLength nullLength(0, CLengthUnit::nullUnit()); - out << "Null PQ: " << nullLength << " converted " << nullLength.valueRoundedWithUnit(CLengthUnit::m(), 2) << endl; + out << "Null PQ: " << nullLength << " converted " << nullLength.valueRoundedWithUnit(CLengthUnit::m(), 2) << Qt::endl; // more tests CFrequency f1(1E6, CFrequencyUnit::Hz()); // 1MHz @@ -72,7 +72,7 @@ namespace BlackSample CSpeed s3 = CSpeed(s2); s3.switchUnit(CSpeedUnit::m_s()); out << s1 << " " << s1.valueRoundedWithUnit(CSpeedUnit::defaultUnit()) << " " << s1.valueRoundedWithUnit(CSpeedUnit::NM_h()); - out << s2 << " " << s3 << endl; + out << s2 << " " << s3 << Qt::endl; CAngle a1(180, CAngleUnit::deg()); CAngle a2(1.5 * CAngle::PI(), CAngleUnit::rad()); @@ -86,30 +86,30 @@ namespace BlackSample a2 = a1 + a1; a2.switchUnit(CAngleUnit::deg()); - out << a1.valueRoundedWithUnit() << " " << a1.piFactor() << endl; - out << a2 << endl; + out << a1.valueRoundedWithUnit() << " " << a1.piFactor() << Qt::endl; + out << a2 << Qt::endl; a3.switchUnit(CAngleUnit::sexagesimalDeg()); a4.switchUnit(CAngleUnit::deg()); - out << a3 << " " << a4 << endl; + out << a3 << " " << a4 << Qt::endl; CMass w1(1, CMassUnit::tonne()); CMass w2(w1); w2.switchUnit(CMassUnit::lb()); - out << w1 << " " << w1.valueRoundedWithUnit(CMassUnit::kg()) << " " << w2 << endl; + out << w1 << " " << w1.valueRoundedWithUnit(CMassUnit::kg()) << " " << w2 << Qt::endl; CPressure p1(CAltitude::standardISASeaLevelPressure()); - out << p1 << " " << p1.valueRoundedWithUnit(CPressureUnit::psi()) << " " << p1.valueRoundedWithUnit(CPressureUnit::inHg()) << endl; + out << p1 << " " << p1.valueRoundedWithUnit(CPressureUnit::psi()) << " " << p1.valueRoundedWithUnit(CPressureUnit::inHg()) << Qt::endl; CTemperature t1; CTemperature t2(20, CTemperatureUnit::C()); CTemperature t3(1, CTemperatureUnit::F()); out << t1 << " " << t2 << " " << t2.valueRoundedWithUnit(CTemperatureUnit::defaultUnit(), -1, true); - out << t3.valueRoundedWithUnit(CTemperatureUnit::F(), -1, true) << " " << t3.valueRoundedWithUnit(CTemperatureUnit::C(), -1, true) << " " << "I18N/UTF" << endl; + out << t3.valueRoundedWithUnit(CTemperatureUnit::F(), -1, true) << " " << t3.valueRoundedWithUnit(CTemperatureUnit::C(), -1, true) << " " << "I18N/UTF" << Qt::endl; (t1 - t2).switchUnit(CTemperatureUnit::F()); // was not working since wrong return type const // CLengthUnit duA(CSpeedUnit::ft_min()); // no longer possible CLengthUnit duB(CLengthUnit::cm()); - out << duB << endl; + out << duB << Qt::endl; CTime ti1(1, CTimeUnit::h()); CTime ti2(ti1); @@ -121,14 +121,14 @@ namespace BlackSample CTime ti7("20s"); CTime ti8("12:30:40"); - out << ti1 << " " << ti2 << " " << ti3 << " " << ti4 << " " << ti5 << endl; - out << ti6 << " " << ti7 << " " << ti8 << endl; + out << ti1 << " " << ti2 << " " << ti3 << " " << ti4 << " " << ti5 << Qt::endl; + out << ti6 << " " << ti7 << " " << ti8 << Qt::endl; CAcceleration ac1(10, CAccelerationUnit::m_s2()); - out << ac1 << " " << ac1.toQString(true) << " " << ac1.valueRoundedWithUnit(-1, true) << " " << "I18N/UTF" << endl; + out << ac1 << " " << ac1.toQString(true) << " " << ac1.valueRoundedWithUnit(-1, true) << " " << "I18N/UTF" << Qt::endl; // bye - out << "-----------------------------------------------" << endl; + out << "-----------------------------------------------" << Qt::endl; return 0; } } // namespace diff --git a/samples/blackmiscsim/main.cpp b/samples/blackmiscsim/main.cpp index a0befc33d..6b437a6c3 100644 --- a/samples/blackmiscsim/main.cpp +++ b/samples/blackmiscsim/main.cpp @@ -44,14 +44,14 @@ int main(int argc, char *argv[]) QElapsedTimer t; while (run) { - streamOut << "Run samples:" << endl; - streamOut << "1 .. FS common / Simulation (with cfg files reading)" << endl; - streamOut << "2 .. FSX" << endl; - streamOut << "3 .. Mappings" << endl; - streamOut << "4 .. vPilot rules" << endl; - streamOut << "5 .. P3D cfg files" << endl; - streamOut << "6 .. FSUIPC read" << endl; - streamOut << "x .. exit" << endl; + streamOut << "Run samples:" << Qt::endl; + streamOut << "1 .. FS common / Simulation (with cfg files reading)" << Qt::endl; + streamOut << "2 .. FSX" << Qt::endl; + streamOut << "3 .. Mappings" << Qt::endl; + streamOut << "4 .. vPilot rules" << Qt::endl; + streamOut << "5 .. P3D cfg files" << Qt::endl; + streamOut << "6 .. FSUIPC read" << Qt::endl; + streamOut << "x .. exit" << Qt::endl; QString i = streamIn.readLine().toLower().trimmed(); t.start(); @@ -61,15 +61,15 @@ int main(int argc, char *argv[]) else if (i.startsWith("4")) { CSamplesVPilotRules::samples(streamOut, streamIn); } else if (i.startsWith("5")) { CSamplesP3D::samplesMisc(streamOut); } else if (i.startsWith("6")) { CSamplesFsuipc::samplesFsuipc(streamOut); } - else if (i.startsWith("x")) { run = false; streamOut << "terminating" << endl; } + else if (i.startsWith("x")) { run = false; streamOut << "terminating" << Qt::endl; } - streamOut << endl; - streamOut << endl; + streamOut << Qt::endl; + streamOut << Qt::endl; } - streamOut << endl; - streamOut << "time elapsed: " << t.elapsed() << "ms" << endl; - streamOut << "press key to exit" << endl; + streamOut << Qt::endl; + streamOut << "time elapsed: " << t.elapsed() << "ms" << Qt::endl; + streamOut << "press key to exit" << Qt::endl; streamIn.readLine(); return EXIT_SUCCESS; } diff --git a/samples/blackmiscsim/samplesfscommon.cpp b/samples/blackmiscsim/samplesfscommon.cpp index badf104d2..de5b20b04 100644 --- a/samples/blackmiscsim/samplesfscommon.cpp +++ b/samples/blackmiscsim/samplesfscommon.cpp @@ -55,26 +55,26 @@ namespace BlackSample multiSettings.setSettings(newSettings, sim); // set, but do NOT(!) save CAircraftCfgParser parser(sim); - streamOut << "start reading, press RETURN" << endl; + streamOut << "start reading, press RETURN" << Qt::endl; QString input = streamIn.readLine(); Q_UNUSED(input); - streamOut << "reading directly" << endl; + streamOut << "reading directly" << Qt::endl; QElapsedTimer time; time.start(); - streamOut << "reading " << parser.getFirstModelDirectoryOrDefault() << endl; + streamOut << "reading " << parser.getFirstModelDirectoryOrDefault() << Qt::endl; parser.startLoading(); - streamOut << "read entries: " << parser.getAircraftCfgEntriesList().size() << " in " << time.restart() << "ms" << endl; + streamOut << "read entries: " << parser.getAircraftCfgEntriesList().size() << " in " << time.restart() << "ms" << Qt::endl; CAircraftCfgEntriesList entriesList = parser.getAircraftCfgEntriesList(); QJsonDocument doc(entriesList.toJson()); QByteArray jsonArray(doc.toJson()); - streamOut << "write JSON array with size " << jsonArray.size() << endl; + streamOut << "write JSON array with size " << jsonArray.size() << Qt::endl; QTemporaryFile tempFile; tempFile.open(); tempFile.write(jsonArray); tempFile.close(); - streamOut << "written to " << tempFile.fileName() << " in " << time.restart() << "ms" << endl; + streamOut << "written to " << tempFile.fileName() << " in " << time.restart() << "ms" << Qt::endl; // re-read tempFile.open(); @@ -82,8 +82,8 @@ namespace BlackSample doc = QJsonDocument::fromJson(jsonArray); entriesList.clear(); entriesList.convertFromJson(doc.object()); - streamOut << "read JSON array with size " << jsonArray.size() << endl; - streamOut << "read entries from disk: " << entriesList.size() << " in " << time.restart() << "ms" << endl; + streamOut << "read JSON array with size " << jsonArray.size() << Qt::endl; + streamOut << "read entries from disk: " << entriesList.size() << " in " << time.restart() << "ms" << Qt::endl; tempFile.close(); // restore settings: DO NOT SAVE !!! diff --git a/samples/blackmiscsim/samplesfsuipc.cpp b/samples/blackmiscsim/samplesfsuipc.cpp index 43041a567..3d827b000 100644 --- a/samples/blackmiscsim/samplesfsuipc.cpp +++ b/samples/blackmiscsim/samplesfsuipc.cpp @@ -29,23 +29,23 @@ namespace BlackSample BlackMisc::registerMetadata(); QScopedPointer fsuipc(new CFsuipc()); - streamOut << "FSUIPC initialized" << endl; + streamOut << "FSUIPC initialized" << Qt::endl; if (fsuipc->open()) { - streamOut << "FSUIPC connected" << endl; + streamOut << "FSUIPC connected" << Qt::endl; } else { - streamOut << "FSUIPC NOT(!) connected" << endl; - streamOut << "Need FS WideClient?" << endl; + streamOut << "FSUIPC NOT(!) connected" << Qt::endl; + streamOut << "Need FS WideClient?" << Qt::endl; return; } CSimulatedAircraft aircraft; if (fsuipc->read(aircraft, true, true, true)) { - streamOut << "Aircraft read: " << aircraft.toQString(true) << endl; + streamOut << "Aircraft read: " << aircraft.toQString(true) << Qt::endl; } fsuipc->close(); diff --git a/samples/blackmiscsim/samplesfsx.cpp b/samples/blackmiscsim/samplesfsx.cpp index 47ff2eb16..243205d48 100644 --- a/samples/blackmiscsim/samplesfsx.cpp +++ b/samples/blackmiscsim/samplesfsx.cpp @@ -22,8 +22,8 @@ namespace BlackSample void CSamplesFsx::samplesMisc(QTextStream &streamOut) { BlackMisc::registerMetadata(); - streamOut << CSimConnectUtilities::simConnectExceptionToString(CSimConnectUtilities::SIMCONNECT_EXCEPTION_ALREADY_SUBSCRIBED) << endl; - streamOut << CSimConnectUtilities::simConnectExceptionToString(CSimConnectUtilities::SIMCONNECT_EXCEPTION_ILLEGAL_OPERATION) << endl; - streamOut << CSimConnectUtilities::simConnectSurfaceTypeToString(CSimConnectUtilities::Bituminus) << endl; + streamOut << CSimConnectUtilities::simConnectExceptionToString(CSimConnectUtilities::SIMCONNECT_EXCEPTION_ALREADY_SUBSCRIBED) << Qt::endl; + streamOut << CSimConnectUtilities::simConnectExceptionToString(CSimConnectUtilities::SIMCONNECT_EXCEPTION_ILLEGAL_OPERATION) << Qt::endl; + streamOut << CSimConnectUtilities::simConnectSurfaceTypeToString(CSimConnectUtilities::Bituminus) << Qt::endl; } } // namespace diff --git a/samples/blackmiscsim/samplesmodelmapping.cpp b/samples/blackmiscsim/samplesmodelmapping.cpp index 5c86ea26d..9838c2b6a 100644 --- a/samples/blackmiscsim/samplesmodelmapping.cpp +++ b/samples/blackmiscsim/samplesmodelmapping.cpp @@ -41,8 +41,8 @@ namespace BlackSample { CVPilotRulesReader vpRulesReader; const bool s = vpRulesReader.read(true); - streamOut << "directory: " << CVPilotRulesReader::standardMappingsDirectory() << endl; - streamOut << "loaded: " << BlackMisc::boolToYesNo(s) << " size: " << vpRulesReader.getAsModelsFromCache().size() << endl; + streamOut << "directory: " << CVPilotRulesReader::standardMappingsDirectory() << Qt::endl; + streamOut << "loaded: " << BlackMisc::boolToYesNo(s) << " size: " << vpRulesReader.getAsModelsFromCache().size() << Qt::endl; // mapper with rule set, handing over ownership const QString fsDir = CSampleUtils::selectDirectory( @@ -60,18 +60,18 @@ namespace BlackSample multiSettings.setSettings(newSettings, sim); // set, but do NOT(!) save CAircraftCfgParser cfgParser(sim); - streamOut << "Start reading models" << endl; + streamOut << "Start reading models" << Qt::endl; cfgParser.startLoading(CAircraftCfgParser::CacheSkipped | CAircraftCfgParser::LoadDirectly); - streamOut << "Read models: " << cfgParser.getAircraftCfgEntriesList().size() << endl; - streamOut << "Ambigious models: " << cfgParser.getAircraftCfgEntriesList().detectAmbiguousTitles().join(", ") << endl; + streamOut << "Read models: " << cfgParser.getAircraftCfgEntriesList().size() << Qt::endl; + streamOut << "Ambigious models: " << cfgParser.getAircraftCfgEntriesList().detectAmbiguousTitles().join(", ") << Qt::endl; // sync definitions, remove redundant ones CAircraftMatcher matcher; matcher.setModelSet(vpRulesReader.getAsModelsFromCache(), CSimulatorInfo::FSX, true); const CAircraftIcaoCode icao("C172"); - streamOut << "Searching for " << icao << endl; - streamOut << matcher.getModelSetRef().findByIcaoDesignators(icao, CAirlineIcaoCode()) << endl; + streamOut << "Searching for " << icao << Qt::endl; + streamOut << matcher.getModelSetRef().findByIcaoDesignators(icao, CAirlineIcaoCode()) << Qt::endl; // restore settings: DO NOT SAVE !!! multiSettings.setSettings(originalSettings, sim); diff --git a/samples/blackmiscsim/samplesp3d.cpp b/samples/blackmiscsim/samplesp3d.cpp index bfa45855f..0d6f30cbf 100644 --- a/samples/blackmiscsim/samplesp3d.cpp +++ b/samples/blackmiscsim/samplesp3d.cpp @@ -21,12 +21,12 @@ namespace BlackSample void CSamplesP3D::samplesMisc(QTextStream &streamOut) { const QSet configFiles = CFsCommonUtil::findP3dAddOnConfigFiles("v4"); - streamOut << BlackMisc::joinStringSet(configFiles, ", ") << endl; + streamOut << BlackMisc::joinStringSet(configFiles, ", ") << Qt::endl; const QSet addOnPaths = CFsCommonUtil::allConfigFilesPathValues(configFiles.values(), false, {}); - streamOut << BlackMisc::joinStringSet(addOnPaths, ", ") << endl; + streamOut << BlackMisc::joinStringSet(addOnPaths, ", ") << Qt::endl; const QSet simObjectPaths = CFsCommonUtil::fsxSimObjectsPaths("B:/fsx.cfg", false); - streamOut << BlackMisc::joinStringSet(simObjectPaths, ", ") << endl; + streamOut << BlackMisc::joinStringSet(simObjectPaths, ", ") << Qt::endl; } } // namespace diff --git a/samples/blackmiscsim/samplesvpilotrules.cpp b/samples/blackmiscsim/samplesvpilotrules.cpp index bb9e313f6..657839467 100644 --- a/samples/blackmiscsim/samplesvpilotrules.cpp +++ b/samples/blackmiscsim/samplesvpilotrules.cpp @@ -35,8 +35,8 @@ namespace BlackSample BlackMisc::registerMetadata(); QScopedPointer vPilotReader(new CVPilotRulesReader()); bool s = vPilotReader->read(false); - streamOut << "Read success: " << BlackMisc::boolToYesNo(s) << endl; - streamOut << "Read " << vPilotReader->countRulesLoaded() << " rules from " << vPilotReader->countFilesLoaded() << " files" << endl; + streamOut << "Read success: " << BlackMisc::boolToYesNo(s) << Qt::endl; + streamOut << "Read " << vPilotReader->countRulesLoaded() << " rules from " << vPilotReader->countFilesLoaded() << " files" << Qt::endl; streamOut << "Distributors: " << vPilotReader->getRules().getSortedDistributors().join(", "); Q_UNUSED(streamIn); diff --git a/samples/weatherdata/main.cpp b/samples/weatherdata/main.cpp index 115f3ddba..281474e8d 100644 --- a/samples/weatherdata/main.cpp +++ b/samples/weatherdata/main.cpp @@ -41,9 +41,9 @@ int main(int argc, char *argv[]) QObject::connect(&lineReader, &CLineReader::finished, &a, &QCoreApplication::quit); QTextStream qtout(stdout); - qtout << "Usage: " << endl; - qtout << "Example: 48.5 11.5" << endl; - qtout << "Type x to quit" << endl; + qtout << "Usage: " << Qt::endl; + qtout << "Example: 48.5 11.5" << Qt::endl; + qtout << "Type x to quit" << Qt::endl; lineReader.start(); return a.exec(); diff --git a/samples/weatherdata/reader.cpp b/samples/weatherdata/reader.cpp index 626e14337..051793f42 100644 --- a/samples/weatherdata/reader.cpp +++ b/samples/weatherdata/reader.cpp @@ -57,8 +57,8 @@ void CLineReader::run() else { QTextStream qtout(stdout); - qtout << "Invalid command." << endl; - qtout << "Usage: " << endl; + qtout << "Invalid command." << Qt::endl; + qtout << "Usage: " << Qt::endl; } } } diff --git a/samples/weatherdata/weatherdataprinter.cpp b/samples/weatherdata/weatherdataprinter.cpp index 62622040e..b7ca9cf3c 100644 --- a/samples/weatherdata/weatherdataprinter.cpp +++ b/samples/weatherdata/weatherdataprinter.cpp @@ -48,8 +48,8 @@ CWeatherDataPrinter::CWeatherDataPrinter(QObject *parent) : QObject(parent) void CWeatherDataPrinter::fetchAndPrintWeatherData(const CCoordinateGeodetic &position) { QTextStream qtout(stdout); - qtout << "Position:" << position.toQString(true) << endl; - qtout << "Fetching weather data. This may take a while..." << endl; + qtout << "Position:" << position.toQString(true) << Qt::endl; + qtout << "Fetching weather data. This may take a while..." << Qt::endl; const CWeatherGrid weatherGrid { { "", position } }; m_weatherManger.requestWeatherGrid(weatherGrid, { this, &CWeatherDataPrinter::printWeatherData }); diff --git a/src/blackcore/fsd/fsdclient.cpp b/src/blackcore/fsd/fsdclient.cpp index 6fd0e153d..cb2e4f827 100644 --- a/src/blackcore/fsd/fsdclient.cpp +++ b/src/blackcore/fsd/fsdclient.cpp @@ -1971,7 +1971,7 @@ namespace BlackCore if (m_rawFsdMessageLogFile.isOpen()) { QTextStream stream(&m_rawFsdMessageLogFile); - stream << rawMessage.toQString().trimmed() << endl; + stream << rawMessage.toQString().trimmed() << Qt::endl; } emit rawFsdMessage(rawMessage); } diff --git a/src/blackmisc/dbusutils.cpp b/src/blackmisc/dbusutils.cpp index 3bf39a6f2..0d6c21e56 100644 --- a/src/blackmisc/dbusutils.cpp +++ b/src/blackmisc/dbusutils.cpp @@ -80,28 +80,28 @@ namespace BlackMisc const CVariant var; QString s; s = CDBusUtils::dBusSignature(cs); - out << "CCallsign" << " size: " << s.size() << " sig: " << s << endl; + out << "CCallsign" << " size: " << s.size() << " sig: " << s << Qt::endl; s = CDBusUtils::dBusSignature(l); - out << "CLength" << " size: " << s.size() << " sig: " << s << endl; + out << "CLength" << " size: " << s.size() << " sig: " << s << Qt::endl; s = CDBusUtils::dBusSignature(icao); - out << "CAircraftIcaoCode" << " size: " << s.size() << " sig: " << s << endl; + out << "CAircraftIcaoCode" << " size: " << s.size() << " sig: " << s << Qt::endl; s = CDBusUtils::dBusSignature(airportIcao); - out << "CAirportIcaoCode" << " size: " << s.size() << " sig: " << s << endl; + out << "CAirportIcaoCode" << " size: " << s.size() << " sig: " << s << Qt::endl; s = CDBusUtils::dBusSignature(livery); - out << "CLivery" << " size: " << s.size() << " sig: " << s << endl; + out << "CLivery" << " size: " << s.size() << " sig: " << s << Qt::endl; s = CDBusUtils::dBusSignature(situation); - out << "CAircraftSituation" << " size: " << s.size() << " sig: " << s << endl; + out << "CAircraftSituation" << " size: " << s.size() << " sig: " << s << Qt::endl; s = CDBusUtils::dBusSignature(country); - out << "CCountry" << " size: " << s.size() << " sig: " << s << endl; + out << "CCountry" << " size: " << s.size() << " sig: " << s << Qt::endl; s = CDBusUtils::dBusSignature(airport); - out << "CAirport" << " size: " << s.size() << " sig: " << s << endl; + out << "CAirport" << " size: " << s.size() << " sig: " << s << Qt::endl; s = CDBusUtils::dBusSignature(model); - out << "CAircraftModel" << " size: " << s.size() << " sig: " << s << endl; + out << "CAircraftModel" << " size: " << s.size() << " sig: " << s << Qt::endl; s = CDBusUtils::dBusSignature(aircraft); - out << "CSimulatedAircraft" << " size: " << s.size() << " sig: " << s << endl; + out << "CSimulatedAircraft" << " size: " << s.size() << " sig: " << s << Qt::endl; s = CDBusUtils::dBusSignature(aircraftList); - out << "CSimulatedAircraftList" << " size: " << s.size() << " sig: " << s << endl; + out << "CSimulatedAircraftList" << " size: " << s.size() << " sig: " << s << Qt::endl; s = CDBusUtils::dBusSignature(var); - out << "CVariant" << " size: " << s.size() << " sig: " << s << endl; + out << "CVariant" << " size: " << s.size() << " sig: " << s << Qt::endl; } } // ns diff --git a/src/blackmisc/filelogger.cpp b/src/blackmisc/filelogger.cpp index e6f88d87d..f97417ceb 100644 --- a/src/blackmisc/filelogger.cpp +++ b/src/blackmisc/filelogger.cpp @@ -130,22 +130,22 @@ namespace BlackMisc m_stream << "This is " << applicationName(); m_stream << " version " << CBuildConfig::getVersionString(); m_stream << " running on " << QSysInfo::prettyProductName(); - m_stream << " " << QSysInfo::currentCpuArchitecture() << endl; + m_stream << " " << QSysInfo::currentCpuArchitecture() << Qt::endl; m_stream << "Built from revision " << CBuildConfig::gitHeadSha1(); - m_stream << " on " << CBuildConfig::buildDateAndTime() << endl; + m_stream << " on " << CBuildConfig::buildDateAndTime() << Qt::endl; m_stream << "Built with Qt " << QT_VERSION_STR; m_stream << " and running with Qt " << qVersion(); - m_stream << " " << QSysInfo::buildAbi() << endl; + m_stream << " " << QSysInfo::buildAbi() << Qt::endl; - m_stream << "Program is going to expire on " + CBuildConfig::getEol().toString() << "." << endl; + m_stream << "Program is going to expire on " + CBuildConfig::getEol().toString() << "." << Qt::endl; - m_stream << "Application started." << endl; + m_stream << "Application started." << Qt::endl; } void CFileLogger::writeContentToFile(const QString &content) { - m_stream << content << endl; + m_stream << content << Qt::endl; } } diff --git a/src/blackmisc/sampleutils.cpp b/src/blackmisc/sampleutils.cpp index 669e41366..ff3458e9c 100644 --- a/src/blackmisc/sampleutils.cpp +++ b/src/blackmisc/sampleutils.cpp @@ -27,7 +27,7 @@ namespace BlackMisc if (i > 0) { streamOut << " "; } streamOut << (i + 1) << ") " << directoryOptions.at(i) ; } - streamOut << endl; + streamOut << Qt::endl; streamOut << "Select [1-" << directoryOptions.size() << "]: "; streamOut.flush(); diff --git a/src/blackmisc/simulation/xplane/xswiftbusconfigwriter.cpp b/src/blackmisc/simulation/xplane/xswiftbusconfigwriter.cpp index 2a0ea7fbe..c9ab76d81 100644 --- a/src/blackmisc/simulation/xplane/xswiftbusconfigwriter.cpp +++ b/src/blackmisc/simulation/xplane/xswiftbusconfigwriter.cpp @@ -83,25 +83,25 @@ namespace BlackMisc { // this code should be similar to XSwiftBus config.cpp QTextStream ts(&configFile); - ts << "# DBus Mode - Options: p2p, session" << endl; - ts << "dbusMode = " << m_dbusMode << endl; - ts << endl; - ts << "# DBus server address - relevant for P2P mode only" << endl; - ts << "dbusAddress = " << m_dbusAddress << endl; - ts << endl; - ts << "# DBus server port - relevant for P2P mode only" << endl; - ts << "dbusPort = " << m_dbusPort << endl; - ts << endl; - ts << "# Render phase debugging - to help diagnose crashes" << endl; - ts << "debug = " << boolToOnOff(m_debug) << endl; - ts << endl; - ts << "# TCAS traffic - to disable in case of crashes" << endl; - ts << "tcas = " << boolToOnOff(m_tcas) << endl; + ts << "# DBus Mode - Options: p2p, session" << Qt::endl; + ts << "dbusMode = " << m_dbusMode << Qt::endl; + ts << Qt::endl; + ts << "# DBus server address - relevant for P2P mode only" << Qt::endl; + ts << "dbusAddress = " << m_dbusAddress << Qt::endl; + ts << Qt::endl; + ts << "# DBus server port - relevant for P2P mode only" << Qt::endl; + ts << "dbusPort = " << m_dbusPort << Qt::endl; + ts << Qt::endl; + ts << "# Render phase debugging - to help diagnose crashes" << Qt::endl; + ts << "debug = " << boolToOnOff(m_debug) << Qt::endl; + ts << Qt::endl; + ts << "# TCAS traffic - to disable in case of crashes" << Qt::endl; + ts << "tcas = " << boolToOnOff(m_tcas) << Qt::endl; // add comment as information - ts << endl; + ts << Qt::endl; ts << "# Updated by CXSwiftBusConfigWriter " << QDateTime::currentDateTimeUtc().toString("yyyyMMddHHmmss") << " "; - ts << endl; + ts << Qt::endl; } } } // ns diff --git a/src/blackmisc/test/testservice.cpp b/src/blackmisc/test/testservice.cpp index d2f4a0ec7..3e7a2bcb5 100644 --- a/src/blackmisc/test/testservice.cpp +++ b/src/blackmisc/test/testservice.cpp @@ -73,8 +73,8 @@ namespace BlackMisc { QDBusError error = connection.lastError(); err() << error.message(); - err() << "Started dbus-daemon.exe --session (Windows)?" << endl; - err() << "Created directory session.d (e.g. ../Qt/5.8.0/qtbase/etc/dbus-1/session.d)?" << endl; + err() << "Started dbus-daemon.exe --session (Windows)?" << Qt::endl; + err() << "Created directory session.d (e.g. ../Qt/5.8.0/qtbase/etc/dbus-1/session.d)?" << Qt::endl; qFatal("Could not register service!"); } @@ -83,14 +83,14 @@ namespace BlackMisc qFatal("Could not register service object!"); } - out() << "Registration running as pid: " << CTestService::getPid() << endl; - if (pTestService) { out() << "Service registered" << endl; } + out() << "Registration running as pid: " << CTestService::getPid() << Qt::endl; + if (pTestService) { out() << "Service registered" << Qt::endl; } QString service; // service not needed if (connection.connect(service, CTestService::ObjectPath(), CTestService::InterfaceName(), "sendStringMessage", pTestService, SLOT(receiveStringMessage(const QString &)))) { - out() << "Connected object with DBus 'sendStringMessage'" << endl; + out() << "Connected object with DBus 'sendStringMessage'" << Qt::endl; } else { @@ -118,236 +118,236 @@ namespace BlackMisc void CTestService::receiveStringMessage(const QString &message) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received message: " << message << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received message: " << message << Qt::endl; } void CTestService::receiveVariant(const CVariant &variant) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received variant: " << variant << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received variant: " << variant << Qt::endl; } void CTestService::receiveSpeed(const BlackMisc::PhysicalQuantities::CSpeed &speed) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received speed: " << speed << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received speed: " << speed << Qt::endl; } void CTestService::receiveComUnit(const CComSystem &comUnit) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received COM: " << comUnit << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received COM: " << comUnit << Qt::endl; } void CTestService::receiveAltitude(const CAltitude &altitude) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received altitude: " << altitude << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received altitude: " << altitude << Qt::endl; } void CTestService::receiveList(const QList &list) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received list: " << list.size() << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received list: " << list.size() << Qt::endl; } void CTestService::receiveGeoPosition(const BlackMisc::Geo::CCoordinateGeodetic &geo) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received geo data: " << geo << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received geo data: " << geo << Qt::endl; } void CTestService::receiveTransponder(const CTransponder &transponder) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received transponder: " << transponder << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received transponder: " << transponder << Qt::endl; } void CTestService::receiveTrack(const CTrack &track) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received track: " << track << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received track: " << track << Qt::endl; } void CTestService::receiveLength(const BlackMisc::PhysicalQuantities::CLength &length) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received length: " << length << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received length: " << length << Qt::endl; } void CTestService::receiveVariantList(const CVariantList &variantList) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " " << variantList.size() << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " " << variantList.size() << Qt::endl; for (const CVariant &lv : variantList) { - if (m_verbose) out() << " Received variant: " << lv.toQString() << endl; + if (m_verbose) out() << " Received variant: " << lv.toQString() << Qt::endl; } } void CTestService::receiveCallsign(const CCallsign &callsign) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received callsign: " << callsign << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received callsign: " << callsign << Qt::endl; } void CTestService::receiveAtcStationList(const CAtcStationList &atcStationList) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received ATC list: " << atcStationList << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received ATC list: " << atcStationList << Qt::endl; } void CTestService::receiveValueMap(const BlackMisc::CPropertyIndexVariantMap &valueMap) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received value map: " << valueMap << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received value map: " << valueMap << Qt::endl; } void CTestService::receiveAtcStation(const CAtcStation &station) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received ATC station: " << station << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " Received ATC station: " << station << Qt::endl; } CAtcStationList CTestService::pingAtcStationList(const CAtcStationList &atcStationList) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping ATCs: " << atcStationList << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping ATCs: " << atcStationList << Qt::endl; return atcStationList; } CSimulatedAircraftList CTestService::pingAircraftList(const CSimulatedAircraftList &aircraftList) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft: " << aircraftList << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft: " << aircraftList << Qt::endl; return aircraftList; } CAircraftParts CTestService::pingAircraftParts(const CAircraftParts &aircraftParts) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft parts: " << aircraftParts << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft parts: " << aircraftParts << Qt::endl; return aircraftParts; } CAircraftEngine CTestService::pingAircraftEngine(const CAircraftEngine &aircraftEngine) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft engine: " << aircraftEngine << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft engine: " << aircraftEngine << Qt::endl; return aircraftEngine; } CAircraftModel CTestService::pingAircraftModel(const CAircraftModel &aircraftModel) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft model: " << aircraftModel << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft model: " << aircraftModel << Qt::endl; return aircraftModel; } CAircraftModelList CTestService::pingAircraftModelList(const CAircraftModelList &aircraftModels) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft modellist: " << aircraftModels << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft modellist: " << aircraftModels << Qt::endl; return aircraftModels; } CAircraftLights CTestService::pingAircraftLights(const CAircraftLights &aircraftLights) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft lights: " << aircraftLights << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping aircraft lights: " << aircraftLights << Qt::endl; return aircraftLights; } CSimulatedAircraft CTestService::pingSimulatedAircraft(const CSimulatedAircraft &aircraft) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping simulated aircraft: " << aircraft << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping simulated aircraft: " << aircraft << Qt::endl; return aircraft; } CAirportList CTestService::pingAirportList(const CAirportList &airportList) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping airports: " << airportList << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping airports: " << airportList << Qt::endl; return airportList; } CPropertyIndex CTestService::pingPropertyIndex(const CPropertyIndex &properties) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping properties: " << properties << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping properties: " << properties << Qt::endl; return properties; } CPropertyIndexVariantMap CTestService::pingIndexVariantMap(const CPropertyIndexVariantMap &indexVariantMap) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping properties: " << indexVariantMap << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping properties: " << indexVariantMap << Qt::endl; return indexVariantMap; } CClient CTestService::pingClient(const CClient &client) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping client: " << client << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping client: " << client << Qt::endl; return client; } CClientList CTestService::pingClientList(const CClientList &clientList) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping clients: " << clientList << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping clients: " << clientList << Qt::endl; return clientList; } CSpeed CTestService::pingSpeed(const CSpeed &speed) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping speed: " << speed << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping speed: " << speed << Qt::endl; return speed; } CAltitude CTestService::pingAltitude(const CAltitude &altitude) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping alt: " << altitude << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping alt: " << altitude << Qt::endl; return altitude; } CUser CTestService::pingUser(const CUser &user) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping user: " << user << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping user: " << user << Qt::endl; return user; } CAircraftSituation CTestService::pingSituation(const CAircraftSituation &situation) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping situation: " << situation << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping situation: " << situation << Qt::endl; return situation; } CTransponder CTestService::pingTransponder(const CTransponder &transponder) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping transponder: " << transponder << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping transponder: " << transponder << Qt::endl; return transponder; } CAtcStation CTestService::pingAtcStation(const CAtcStation &station) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping ATC: " << station << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping ATC: " << station << Qt::endl; return station; } CAircraftIcaoCode CTestService::pingAircraftIcaoData(const CAircraftIcaoCode &icao) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping ICAO data: " << icao << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " ping ICAO data: " << icao << Qt::endl; return icao; } CSimulatorPluginInfo CTestService::pingPluginInfo(const CSimulatorPluginInfo &info) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " info: " << info << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " info: " << info << Qt::endl; return info; } BlackMisc::CVariant CTestService::pingCVariant(const CVariant &variant) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " client sent back as CVariant: " << variant.toQString() << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " client sent back as CVariant: " << variant.toQString() << Qt::endl; return variant; } BlackMisc::Aviation::CFlightPlan CTestService::pingFlightPlan(const BlackMisc::Aviation::CFlightPlan &flightPlan) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " info: " << flightPlan << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " info: " << flightPlan << Qt::endl; return flightPlan; } CAtcStationList CTestService::getAtcStationList(int n) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " getAtcStationList" << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " getAtcStationList" << Qt::endl; return CTesting::createAtcStations(n, false); } CAircraftCfgEntriesList CTestService::getAircraftCfgEntriesList(int n) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " getAircraftCfgEntriesList" << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " getAircraftCfgEntriesList" << Qt::endl; return CTesting::getAircraftCfgEntries(n); } QList CTestService::getObjectPaths(int n) const { - if (m_verbose) out() << "Pid: " << CTestService::getPid() << " getObjectPaths" << endl; + if (m_verbose) out() << "Pid: " << CTestService::getPid() << " getObjectPaths" << Qt::endl; QList paths; paths.reserve(n); for (int i = 0; i < n; i++) diff --git a/src/blackmisc/test/testserviceinterface.cpp b/src/blackmisc/test/testserviceinterface.cpp index 359b6a299..906b6ef9d 100644 --- a/src/blackmisc/test/testserviceinterface.cpp +++ b/src/blackmisc/test/testserviceinterface.cpp @@ -43,104 +43,104 @@ namespace BlackMisc const CPropertyIndex pi({ 1000, 2000, 3000, 4000, 5000}); // numbers >= global index const CPropertyIndex piPing = testServiceInterface.pingPropertyIndex(pi); ok = pingCompare(pi, piPing, out, verbose, errors); - if (verbose) { out << "Pinged property index via interface" << errorInfo(ok) << endl; } + if (verbose) { out << "Pinged property index via interface" << errorInfo(ok) << Qt::endl; } const CPropertyIndexVariantMap ivm = CTestData::getCPropertyIndexVariantMap(); const CPropertyIndexVariantMap ivmPing = testServiceInterface.pingIndexVariantMap(ivm); ok = pingCompare(ivm, ivmPing, out, verbose, errors); - if (verbose) { out << "Pinged variant map via interface" << errorInfo(ok) << endl; } + if (verbose) { out << "Pinged variant map via interface" << errorInfo(ok) << Qt::endl; } const CSimulatorPluginInfo pluginInfo("fsx", "FSX Simulator", "FSX", "Flight Simulator X", true); const CSimulatorPluginInfo pluginInfoPing = testServiceInterface.pingPluginInfo(pluginInfo); ok = pingCompare(pluginInfo, pluginInfoPing, out, verbose, errors); - if (verbose) { out << "Pinged info via interface" << errorInfo(ok) << endl; } + if (verbose) { out << "Pinged info via interface" << errorInfo(ok) << Qt::endl; } const CSpeed speedNotNull(22, CSpeedUnit::m_s()); const CSpeed speedNull = CSpeed(0, CSpeedUnit::nullUnit()); const CSpeed speedNotNullPing = testServiceInterface.pingSpeed(speedNotNull); ok = pingCompare(speedNotNull, speedNotNullPing, out, verbose, errors); - if (verbose) { out << "Pinged not null speed via interface" << errorInfo(ok) << endl; } + if (verbose) { out << "Pinged not null speed via interface" << errorInfo(ok) << Qt::endl; } const CSpeed speedNullPing = testServiceInterface.pingSpeed(speedNull); ok = pingCompare(speedNull, speedNullPing, out, verbose, errors); - if (verbose) { out << "Pinged null speed via interface" << errorInfo(ok) << endl; } + if (verbose) { out << "Pinged null speed via interface" << errorInfo(ok) << Qt::endl; } const CAtcStation station = CTestData::getRandomAtcStation(); const CAtcStation stationPing = testServiceInterface.pingAtcStation(station); ok = pingCompare(station, stationPing, out, verbose, errors); - if (verbose) { out << "Pinged ATC station via interface" << errorInfo(ok) << endl; } + if (verbose) { out << "Pinged ATC station via interface" << errorInfo(ok) << Qt::endl; } const CAircraftIcaoCode icaoData = CTestData::getDBAircraftIcaoB737(); const CAircraftIcaoCode icaoDataPing = testServiceInterface.pingAircraftIcaoData(icaoData); ok = pingCompare(icaoData, icaoDataPing, out, verbose, errors); - if (verbose) { out << "Pinged ICAO data via interface" << errorInfo(ok) << endl; } + if (verbose) { out << "Pinged ICAO data via interface" << errorInfo(ok) << Qt::endl; } const CUser user = CTestData::getRandomPilot(); const CUser userPing = testServiceInterface.pingUser(user); ok = pingCompare(user, userPing, out, verbose, errors); - if (verbose) { out << "Pinged user via interface" << errorInfo(ok) << endl; } + if (verbose) { out << "Pinged user via interface" << errorInfo(ok) << Qt::endl; } const CAircraftSituation situation = CTestData::getAircraftSituationAboveMunichTower(); const CAircraftSituation situationPing = testServiceInterface.pingSituation(situation); ok = pingCompare(situation, situationPing, out, verbose, errors); - if (verbose) { out << "Pinged situation via interface" << errorInfo(ok) << endl; } + if (verbose) { out << "Pinged situation via interface" << errorInfo(ok) << Qt::endl; } const CTransponder transponder(1234, "C"); const CTransponder transponderPing = testServiceInterface.pingTransponder(transponder); ok = pingCompare(transponder, transponderPing, out, verbose, errors); - if (verbose) { out << "Pinged transponder via interface" << errorInfo(ok) << endl; } + if (verbose) { out << "Pinged transponder via interface" << errorInfo(ok) << Qt::endl; } const CAircraftLights lights(true, false, true, false, true, false); const CAircraftLights lightsPing = testServiceInterface.pingAircraftLights(lights); ok = pingCompare(lights, lightsPing, out, verbose, errors); - if (verbose) { out << "Pinged lights via interface" << errorInfo(ok) << endl; } + if (verbose) { out << "Pinged lights via interface" << errorInfo(ok) << Qt::endl; } const CAircraftEngine engine(2, false); const CAircraftEngine enginePing = testServiceInterface.pingAircraftEngine(engine); ok = pingCompare(engine, enginePing, out, verbose, errors); - if (verbose) { out << "Pinged engine via interface" << errorInfo(ok) << endl; } + if (verbose) { out << "Pinged engine via interface" << errorInfo(ok) << Qt::endl; } const CAircraftEngineList engines({engine}); const CAircraftParts parts(lights, true, 11, true, engines, true); const CAircraftParts partsPing = testServiceInterface.pingAircraftParts(parts); ok = pingCompare(parts, partsPing, out, verbose, errors); - if (verbose) { out << "Pinged engine via interface" << errorInfo(ok) << endl; } + if (verbose) { out << "Pinged engine via interface" << errorInfo(ok) << Qt::endl; } const CAircraftModel model = CTestData::getDbAircraftModelFsxAerosoftA320(); const CAircraftModel modelPing = testServiceInterface.pingAircraftModel(model); ok = pingCompare(model, modelPing, out, verbose, errors); - if (verbose) { out << "Pinged model via interface" << errorInfo(ok) << endl; } + if (verbose) { out << "Pinged model via interface" << errorInfo(ok) << Qt::endl; } const CAircraftModelList models({ model, CTestData::getDbAircraftModelFsxA2AC172Skyhawk() }); const CAircraftModelList modelsPing = testServiceInterface.pingAircraftModelList(models); ok = pingCompare(models, modelsPing, out, verbose, errors); - if (verbose) { out << "Pinged model list via interface" << errorInfo(ok) << endl; } + if (verbose) { out << "Pinged model list via interface" << errorInfo(ok) << Qt::endl; } const CSimulatedAircraft aircraft = CTestData::getA320Aircraft(); const CSimulatedAircraft aircraftPing = testServiceInterface.pingSimulatedAircraft(aircraft); ok = pingCompare(aircraft, aircraftPing, out, verbose, errors); - if (verbose) { out << "Pinged simulated aircraft via interface" << errorInfo(ok) << endl; } + if (verbose) { out << "Pinged simulated aircraft via interface" << errorInfo(ok) << Qt::endl; } const CAtcStationList atcStationList = CTestData::getAtcStations(); const CAtcStationList atcStationListPing = testServiceInterface.pingAtcStationList(atcStationList); ok = pingCompare(atcStationList, atcStationListPing, out, verbose, errors); - if (verbose) { out << "Pinged ATC station list via interface" << errorInfo(ok) << endl; } + if (verbose) { out << "Pinged ATC station list via interface" << errorInfo(ok) << Qt::endl; } const CAirportList airportList = CTesting::getAirports(10); const CAirportList airportListPing = testServiceInterface.pingAirportList(airportList); ok = pingCompare(airportList, airportListPing, out, verbose, errors); - if (verbose) { out << "Pinged airports list via interface" << errorInfo(ok) << endl; } + if (verbose) { out << "Pinged airports list via interface" << errorInfo(ok) << Qt::endl; } const CClientList clients = CTesting::getClients(10); const CClient client = clients.front(); const CClient clientPing = testServiceInterface.pingClient(client); ok = pingCompare(client, clientPing, out, verbose, errors); - if (verbose) { out << "Pinged client list via interface" << errorInfo(ok) << endl; } + if (verbose) { out << "Pinged client list via interface" << errorInfo(ok) << Qt::endl; } const CClientList clientsPing = testServiceInterface.pingClientList(clients); ok = pingCompare(clients, clientsPing, out, verbose, errors); - if (verbose) { out << "Pinged client list via interface" << errorInfo(ok) << endl; } + if (verbose) { out << "Pinged client list via interface" << errorInfo(ok) << Qt::endl; } CFlightPlan flightPlan; flightPlan.setEnrouteTime(CTime(4, CTimeUnit::h())); @@ -149,17 +149,17 @@ namespace BlackMisc flightPlan.setCruiseTrueAirspeed(CSpeed(500, CSpeedUnit::km_h())); const CFlightPlan flightPlanPing = testServiceInterface.pingFlightPlan(flightPlan); ok = pingCompare(flightPlan, flightPlanPing, out, verbose, errors); - if (verbose) { out << "Pinged flight plan via interface" << errorInfo(ok) << endl; } + if (verbose) { out << "Pinged flight plan via interface" << errorInfo(ok) << Qt::endl; } const CVariant cv = CVariant::fromValue(clients); const CVariant cvPing = testServiceInterface.pingCVariant(cv); ok = pingCompare(cv.value(), cvPing.value(), out, verbose, errors); - if (verbose) { out << "Pinged CVariant(clients) list via interface" << errorInfo(ok) << endl; } + if (verbose) { out << "Pinged CVariant(clients) list via interface" << errorInfo(ok) << Qt::endl; } const CVariant cv2 = CVariant::fromValue(aircraft); const CVariant cv2Ping = testServiceInterface.pingCVariant(cv2); ok = pingCompare(cv2.value(), cv2Ping.value(), out, verbose, errors); - if (verbose) { out << "Pinged CVariant(aircraft) list via interface" << errorInfo(ok) << endl; } + if (verbose) { out << "Pinged CVariant(aircraft) list via interface" << errorInfo(ok) << Qt::endl; } // end return errors; diff --git a/src/blackmisc/test/testserviceinterface.h b/src/blackmisc/test/testserviceinterface.h index fad866267..4dc7327dc 100644 --- a/src/blackmisc/test/testserviceinterface.h +++ b/src/blackmisc/test/testserviceinterface.h @@ -394,7 +394,7 @@ namespace BlackMisc if (!equal) { errors++; - if (verbose) { ts << "I: " << in.toQString() << endl << "O: " << out.toQString() << endl; } + if (verbose) { ts << "I: " << in.toQString() << endl << "O: " << out.toQString() << Qt::endl; } } return equal; }