Commit e589d4b7 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port endl to \n in qt5.15 endl is namespaced

parent 9f038395
......@@ -610,20 +610,21 @@ QString ResourceScheduler::dumpToString() const
{
QString ret;
QTextStream str(&ret);
str << "ResourceScheduler: " << (mOnline ? "Online" : "Offline") << endl;
str << " current task: " << mCurrentTask << endl;
str << "ResourceScheduler: " << (mOnline ? "Online" : "Offline") << '\n';
str << " current task: " << mCurrentTask << '\n';
for (int i = 0; i < NQueueCount; ++i) {
const TaskList &queue = mTaskList[i];
if (queue.isEmpty()) {
str << " queue " << i << " is empty" << endl;
str << " queue " << i << " is empty" << '\n';
} else {
str << " queue " << i << " " << queue.size() << " tasks:" << endl;
str << " queue " << i << " " << queue.size() << " tasks:\n";
const QList<Task>::const_iterator queueEnd(queue.constEnd());
for (QList<Task>::const_iterator it = queue.constBegin(); it != queueEnd; ++it) {
str << " " << (*it) << endl;
str << " " << (*it) << '\n';
}
}
}
str.flush();
return ret;
}
......
......@@ -134,10 +134,10 @@ void CachePolicy::setSyncOnDemand(bool enable)
QDebug operator<<(QDebug d, const CachePolicy &c)
{
return d << "CachePolicy: " << endl
<< " inherit:" << c.inheritFromParent() << endl
<< " interval:" << c.intervalCheckTime() << endl
<< " timeout:" << c.cacheTimeout() << endl
<< " sync on demand:" << c.syncOnDemand() << endl
return d << "CachePolicy: \n"
<< " inherit:" << c.inheritFromParent() << '\n'
<< " interval:" << c.intervalCheckTime() << '\n'
<< " timeout:" << c.cacheTimeout() << '\n'
<< " sync on demand:" << c.syncOnDemand() << '\n'
<< " local parts:" << c.localParts();
}
......@@ -329,15 +329,15 @@ void Collection::setResource(const QString &resource)
QDebug operator <<(QDebug d, const Akonadi::Collection &collection)
{
return d << "Collection ID:" << collection.id()
<< " remote ID:" << collection.remoteId() << endl
<< " name:" << collection.name() << endl
<< " url:" << collection.url() << endl
<< " parent:" << collection.parentCollection().id() << collection.parentCollection().remoteId() << endl
<< " resource:" << collection.resource() << endl
<< " rights:" << collection.rights() << endl
<< " contents mime type:" << collection.contentMimeTypes() << endl
<< " isVirtual:" << collection.isVirtual() << endl
<< " " << collection.cachePolicy() << endl
<< " remote ID:" << collection.remoteId() << '\n'
<< " name:" << collection.name() << '\n'
<< " url:" << collection.url() << '\n'
<< " parent:" << collection.parentCollection().id() << collection.parentCollection().remoteId() << '\n'
<< " resource:" << collection.resource() << '\n'
<< " rights:" << collection.rights() << '\n'
<< " contents mime type:" << collection.contentMimeTypes() << '\n'
<< " isVirtual:" << collection.isVirtual() << '\n'
<< " " << collection.cachePolicy() << '\n'
<< " " << collection.statistics();
}
......
......@@ -100,8 +100,8 @@ CollectionStatistics &CollectionStatistics::operator =(const CollectionStatistic
QDebug operator<<(QDebug d, const CollectionStatistics &s)
{
return d << "CollectionStatistics:" << endl
<< " count:" << s.count() << endl
<< " unread count:" << s.unreadCount() << endl
return d << "CollectionStatistics:\n"
<< " count:" << s.count() << '\n'
<< " unread count:" << s.unreadCount() << '\n'
<< " size:" << s.size();
}
......@@ -200,7 +200,7 @@ Item ItemSerializer::convert(const Item &item, int mtid)
int version = 0;
serialize(item, Item::FullPayload, buffer, version);
buffer.seek(0);
qCDebug(AKONADICORE_LOG) << " -> serialized payload into" << buffer.size() << "bytes" << endl
qCDebug(AKONADICORE_LOG) << " -> serialized payload into" << buffer.size() << "bytes\n"
<< " -> going to deserialize";
Item newItem;
if (plugin->deserialize(newItem, Item::FullPayload, buffer, version)) {
......
......@@ -123,7 +123,7 @@ void CollectionModelPrivate::collectionStatisticsChanged(Collection::Id collecti
void CollectionModelPrivate::listDone(KJob *job)
{
if (job->error()) {
qCWarning(AKONADICORE_LOG) << "Job error: " << job->errorString() << endl;
qCWarning(AKONADICORE_LOG) << "Job error: " << job->errorString();
}
}
......
......@@ -1347,7 +1347,7 @@ void EntityTreeModelPrivate::collectionFetchJobDone(KJob *job)
m_pendingCollectionFetchJobs.remove(job);
CollectionFetchJob *cJob = static_cast<CollectionFetchJob *>(job);
if (job->error()) {
qCWarning(AKONADICORE_LOG) << "Job error: " << job->errorString() << "for collection:" << cJob->collections() << endl;
qCWarning(AKONADICORE_LOG) << "Job error: " << job->errorString() << "for collection:" << cJob->collections();
return;
}
......@@ -1369,7 +1369,7 @@ void EntityTreeModelPrivate::itemFetchJobDone(KJob *job)
m_pendingCollectionRetrieveJobs.remove(collectionId);
if (job->error()) {
qCWarning(AKONADICORE_LOG) << "Job error: " << job->errorString() << "for collection:" << collectionId << endl;
qCWarning(AKONADICORE_LOG) << "Job error: " << job->errorString() << "for collection:" << collectionId;
return;
}
if (!m_collections.contains(collectionId)) {
......
......@@ -73,7 +73,7 @@ QStringList PluginLoader::names() const
QObject *PluginLoader::createForName(const QString &name)
{
if (!mPluginInfos.contains(name)) {
qCWarning(AKONADICORE_LOG) << "plugin name \"" << name << "\" is unknown to the plugin loader." << endl;
qCWarning(AKONADICORE_LOG) << "plugin name \"" << name << "\" is unknown to the plugin loader.";
return nullptr;
}
......@@ -153,19 +153,19 @@ void PluginLoader::scan()
QString name = group2.readEntry("Name");
if (name.isEmpty()) {
qCWarning(AKONADICORE_LOG) << "missing or empty [Misc]Name value in \"" << entry << "\" - inserting default name" << endl;
qCWarning(AKONADICORE_LOG) << "missing or empty [Misc]Name value in \"" << entry << "\" - inserting default name";
name = i18n("Unnamed plugin");
}
QString comment = group2.readEntry("Comment");
if (comment.isEmpty()) {
qCWarning(AKONADICORE_LOG) << "missing or empty [Misc]Comment value in \"" << entry << "\" - inserting default name" << endl;
qCWarning(AKONADICORE_LOG) << "missing or empty [Misc]Comment value in \"" << entry << "\" - inserting default name";
comment = i18n("No description available");
}
QString cname = group.readEntry("X-KDE-ClassName");
if (cname.isEmpty()) {
qCWarning(AKONADICORE_LOG) << "missing or empty X-KDE-ClassName value in \"" << entry << "\"" << endl;
qCWarning(AKONADICORE_LOG) << "missing or empty X-KDE-ClassName value in \"" << entry << "\"";
}
const QStringList mimeTypes = type.split(QLatin1Char(','), QString::SkipEmptyParts);
......@@ -178,7 +178,7 @@ void PluginLoader::scan()
}
} else {
qCWarning(AKONADICORE_LOG) << "Desktop file \"" << entry << "\" doesn't seem to describe a plugin " << "(misses Misc and/or Plugin group)" << endl;
qCWarning(AKONADICORE_LOG) << "Desktop file \"" << entry << "\" doesn't seem to describe a plugin " << "(misses Misc and/or Plugin group)";
}
}
}
......
......@@ -76,7 +76,7 @@ public:
QObject *object = PluginLoader::self()->createForName(mIdentifier);
if (!object) {
qCWarning(AKONADICORE_LOG) << "ItemSerializerPluginLoader: "
<< "plugin" << mIdentifier << "is not valid!" << endl;
<< "plugin" << mIdentifier << "is not valid!";
// we try to use the default in that case
mPlugin = s_defaultItemSerializerPlugin;
......@@ -86,7 +86,7 @@ public:
if (!qobject_cast<ItemSerializerPlugin *>(mPlugin)) {
qCWarning(AKONADICORE_LOG) << "ItemSerializerPluginLoader: "
<< "plugin" << mIdentifier
<< "doesn't provide interface ItemSerializerPlugin!" << endl;
<< "doesn't provide interface ItemSerializerPlugin!";
// we try to use the default in that case
mPlugin = s_defaultItemSerializerPlugin;
......@@ -226,12 +226,12 @@ public:
{
const PluginLoader *pl = PluginLoader::self();
if (!pl) {
qCWarning(AKONADICORE_LOG) << "Cannot instantiate plugin loader!" << endl;
qCWarning(AKONADICORE_LOG) << "Cannot instantiate plugin loader!";
return;
}
const QStringList names = pl->names();
qCDebug(AKONADICORE_LOG) << "ItemSerializerPluginLoader: "
<< "found" << names.size() << "plugins." << endl;
<< "found" << names.size() << "plugins.";
QMap<QString, MimeTypeEntry> map;
QRegExp rx(QStringLiteral("(.+)@(.+)"));
QMimeDatabase mimeDb;
......@@ -249,7 +249,7 @@ public:
}
} else {
qCDebug(AKONADICORE_LOG) << "ItemSerializerPluginLoader: "
<< "name" << name << "doesn't look like mimetype@classtype" << endl;
<< "name" << name << "doesn't look like mimetype@classtype";
}
}
const QString APPLICATION_OCTETSTREAM = QLatin1String(_APPLICATION_OCTETSTREAM);
......
......@@ -553,12 +553,12 @@ QString SelfTestDialog::createReport()
{
QString result;
QTextStream s(&result);
s << "Akonadi Server Self-Test Report" << endl;
s << "===============================" << endl;
s << "Akonadi Server Self-Test Report";
s << "===============================";
for (int i = 0; i < mTestModel->rowCount(); ++i) {
QStandardItem *item = mTestModel->item(i);
s << endl;
s << '\n';
s << "Test " << (i + 1) << ": ";
switch (item->data(ResultTypeRole).toInt()) {
case Skip:
......@@ -575,46 +575,46 @@ QString SelfTestDialog::createReport()
s << "ERROR";
break;
}
s << endl << "--------" << endl;
s << endl;
s << item->data(SummaryRole).toString() << endl;
s << "Details: " << item->data(DetailsRole).toString() << endl;
s << "\n--------\n";
s << '\n';
s << item->data(SummaryRole).toString() << '\n';
s << "Details: " << item->data(DetailsRole).toString() << '\n';
if (item->data(FileIncludeRole).isValid()) {
s << endl;
s << '\n';
const QString fileName = item->data(FileIncludeRole).toString();
QFile f(fileName);
if (f.open(QFile::ReadOnly)) {
s << "File content of '" << fileName << "':" << endl;
s << f.readAll() << endl;
s << "File content of '" << fileName << "':" << '\n';
s << f.readAll() << '\n';
} else {
s << "File '" << fileName << "' could not be opened" << endl;
s << "File '" << fileName << "' could not be opened\n";
}
}
if (item->data(ListDirectoryRole).isValid()) {
s << endl;
s << '\n';
const QStringList pathList = item->data(ListDirectoryRole).toStringList();
if (pathList.isEmpty()) {
s << "Directory list is empty." << endl;
s << "Directory list is empty.\n";
}
for (const QString &path : pathList) {
s << "Directory listing of '" << path << "':" << endl;
s << "Directory listing of '" << path << "':\n";
QDir dir(path);
dir.setFilter(QDir::AllEntries | QDir::NoDotAndDotDot);
const QStringList listEntries(dir.entryList());
for (const QString &entry : listEntries) {
s << entry << endl;
s << entry << '\n';
}
}
}
if (item->data(EnvVarRole).isValid()) {
s << endl;
s << '\n';
const QByteArray envVarName = item->data(EnvVarRole).toByteArray();
const QByteArray envVarValue = qgetenv(envVarName.constData());
s << "Environment variable " << envVarName << " is set to '" << envVarValue << "'" << endl;
s << "Environment variable " << envVarName << " is set to '" << envVarValue << "'\n";
}
}
s << endl;
s << '\n';
s.flush();
return result;
}
......
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