diff --git a/autotests/src/kateview_test.cpp b/autotests/src/kateview_test.cpp --- a/autotests/src/kateview_test.cpp +++ b/autotests/src/kateview_test.cpp @@ -114,7 +114,11 @@ for (int i = 0; i < 200; ++i) { stream << line; } +#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0)) stream << flush; +#else + stream << Qt::flush; +#endif file.close(); KTextEditor::DocumentPrivate doc; @@ -194,7 +198,11 @@ stream << "A\n" << "B\n" << "C"; +#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0)) stream << flush; +#else + stream << Qt::flush; +#endif file.close(); KTextEditor::DocumentPrivate doc; diff --git a/autotests/src/katewildcardmatcher_test.cpp b/autotests/src/katewildcardmatcher_test.cpp --- a/autotests/src/katewildcardmatcher_test.cpp +++ b/autotests/src/katewildcardmatcher_test.cpp @@ -55,6 +55,6 @@ Q_ASSERT(testCase("aXXbXXbYYaYc", "a*b*c")); - qDebug() << endl << "DONE"; + qDebug() << "\nDONE"; return 0; } diff --git a/autotests/src/script_test_base.cpp b/autotests/src/script_test_base.cpp --- a/autotests/src/script_test_base.cpp +++ b/autotests/src/script_test_base.cpp @@ -38,8 +38,9 @@ #include #include -#include "testutils.h" +#include +#include "testutils.h" #include "script_test_base.h" const QString testDataPath(QLatin1String(TEST_DATA_DIR)); @@ -157,7 +158,7 @@ } if (diff.exitCode() != EXIT_SUCCESS) { - QTextStream(stdout) << out << endl; + std::cout << qPrintable(out) << std::endl; } for (const Failure &failure : failures) { diff --git a/src/export/htmlexporter.cpp b/src/export/htmlexporter.cpp --- a/src/export/htmlexporter.cpp +++ b/src/export/htmlexporter.cpp @@ -33,42 +33,44 @@ { if (m_encapsulate) { // let's write the HTML header : - m_output << "" << endl; - m_output << "" << endl; - m_output << "" << endl; - m_output << "" << endl; - m_output << "" << endl; - m_output << "" << endl; + m_output << "\n"; + m_output << "\n"; + m_output << "\n"; + m_output << "\n"; + m_output << "\n"; + m_output << "\n"; // for the title, we write the name of the file (/usr/local/emmanuel/myfile.cpp -> myfile.cpp) - m_output << "" << view->document()->documentName() << "" << endl; - m_output << "" << endl; + m_output << "" << view->document()->documentName() << "\n"; + m_output << "\n"; // tell in comment which highlighting was used! - m_output << "" << endl; + m_output << "\n"; - m_output << "" << endl; + m_output << "\n"; } if (!m_defaultAttribute) { - m_output << "
" << endl;
+        m_output << "
\n";
     } else {
         m_output << QStringLiteral("
")
                         .arg(m_defaultAttribute->fontBold() ? QStringLiteral("font-weight:bold;") : QString())
                         .arg(m_defaultAttribute->fontItalic() ? QStringLiteral("font-style:italic;") : QString())
                         .arg(QLatin1String("color:") + m_defaultAttribute->foreground().color().name() + QLatin1Char(';'))
                         .arg(QLatin1String("background-color:") + m_defaultAttribute->background().color().name() + QLatin1Char(';'))
-                 << endl;
+                 << '\n';
     }
+    m_output.flush();
 }
 
 HTMLExporter::~HTMLExporter()
 {
-    m_output << "
" << endl; + m_output << "
\n"; if (m_encapsulate) { - m_output << "" << endl; - m_output << "" << endl; + m_output << "\n"; + m_output << "\n"; } + m_output.flush(); } void HTMLExporter::openLine() @@ -80,6 +82,7 @@ if (!lastLine) { // we are inside a
, so a \n is a new line
         m_output << "\n";
+        m_output.flush();
     }
 }
 
@@ -117,4 +120,5 @@
     if (attrib->fontBold()) {
         m_output << "";
     }
+    m_output.flush();
 }