Commit cc8484d9 authored by Davide Gianforte's avatar Davide Gianforte

replace deprecated endl

parent 3bb130bf
......@@ -122,7 +122,7 @@ extern "C"
int Q_DECL_EXPORT kdemain(int argc, char **argv) {
if (argc != 4) {
qWarning() << "Usage: kio_krarc protocol domain-socket1 domain-socket2" << endl;
qWarning() << "Usage: kio_krarc protocol domain-socket1 domain-socket2" << QT_ENDL;
exit(-1);
}
......
......@@ -28,6 +28,20 @@
#define UDS_ENTRY_INSERT(A, B) UDSEntry::insert((A), (B));
#endif
/**
* QTextSteam::endl() was made obsoleted in QT 5.15 in
* favor of the namespaced Qt::endl
*
* https://doc.qt.io/qt-5.15/qtextstream-obsolete.html#endl
*
* This can be removed when the qt minimum version required will be >= 5.15
*/
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
#define QT_ENDL Qt::endl
#else
#define QT_ENDL endl
#endif
/**
* QComboBox::activated(const QString &text) was made obsoleted in QT 5.15 in
* favor of QComboBox::textActivated(const QString &text)
......
......@@ -20,6 +20,7 @@
*****************************************************************************/
#include "krdebuglogger.h"
#include "compat.h"
int KrDebugLogger::indentation = 1;
const int KrDebugLogger::indentationIncrease = 3;
......@@ -31,7 +32,7 @@ KrDebugLogger::KrDebugLogger(const QString &argFunction, int line) : function(ar
QTextStream stream;
prepareWriting(file, stream);
stream << QString("┏"); // Indicates that a function has been started
stream << function << "(" << line << ")" << endl;
stream << function << "(" << line << ")" << QT_ENDL;
indentation += indentationIncrease;
}
......@@ -42,7 +43,7 @@ KrDebugLogger::~KrDebugLogger()
QTextStream stream;
prepareWriting(file, stream);
stream << QString("┗"); // Indicates that a function is going to finish
stream << function << endl;
stream << function << QT_ENDL;
}
//! Prepares some elements before a writing into the krarc debug log file
......
......@@ -29,6 +29,7 @@
#include <QTextStream>
#include <unistd.h>
#include "compat.h"
//! A class to manage some aspects of the writing of messages into the Krusader debug log file
class KrDebugLogger
......@@ -58,7 +59,7 @@ public:
QTextStream stream; \
KrDebugLogger::prepareWriting(file, stream); \
stream << __FUNCTION__ << "(" <<__LINE__<< "): "; \
stream << X << endl; \
stream << X << QT_ENDL; \
} while(0);
#else
#define KRFUNC
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment