From ef0fd3ca67af79dfd6674dd2901182f116f20de7 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 15 Oct 2020 15:22:28 +0200 Subject: [PATCH] Qt5: 'endl' manipulator is deprecated with 5.15. Replace it with newlines. --- src/Gui/Assistant.cpp | 2 +- src/Gui/AutoSaver.cpp | 12 ++++++------ src/Gui/CommandView.cpp | 12 ++++++------ src/Gui/DocumentRecovery.cpp | 20 ++++++++++---------- src/Gui/Splashscreen.cpp | 30 +++++++++++++++--------------- 5 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/Gui/Assistant.cpp b/src/Gui/Assistant.cpp index d999471e10b9..20f6fb2f673d 100644 --- a/src/Gui/Assistant.cpp +++ b/src/Gui/Assistant.cpp @@ -61,7 +61,7 @@ void Assistant::showDocumentation(const QString &page) if (!page.isEmpty()) { QTextStream str(proc); str << QLatin1String("setSource qthelp://org.freecad.usermanual/doc/") - << page << QLatin1Char('\n') << endl; + << page << QLatin1String("\n\n"); } } diff --git a/src/Gui/AutoSaver.cpp b/src/Gui/AutoSaver.cpp index 636f75ea2500..899de87ba1b1 100644 --- a/src/Gui/AutoSaver.cpp +++ b/src/Gui/AutoSaver.cpp @@ -149,12 +149,12 @@ void AutoSaver::saveDocument(const std::string& name, AutoSaveProperty& saver) if (file.open(QFile::WriteOnly)) { QTextStream str(&file); str.setCodec("UTF-8"); - str << "" << endl - << "" << endl; - str << " Created" << endl; - str << " " << endl; // store the document's current label - str << " " << QString::fromUtf8(doc->FileName.getValue()) << "" << endl; // store the document's current filename - str << "" << endl; + str << "\n" + << "\n"; + str << " Created\n"; + str << " \n"; // store the document's current label + str << " " << QString::fromUtf8(doc->FileName.getValue()) << "\n"; // store the document's current filename + str << "\n"; file.close(); } diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index 1fa52154d5c3..831ff1e3ca99 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -337,9 +337,9 @@ void StdCmdFreezeViews::onSaveViews() QTextStream str(&file); ActionGroup* pcAction = qobject_cast(_pcAction); QList acts = pcAction->actions(); - str << "" << endl - << "" << endl; - str << " " << endl; + str << "\n" + << "\n"; + str << " \n"; for (QList::ConstIterator it = acts.begin()+offset; it != acts.end(); ++it) { if ( !(*it)->isVisible() ) @@ -356,11 +356,11 @@ void StdCmdFreezeViews::onSaveViews() viewPos = lines.join(QString::fromLatin1(" ")); } - str << " " << endl; + str << " \n"; } - str << " " << endl; - str << "" << endl; + str << " \n"; + str << "\n"; } } diff --git a/src/Gui/DocumentRecovery.cpp b/src/Gui/DocumentRecovery.cpp index 8dbcaa66180d..446cef1070ed 100644 --- a/src/Gui/DocumentRecovery.cpp +++ b/src/Gui/DocumentRecovery.cpp @@ -362,28 +362,28 @@ void DocumentRecoveryPrivate::writeRecoveryInfo(const DocumentRecoveryPrivate::I if (file.open(QFile::WriteOnly)) { QTextStream str(&file); str.setCodec("UTF-8"); - str << "" << endl - << "" << endl; + str << "\n" + << "\n"; switch (info.status) { case Created: - str << " Created" << endl; + str << " Created\n"; break; case Overage: - str << " Deprecated" << endl; + str << " Deprecated\n"; break; case Success: - str << " Success" << endl; + str << " Success\n"; break; case Failure: - str << " Failure" << endl; + str << " Failure\n"; break; default: - str << " Unknown" << endl; + str << " Unknown\n"; break; } - str << " " << endl; - str << " " << info.fileName << "" << endl; - str << "" << endl; + str << " \n"; + str << " " << info.fileName << "\n"; + str << "\n"; file.close(); } } diff --git a/src/Gui/Splashscreen.cpp b/src/Gui/Splashscreen.cpp index fda58b346177..7d8addcb38dd 100644 --- a/src/Gui/Splashscreen.cpp +++ b/src/Gui/Splashscreen.cpp @@ -770,38 +770,38 @@ void AboutDialog::on_copyButton_clicked() } } - str << "OS: " << SystemInfo::getOperatingSystem() << deskInfo << endl; + str << "OS: " << SystemInfo::getOperatingSystem() << deskInfo << '\n'; int wordSize = SystemInfo::getWordSizeOfOS(); if (wordSize > 0) { - str << "Word size of OS: " << wordSize << "-bit" << endl; + str << "Word size of OS: " << wordSize << "-bit\n"; } - str << "Word size of " << exe << ": " << QSysInfo::WordSize << "-bit" << endl; + str << "Word size of " << exe << ": " << QSysInfo::WordSize << "-bit\n"; str << "Version: " << major << "." << minor << "." << build; char *appimage = getenv("APPIMAGE"); if (appimage) str << " AppImage"; - str << endl; + str << '\n'; #if defined(_DEBUG) || defined(DEBUG) - str << "Build type: Debug" << endl; + str << "Build type: Debug\n"; #elif defined(NDEBUG) - str << "Build type: Release" << endl; + str << "Build type: Release\n"; #elif defined(CMAKE_BUILD_TYPE) - str << "Build type: " << CMAKE_BUILD_TYPE << endl; + str << "Build type: " << CMAKE_BUILD_TYPE << '\n'; #else - str << "Build type: Unknown" << endl; + str << "Build type: Unknown\n"; #endif it = config.find("BuildRevisionBranch"); if (it != config.end()) - str << "Branch: " << QString::fromUtf8(it->second.c_str()) << endl; + str << "Branch: " << QString::fromUtf8(it->second.c_str()) << '\n'; it = config.find("BuildRevisionHash"); if (it != config.end()) - str << "Hash: " << it->second.c_str() << endl; + str << "Hash: " << it->second.c_str() << '\n'; // report also the version numbers of the most important libraries in FreeCAD - str << "Python version: " << PY_VERSION << endl; - str << "Qt version: " << QT_VERSION_STR << endl; - str << "Coin version: " << COIN_VERSION << endl; + str << "Python version: " << PY_VERSION << '\n'; + str << "Qt version: " << QT_VERSION_STR << '\n'; + str << "Coin version: " << COIN_VERSION << '\n'; #if defined(HAVE_OCC_VERSION) str << "OCC version: " << OCC_VERSION_MAJOR << "." @@ -810,12 +810,12 @@ void AboutDialog::on_copyButton_clicked() #ifdef OCC_VERSION_DEVELOPMENT << "." OCC_VERSION_DEVELOPMENT #endif - << endl; + << '\n'; #endif QLocale loc; str << "Locale: " << loc.languageToString(loc.language()) << "/" << loc.countryToString(loc.country()) - << " (" << loc.name() << ")" << endl; + << " (" << loc.name() << ")\n"; QClipboard* cb = QApplication::clipboard(); cb->setText(data);