Commit 791fb706 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

GIT_SILENT: ignore some files

parent 065e0845
......@@ -97,7 +97,7 @@ void ClipboardMenu::setupMenu(QAction *action)
a->setData(s);
if (m_secondsIncluded) {
s = time.toString(Qt::SystemLocaleLongDate);
s.replace(rx, QString());
s.remove(rx);
a = menu->addAction(s);
a->setData(s);
s = time.toString(Qt::SystemLocaleLongDate);
......
......@@ -181,7 +181,7 @@ void IconApplet::populate()
}
// KFileItem might return "." as text for e.g. root folders
if (name == QLatin1String(".")) {
if (name == QLatin1Char('.')) {
name.clear();
}
......
......@@ -252,7 +252,7 @@ QHash<int, QByteArray> PlasmaAppletItemModel::roleNames() const
void PlasmaAppletItemModel::populateModel(const QStringList &whatChanged)
{
if (!whatChanged.isEmpty() && !whatChanged.contains(QStringLiteral("services"))) {
if (!whatChanged.isEmpty() && !whatChanged.contains(QLatin1String("services"))) {
return;
}
......
......@@ -40,7 +40,7 @@ void AppsEngine::init()
void AppsEngine::sycocaChanged(const QStringList &changes)
{
if (changes.contains(QStringLiteral("apps")) || changes.contains(QStringLiteral("xdgdata-apps"))) {
if (changes.contains(QLatin1String("apps")) || changes.contains(QLatin1String("xdgdata-apps"))) {
removeAllSources();
addGroup(KServiceGroup::root());
}
......
......@@ -248,18 +248,18 @@ void PlayerContainer::copyProperty(const QString& propName, const QVariant& _val
} else if (propName == QLatin1String("Rate") &&
data().value(QStringLiteral("PlaybackStatus")).toString() == QLatin1String("Playing")) {
if (data().contains(QStringLiteral("Position")))
if (data().contains(QLatin1String("Position")))
recalculatePosition();
m_currentRate = value.toDouble();
} else if (propName == QLatin1String("PlaybackStatus")) {
if (data().contains(QStringLiteral("Position")) && data().contains(QStringLiteral("PlaybackStatus"))) {
if (data().contains(QLatin1String("Position")) && data().contains(QLatin1String("PlaybackStatus"))) {
updatePosition();
}
// update the effective rate
if (data().contains(QStringLiteral("Rate"))) {
if (data().contains(QLatin1String("Rate"))) {
if (value.toString() == QLatin1String("Playing"))
m_currentRate = data().value(QStringLiteral("Rate")).toDouble();
else
......
......@@ -42,7 +42,7 @@ void PackagekitEngine::init()
if (reply.type() == QDBusMessage::ReplyMessage
&& reply.arguments().size() == 1) {
QStringList list = reply.arguments().first().toStringList();
if (list.contains(QStringLiteral("org.freedesktop.PackageKit"))) {
if (list.contains(QLatin1String("org.freedesktop.PackageKit"))) {
m_pk_available = true;
}
}
......
......@@ -305,7 +305,7 @@ bool PowermanagementEngine::sourceRequestEvent(const QString &name)
watcher->deleteLater();
});
} else if (name == QLatin1Literal("Inhibitions")) {
} else if (name == QLatin1String("Inhibitions")) {
QDBusMessage inhibitionsMsg = QDBusMessage::createMethodCall(SOLID_POWERMANAGEMENT_SERVICE,
QStringLiteral("/org/kde/Solid/PowerManagement/PolicyAgent"),
QStringLiteral("org.kde.Solid.PowerManagement.PolicyAgent"),
......
......@@ -533,7 +533,7 @@ void SolidDeviceEngine::setIdleState(Solid::ErrorType error, QVariant errorData,
void SolidDeviceEngine::deviceChanged(const QMap<QString, int> &props)
{
Solid::GenericInterface * iface = qobject_cast<Solid::GenericInterface *>(sender());
if (iface && iface->isValid() && props.contains(QStringLiteral("Size")) && iface->property(QStringLiteral("Size")).toInt() > 0) {
if (iface && iface->isValid() && props.contains(QLatin1String("Size")) && iface->property(QStringLiteral("Size")).toInt() > 0) {
const QString udi = qobject_cast<QObject *>(iface)->property("udi").toString();
if (populateDeviceData(udi))
forceImmediateUpdateOfAllVisualizations();
......
......@@ -273,7 +273,7 @@ bool UKMETIon::updateIonSource(const QString& source)
return true;
}
XMLMapInfo& place = m_place[QStringLiteral("bbcukmet|") + sourceAction[2]];
XMLMapInfo& place = m_place[QLatin1String("bbcukmet|") + sourceAction[2]];
// backward compatibility after rss feed url change in 2018/03
place.sourceExtraArg = sourceAction[3];
......@@ -375,11 +375,11 @@ void UKMETIon::readSearchHTMLData(const QString& source, const QByteArray& html)
const QString fullName = result.value(QStringLiteral("fullName")).toString();
if (!id.isEmpty() && !fullName.isEmpty()) {
QString tmp = QStringLiteral("bbcukmet|") + fullName;
QString tmp = QLatin1String("bbcukmet|") + fullName;
// Duplicate places can exist
if (m_locations.contains(tmp)) {
tmp += QStringLiteral(" (#") + QString::number(counter) + QLatin1Char(')');
tmp += QLatin1String(" (#") + QString::number(counter) + QLatin1Char(')');
counter++;
}
XMLMapInfo& place = m_place[tmp];
......@@ -430,7 +430,7 @@ void UKMETIon::setup_slotJobFinished(KJob *job)
}
// If Redirected, don't go to this routine
if (!m_locations.contains(QStringLiteral("bbcukmet|") + m_jobList[job])) {
if (!m_locations.contains(QLatin1String("bbcukmet|") + m_jobList[job])) {
QByteArray *reader = m_jobHtml.value(job);
if (reader) {
readSearchHTMLData(m_jobList[job], *reader);
......@@ -671,7 +671,7 @@ void UKMETIon::parseWeatherObservation(const QString& source, WeatherData& data,
parseFloat(data.temperature_C, temperature_C);
data.windDirection = observeData[2].section(QLatin1Char(','), 0, 0).trimmed();
if (data.windDirection.contains(QStringLiteral("null"))) {
if (data.windDirection.contains(QLatin1String("null"))) {
data.windDirection.clear();
}
......@@ -925,7 +925,7 @@ void UKMETIon::updateWeather(const QString& source)
// work-around for buggy observation RSS feed missing the station name
QString stationName = weatherData.stationName;
if (stationName.isEmpty() || stationName == QLatin1String(",")) {
if (stationName.isEmpty() || stationName == QLatin1Char(',')) {
stationName = source.section(QLatin1Char('|'), 1, 1);
}
......
......@@ -317,7 +317,7 @@ void NOAAIon::parseStationID()
info.stationID = stationID;
info.XMLurl = xmlurl;
QString tmp = stationName + QStringLiteral(", ") + state; // Build the key name.
QString tmp = stationName + QLatin1String(", ") + state; // Build the key name.
m_places[tmp] = info;
}
break;
......@@ -677,83 +677,83 @@ IonInterface::ConditionIcons NOAAIon::getConditionIcon(const QString& weather, b
{
IonInterface::ConditionIcons result;
// Consider any type of storm, tornado or funnel to be a thunderstorm.
if (weather.contains(QStringLiteral("thunderstorm")) || weather.contains(QStringLiteral("funnel")) ||
weather.contains(QStringLiteral("tornado")) || weather.contains(QStringLiteral("storm")) || weather.contains(QStringLiteral("tstms"))) {
if (weather.contains(QLatin1String("thunderstorm")) || weather.contains(QLatin1String("funnel")) ||
weather.contains(QLatin1String("tornado")) || weather.contains(QLatin1String("storm")) || weather.contains(QLatin1String("tstms"))) {
if (weather.contains(QStringLiteral("vicinity")) || weather.contains(QStringLiteral("chance"))) {
if (weather.contains(QLatin1String("vicinity")) || weather.contains(QLatin1String("chance"))) {
result = isDayTime ? IonInterface::ChanceThunderstormDay : IonInterface::ChanceThunderstormNight;
} else {
result = IonInterface::Thunderstorm;
}
} else if (weather.contains(QStringLiteral("pellets")) || weather.contains(QStringLiteral("crystals")) ||
weather.contains(QStringLiteral("hail"))) {
} else if (weather.contains(QLatin1String("pellets")) || weather.contains(QLatin1String("crystals")) ||
weather.contains(QLatin1String("hail"))) {
result = IonInterface::Hail;
} else if (((weather.contains(QStringLiteral("rain")) || weather.contains(QStringLiteral("drizzle")) ||
weather.contains(QStringLiteral("showers"))) && weather.contains(QStringLiteral("snow"))) || weather.contains(QStringLiteral("wintry mix"))) {
} else if (((weather.contains(QLatin1String("rain")) || weather.contains(QLatin1String("drizzle")) ||
weather.contains(QLatin1String("showers"))) && weather.contains(QLatin1String("snow"))) || weather.contains(QLatin1String("wintry mix"))) {
result = IonInterface::RainSnow;
} else if (weather.contains(QStringLiteral("flurries"))) {
} else if (weather.contains(QLatin1String("flurries"))) {
result = IonInterface::Flurries;
} else if (weather.contains(QStringLiteral("snow")) && weather.contains(QStringLiteral("light"))) {
} else if (weather.contains(QLatin1String("snow")) && weather.contains(QLatin1String("light"))) {
result = IonInterface::LightSnow;
} else if (weather.contains(QStringLiteral("snow"))) {
if (weather.contains(QStringLiteral("vicinity")) || weather.contains(QStringLiteral("chance"))) {
} else if (weather.contains(QLatin1String("snow"))) {
if (weather.contains(QLatin1String("vicinity")) || weather.contains(QLatin1String("chance"))) {
result = isDayTime ? IonInterface::ChanceSnowDay : IonInterface::ChanceSnowNight;
} else {
result = IonInterface::Snow;
}
} else if (weather.contains(QStringLiteral("freezing rain"))) {
} else if (weather.contains(QLatin1String("freezing rain"))) {
result = IonInterface::FreezingRain;
} else if (weather.contains(QStringLiteral("freezing drizzle"))) {
} else if (weather.contains(QLatin1String("freezing drizzle"))) {
result = IonInterface::FreezingDrizzle;
} else if (weather.contains(QStringLiteral("cold"))) {
} else if (weather.contains(QLatin1String("cold"))) {
// temperature condition has not hint about air ingredients, so let's assume chance of snow
result = isDayTime ? IonInterface::ChanceSnowDay : IonInterface::ChanceSnowNight;
} else if (weather.contains(QStringLiteral("showers"))) {
} else if (weather.contains(QLatin1String("showers"))) {
if (weather.contains(QStringLiteral("vicinity")) || weather.contains(QStringLiteral("chance"))) {
if (weather.contains(QLatin1String("vicinity")) || weather.contains(QLatin1String("chance"))) {
result = isDayTime ? IonInterface::ChanceShowersDay : IonInterface::ChanceShowersNight;
} else {
result = IonInterface::Showers;
}
} else if (weather.contains(QStringLiteral("light rain")) || weather.contains(QStringLiteral("drizzle"))) {
} else if (weather.contains(QLatin1String("light rain")) || weather.contains(QLatin1String("drizzle"))) {
result = IonInterface::LightRain;
} else if (weather.contains(QStringLiteral("rain"))) {
} else if (weather.contains(QLatin1String("rain"))) {
result = IonInterface::Rain;
} else if (weather.contains(QStringLiteral("few clouds")) || weather.contains(QStringLiteral("mostly sunny")) ||
weather.contains(QStringLiteral("mostly clear")) || weather.contains(QStringLiteral("increasing clouds")) ||
weather.contains(QStringLiteral("becoming cloudy")) || weather.contains(QStringLiteral("clearing")) ||
weather.contains(QStringLiteral("decreasing clouds")) || weather.contains(QStringLiteral("becoming sunny"))) {
} else if (weather.contains(QLatin1String("few clouds")) || weather.contains(QLatin1String("mostly sunny")) ||
weather.contains(QLatin1String("mostly clear")) || weather.contains(QLatin1String("increasing clouds")) ||
weather.contains(QLatin1String("becoming cloudy")) || weather.contains(QLatin1String("clearing")) ||
weather.contains(QLatin1String("decreasing clouds")) || weather.contains(QLatin1String("becoming sunny"))) {
result = isDayTime ? IonInterface::FewCloudsDay : IonInterface::FewCloudsNight;
} else if (weather.contains(QStringLiteral("partly cloudy")) || weather.contains(QStringLiteral("partly sunny")) ||
weather.contains(QStringLiteral("partly clear"))) {
} else if (weather.contains(QLatin1String("partly cloudy")) || weather.contains(QLatin1String("partly sunny")) ||
weather.contains(QLatin1String("partly clear"))) {
result = isDayTime ? IonInterface::PartlyCloudyDay : IonInterface::PartlyCloudyNight;
} else if (weather.contains(QStringLiteral("overcast")) || weather.contains(QStringLiteral("cloudy"))) {
} else if (weather.contains(QLatin1String("overcast")) || weather.contains(QLatin1String("cloudy"))) {
result = IonInterface::Overcast;
} else if (weather.contains(QStringLiteral("haze")) || weather.contains(QStringLiteral("smoke")) ||
weather.contains(QStringLiteral("dust")) || weather.contains(QStringLiteral("sand"))) {
} else if (weather.contains(QLatin1String("haze")) || weather.contains(QLatin1String("smoke")) ||
weather.contains(QLatin1String("dust")) || weather.contains(QLatin1String("sand"))) {
result = IonInterface::Haze;
} else if (weather.contains(QStringLiteral("fair")) || weather.contains(QStringLiteral("clear")) || weather.contains(QStringLiteral("sunny"))) {
} else if (weather.contains(QLatin1String("fair")) || weather.contains(QLatin1String("clear")) || weather.contains(QLatin1String("sunny"))) {
result = isDayTime ? IonInterface::ClearDay : IonInterface::ClearNight;
} else if (weather.contains(QStringLiteral("fog"))) {
} else if (weather.contains(QLatin1String("fog"))) {
result = IonInterface::Mist;
} else if (weather.contains(QStringLiteral("hot"))) {
} else if (weather.contains(QLatin1String("hot"))) {
// temperature condition has not hint about air ingredients, so let's assume the sky is clear when it is hot
result = isDayTime ? IonInterface::ClearDay : IonInterface::ClearNight;
......
......@@ -629,7 +629,7 @@ void WetterComIon::parseWeatherForecast(const QString& source, QXmlStreamReader&
} else if (elementName == QLatin1String("tn")) {
tempMin = qRound(xml.readElementText().toDouble());
qCDebug(IONENGINE_WETTERCOM) << "parsed t_min:" << tempMin;
} else if (elementName == QLatin1String("w")) {
} else if (elementName == QLatin1Char('w')) {
int tmp = xml.readElementText().toInt();
if (!time.isEmpty())
......@@ -656,7 +656,7 @@ void WetterComIon::parseWeatherForecast(const QString& source, QXmlStreamReader&
} else if (elementName == QLatin1String("link")) {
weatherData.creditsUrl = xml.readElementText();
qCDebug(IONENGINE_WETTERCOM) << "parsed credits url:" << weatherData.creditsUrl;
} else if (elementName == QLatin1String("d")) {
} else if (elementName == QLatin1Char('d')) {
localTime = xml.readElementText().toInt();
qCDebug(IONENGINE_WETTERCOM) << "parsed local time:" << localTime;
} else if (elementName == QLatin1String("du")) {
......
......@@ -59,7 +59,7 @@ WeatherEngine::~WeatherEngine()
void WeatherEngine::updateIonList(const QStringList &changedResources)
{
if (changedResources.isEmpty() || changedResources.contains(QStringLiteral("services"))) {
if (changedResources.isEmpty() || changedResources.contains(QLatin1String("services"))) {
removeAllData(QStringLiteral("ions"));
const auto infos = Plasma::PluginLoader::self()->listEngineInfo(QStringLiteral("weatherengine"));
for (const KPluginInfo& info : infos) {
......
......@@ -224,7 +224,7 @@ QString Icons::actionIcon(const QString &actionName)
// now we can be sure we only have a single hyphen at the start or end, remove it if needed
if (action.startsWith(QLatin1Char('-'))) {
action = action.mid(1);
action.remove(0, 1);
}
if (action.endsWith(QLatin1Char('-'))) {
action.chop(1);
......@@ -252,7 +252,7 @@ QString Icons::actionIcon(const QString &actionName)
// LibreOffice's "Open" entry is always "OpenFromAppname" so we just chop that off
if (action.startsWith(QLatin1String("OpenFrom"))) {
action = action.left(4); // basically "Open"
action.truncate(4); // basically "Open"
}
icon = s_icons.value(action);
......
......@@ -564,11 +564,11 @@ QVariantMap Window::gMenuToDBusMenuProperties(const QVariantMap &source) const
result.insert(QStringLiteral("label"), source.value(QStringLiteral("label")).toString());
if (source.contains(QStringLiteral(":section"))) {
if (source.contains(QLatin1String(":section"))) {
result.insert(QStringLiteral("type"), QStringLiteral("separator"));
}
const bool isMenu = source.contains(QStringLiteral(":submenu"));
const bool isMenu = source.contains(QLatin1String(":submenu"));
if (isMenu) {
result.insert(QStringLiteral("children-display"), QStringLiteral("submenu"));
}
......
......@@ -100,7 +100,7 @@ void Translations::save()
m_configuredLanguages.removeOne(lang);
}
m_config.writeEntry(lcLanguage, m_configuredLanguages.join(QStringLiteral(":")), KConfig::Persistent);
m_config.writeEntry(lcLanguage, m_configuredLanguages.join(QLatin1Char(':')), KConfig::Persistent);
m_config.sync();
writeExports();
......
......@@ -91,7 +91,7 @@ QString TranslationsModel::languageCodeToName(const QString& languageCode) const
return languageCode;
}
if (languageCode.contains(QStringLiteral("@"))) {
if (languageCode.contains(QLatin1Char('@'))) {
return i18nc("%1 is language name, %2 is language code name", "%1 (%2)", languageName, languageCode);
}
......
......@@ -136,7 +136,7 @@ void DesktopProtocol::listDir(const QUrl &url)
QString DesktopProtocol::desktopFile(KIO::UDSEntry &entry) const
{
const QString name = entry.stringValue(KIO::UDSEntry::UDS_NAME);
if (name == QLatin1String(".") || name == QLatin1String(".."))
if (name == QLatin1Char('.') || name == QLatin1String(".."))
return QString();
QUrl url = processedUrl();
......@@ -174,7 +174,7 @@ void DesktopProtocol::prepareUDSEntry(KIO::UDSEntry &entry, bool listing) const
// Set a descriptive display name for the root item
if (requestedUrl().path() == QLatin1String("/")
&& entry.stringValue(KIO::UDSEntry::UDS_NAME) == QLatin1String(".")) {
&& entry.stringValue(KIO::UDSEntry::UDS_NAME) == QLatin1Char('.')) {
entry.replace(KIO::UDSEntry::UDS_DISPLAY_NAME, i18n("Desktop Folder"));
}
......
......@@ -93,15 +93,15 @@ private Q_SLOTS:
QCOMPARE(QFileInfo(localLink).symLinkTarget(), source);
// Now try changing the link target, without Overwrite -> error
linkJob = KIO::symlink(m_testFileName + "2", desktopLink, KIO::HideProgressInfo);
linkJob = KIO::symlink(m_testFileName + QLatin1Char('2'), desktopLink, KIO::HideProgressInfo);
QVERIFY(!linkJob->exec());
QCOMPARE(linkJob->error(), (int)KIO::ERR_FILE_ALREADY_EXIST);
// Now try changing the link target, with Overwrite (bug 360487)
linkJob = KIO::symlink(m_testFileName + "3", desktopLink, KIO::Overwrite | KIO::HideProgressInfo);
linkJob = KIO::symlink(m_testFileName + QLatin1Char('3'), desktopLink, KIO::Overwrite | KIO::HideProgressInfo);
QVERIFY(linkJob->exec());
QVERIFY(QFileInfo(localLink).isSymLink());
QCOMPARE(QFileInfo(localLink).symLinkTarget(), source + "3");
QCOMPARE(QFileInfo(localLink).symLinkTarget(), source + QLatin1Char('3'));
}
void testRename_data()
......
......@@ -253,7 +253,7 @@ void KSMServer::restoreLegacySession( KConfig* config )
if( config->hasGroup( QStringLiteral( "Legacy" ) + sessionGroup )) {
KConfigGroup group( config, QStringLiteral( "Legacy" ) + sessionGroup );
restoreLegacySessionInternal( &group );
} else if( wm == QStringLiteral( "kwin" ) ) { // backwards comp. - get it from kwinrc
} else if( wm == QLatin1String( "kwin" ) ) { // backwards comp. - get it from kwinrc
KConfigGroup group( config, sessionGroup );
int count = group.readEntry( "count", 0 );
for ( int i = 1; i <= count; i++ ) {
......@@ -265,7 +265,7 @@ void KSMServer::restoreLegacySession( KConfig* config )
for( QStringList::ConstIterator it = restartCommand.constBegin();
it != restartCommand.constEnd();
++it ) {
if( (*it) == QStringLiteral( "-session" ) ) {
if( (*it) == QLatin1String( "-session" ) ) {
++it;
if( it != restartCommand.constEnd()) {
KConfig cfg( QStringLiteral( "session/" ) + wm +
......@@ -349,15 +349,15 @@ QStringList KSMServer::windowWmCommand(WId w)
// Mozilla is launched using wrapper scripts, so it's launched using "mozilla",
// but the actual binary is "mozilla-bin" or "<path>/mozilla-bin", and that's what
// will be also in WM_COMMAND - using this "mozilla-bin" doesn't work at all though
if( command.endsWith( QStringLiteral( "mozilla-bin" )))
if( command.endsWith(QLatin1String( "mozilla-bin" )))
return QStringList() << QStringLiteral( "mozilla" );
if( command.endsWith( QStringLiteral( "firefox-bin" )))
if( command.endsWith(QLatin1String( "firefox-bin" )))
return QStringList() << QStringLiteral( "firefox" );
if( command.endsWith( QStringLiteral( "thunderbird-bin" )))
if( command.endsWith(QLatin1String( "thunderbird-bin" )))
return QStringList() << QStringLiteral( "thunderbird" );
if( command.endsWith( QStringLiteral( "sunbird-bin" )))
if( command.endsWith(QLatin1String( "sunbird-bin" )))
return QStringList() << QStringLiteral( "sunbird" );
if( command.endsWith( QStringLiteral( "seamonkey-bin" )))
if( command.endsWith(QLatin1String( "seamonkey-bin" )))
return QStringList() << QStringLiteral( "seamonkey" );
}
return ret;
......
......@@ -195,7 +195,7 @@ void KSMServer::performLogout()
KConfigGroup cg(KSharedConfig::openConfig(), "General");
saveSession = ( cg.readEntry( "loginMode",
QStringLiteral( "restorePreviousLogout" ) )
== QStringLiteral( "restorePreviousLogout" ) );
== QLatin1String( "restorePreviousLogout" ) );
qCDebug(KSMSERVER) << "saveSession is " << saveSession;
......@@ -254,7 +254,7 @@ void KSMServer::saveCurrentSession()
return;
if ( currentSession().isEmpty() || currentSession() == QString::fromLocal8Bit( SESSION_PREVIOUS_LOGOUT ) )
sessionGroup = QStringLiteral("Session: ") + QString::fromLocal8Bit( SESSION_BY_USER );
sessionGroup = QLatin1String("Session: ") + QString::fromLocal8Bit( SESSION_BY_USER );
state = Checkpoint;
wmPhase1WaitingCount = 0;
......
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