Commit 3e309b4a authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Port from endl to Qt::endl

parent 0a4f013d
......@@ -201,7 +201,7 @@ void SchemeEditorDialog::saveScheme(bool overwrite)
setUnsavedChanges(false);
QTextStream out(stdout);
out << filename << endl;
out << filename << Qt::endl;
} else if (!canWrite && file.exists()) {
KMessageBox::error(this, i18n("You do not have permission to overwrite that scheme"), i18n("Error"));
}
......
......@@ -72,7 +72,7 @@ int main(int argc, char **argv)
if (exitCode == 0) {
if (settings->colorScheme() == requestedScheme) {
ts << i18n("The requested theme \"%1\" is already set as the theme for the current Plasma session.", requestedScheme) << endl;
ts << i18n("The requested theme \"%1\" is already set as the theme for the current Plasma session.", requestedScheme) << Qt::endl;
// Not an error condition, no reason to set the theme, but basically this is fine
} else if (!requestedScheme.isEmpty()) {
int newSchemeIndex{-1};
......@@ -92,28 +92,32 @@ int main(int argc, char **argv)
settings->setColorScheme(requestedScheme);
applyScheme(settings, model);
settings->save();
ts << i18n("Successfully applied the color scheme %1 to your current Plasma session", requestedScheme) << endl;
ts << i18n("Successfully applied the color scheme %1 to your current Plasma session", requestedScheme) << Qt::endl;
} else {
ts << i18n("Could not find theme \"%1\". The theme should be one of the following options: %2", requestedScheme, availableThemes.join(QLatin1String{", "})) << endl;
ts << i18n("Could not find theme \"%1\". The theme should be one of the following options: %2",
requestedScheme,
availableThemes.join(QLatin1String{", "}))
<< Qt::endl;
}
} else {
// This shouldn't happen, but let's catch it and make angry noises, just in case...
ts << i18n("You have managed to pass an empty color scheme name, which isn't supported behavior.") << endl;
ts << i18n("You have managed to pass an empty color scheme name, which isn't supported behavior.") << Qt::endl;
exitCode = -1;
}
} else {
ts << i18n("The file you attempted to set as your scheme, %1, could not be identified as a color scheme.", parser->positionalArguments().first()) << endl;
ts << i18n("The file you attempted to set as your scheme, %1, could not be identified as a color scheme.", parser->positionalArguments().first())
<< Qt::endl;
exitCode = -1;
}
} else if (parser->isSet(QStringLiteral("list-schemes"))) {
ts << i18n("You have the following color schemes on your system:") << endl;
ts << i18n("You have the following color schemes on your system:") << Qt::endl;
int currentThemeIndex = model->selectedSchemeIndex();
for (int i = 0 ; i < model->rowCount(QModelIndex()); ++i) {
const QString schemeName = model->data(model->index(i, 0), ColorsModel::SchemeNameRole).toString();
if (i == currentThemeIndex) {
ts << i18n(" * %1 (current color scheme)", schemeName) << endl;
ts << i18n(" * %1 (current color scheme)", schemeName) << Qt::endl;
} else {
ts << QString(" * %1").arg(schemeName) << endl;
ts << QString(" * %1").arg(schemeName) << Qt::endl;
}
}
} else {
......
......@@ -54,7 +54,7 @@ int main(int argc, char **argv)
requestedTheme = requestedTheme.split(dirSplit, Qt::SkipEmptyParts).last();
}
if (Plasma::Theme().themeName() == requestedTheme) {
ts << i18n("The requested theme \"%1\" is already set as the theme for the current Plasma session.", requestedTheme) << endl;
ts << i18n("The requested theme \"%1\" is already set as the theme for the current Plasma session.", requestedTheme) << Qt::endl;
// Not an error condition really, let's just ignore that
} else {
bool found{false};
......@@ -70,21 +70,24 @@ int main(int argc, char **argv)
availableThemes << currentTheme;
}
if (found) {
ts << i18n("The current Plasma session's theme has been set to %1", requestedTheme) << endl;
ts << i18n("The current Plasma session's theme has been set to %1", requestedTheme) << Qt::endl;
} else {
ts << i18n("Could not find theme \"%1\". The theme should be one of the following options: %2", requestedTheme, availableThemes.join(QLatin1String{", "})) << endl;
ts << i18n("Could not find theme \"%1\". The theme should be one of the following options: %2",
requestedTheme,
availableThemes.join(QLatin1String{", "}))
<< Qt::endl;
errorCode = -1;
}
}
} else if (parser->isSet(QStringLiteral("list-themes"))) {
ts << i18n("You have the following Plasma themes on your system:") << endl;
ts << i18n("You have the following Plasma themes on your system:") << Qt::endl;
model->load();
for (int i = 0 ; i < model->rowCount(); ++i) {
QString themeName{model->data(model->index(i), ThemesModel::PluginNameRole).toString()};
if (Plasma::Theme().themeName() == themeName) {
ts << QString(" * %1 (current theme for this Plasma session)").arg(themeName) << endl;
ts << QString(" * %1 (current theme for this Plasma session)").arg(themeName) << Qt::endl;
} else {
ts << QString(" * %1").arg(themeName) << endl;
ts << QString(" * %1").arg(themeName) << Qt::endl;
}
}
} else {
......
......@@ -72,10 +72,10 @@ void Family::toXml(bool disabled, QTextStream &s) const
QStringList::ConstIterator it(entries.begin()), end(entries.end());
for (; it != end; ++it)
s << *it << endl;
s << *it << Qt::endl;
if (!disabled)
s << " </" FAMILY_TAG ">" << endl;
s << " </" FAMILY_TAG ">" << Qt::endl;
}
}
......
......@@ -493,14 +493,14 @@ void KSMServer::startKilling()
SmsDie(c->connection());
}
qCDebug(KSMSERVER) << " We killed all clients. We have now clients.count()=" << clients.count() << endl;
qCDebug(KSMSERVER) << " We killed all clients. We have now clients.count()=" << clients.count() << Qt::endl;
completeKilling();
QTimer::singleShot(10000, this, &KSMServer::timeoutQuit);
}
void KSMServer::completeKilling()
{
qCDebug(KSMSERVER) << "KSMServer::completeKilling clients.count()=" << clients.count() << endl;
qCDebug(KSMSERVER) << "KSMServer::completeKilling clients.count()=" << clients.count() << Qt::endl;
if (state == Killing) {
if (!clients.isEmpty()) // still waiting for clients to go away
return;
......@@ -565,14 +565,14 @@ void KSMServer::startKillingSubSession()
SmsDie(c->connection());
}
qCDebug(KSMSERVER) << " We killed some clients. We have now clients.count()=" << clients.count() << endl;
qCDebug(KSMSERVER) << " We killed some clients. We have now clients.count()=" << clients.count() << Qt::endl;
completeKillingSubSession();
QTimer::singleShot(10000, this, &KSMServer::signalSubSessionClosed);
}
void KSMServer::completeKillingSubSession()
{
qCDebug(KSMSERVER) << "KSMServer::completeKillingSubSession clients.count()=" << clients.count() << endl;
qCDebug(KSMSERVER) << "KSMServer::completeKillingSubSession clients.count()=" << clients.count() << Qt::endl;
if (state == KillingSubSession) {
if (!clientsToKill.isEmpty()) {
return; // still waiting for clients to go away
......
......@@ -123,7 +123,7 @@ void SolidUiServer::onPassphraseDialogCompleted(const QString &pass, bool keep)
if (!reply.isValid()) {
qWarning() << "Impossible to send the passphrase to the application, D-Bus said: " << reply.error().name() << ", " << reply.error().message()
<< endl;
<< Qt::endl;
return; // don't save into wallet if an error occurs
}
......
......@@ -52,7 +52,11 @@ int main(int argc, char **argv)
if (wallpaperFile.contains(QStringLiteral("\'"))) {
// If this happens, we might very well assume that there is some kind of funny business going on
// even if technically it could just be a possessive. But, security first, so...
ts << i18n("There is a stray single quote in the filename of this wallpaper (') - please contact the author of the wallpaper to fix this, or rename the file yourself: %1", wallpaperFile) << endl;
ts << i18n(
"There is a stray single quote in the filename of this wallpaper (') - please contact the author of the wallpaper to fix this, or rename the "
"file yourself: %1",
wallpaperFile)
<< Qt::endl;
errorCode = -1;
} else {
if (wallpaperInfo.exists()) {
......@@ -87,19 +91,19 @@ int main(int argc, char **argv)
auto reply = QDBusConnection::sessionBus().call(message);
if (reply.type() == QDBusMessage::ErrorMessage) {
ts << i18n("An error occurred while attempting to set the Plasma wallpaper:\n") << reply.errorMessage() << endl;
ts << i18n("An error occurred while attempting to set the Plasma wallpaper:\n") << reply.errorMessage() << Qt::endl;
errorCode = -1;
} else {
if (isKPackage) {
ts << i18n("Successfully set the wallpaper for all desktops to the KPackage based %1", wallpaperFile) << endl;
ts << i18n("Successfully set the wallpaper for all desktops to the KPackage based %1", wallpaperFile) << Qt::endl;
} else {
ts << i18n("Successfully set the wallpaper for all desktops to the image %1", wallpaperFile) << endl;
ts << i18n("Successfully set the wallpaper for all desktops to the image %1", wallpaperFile) << Qt::endl;
}
}
} else if (errorCode == 0) {
// Just to avoid spitting out multiple errors
ts << i18n("The file passed to be set as wallpaper does not exist, or we cannot identify it as a wallpaper: %1", wallpaperFile) << endl;
ts << i18n("The file passed to be set as wallpaper does not exist, or we cannot identify it as a wallpaper: %1", wallpaperFile) << Qt::endl;
errorCode = -1;
}
} else {
......
Supports Markdown
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