Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 7988f233 authored by Heiko Becker's avatar Heiko Becker 🎸

Pass QLatin1String to .startsWith

It has an overload for that.
parent 03de895f
......@@ -292,7 +292,7 @@ int Mixer_MPRIS2::addAllRunningPlayersAndInitHotplug()
QString busDestination;
foreach ( busDestination , repl.value() )
{
if ( busDestination.startsWith("org.mpris.MediaPlayer2") )
if ( busDestination.startsWith(QLatin1String("org.mpris.MediaPlayer2")) )
{
addMprisControlAsync(busDestination);
qCDebug(KMIX_LOG) << "MPRIS2: Attached media player on busDestination=" << busDestination;
......@@ -361,27 +361,27 @@ MixDevice::ChannelType Mixer_MPRIS2::getChannelTypeFromPlayerId(const QString& i
{
// TODO This hardcoded application list is a quick hack. It should be generalized.
MixDevice::ChannelType ct = MixDevice::APPLICATION_STREAM;
if (id.startsWith("amarok"))
if (id.startsWith(QLatin1String("amarok")))
{
ct = MixDevice::APPLICATION_AMAROK;
}
else if (id.startsWith("banshee"))
else if (id.startsWith(QLatin1String("banshee")))
{
ct = MixDevice::APPLICATION_BANSHEE;
}
else if (id.startsWith("vlc"))
else if (id.startsWith(QLatin1String("vlc")))
{
ct = MixDevice::APPLICATION_VLC;
}
else if (id.startsWith("xmms"))
else if (id.startsWith(QLatin1String("xmms")))
{
ct = MixDevice::APPLICATION_XMM2;
}
else if (id.startsWith("tomahawk"))
else if (id.startsWith(QLatin1String("tomahawk")))
{
ct = MixDevice::APPLICATION_TOMAHAWK;
}
else if (id.startsWith("clementine"))
else if (id.startsWith(QLatin1String("clementine")))
{
ct = MixDevice::APPLICATION_CLEMENTINE;
}
......@@ -576,7 +576,7 @@ void Mixer_MPRIS2::announceVolume()
*/
void Mixer_MPRIS2::newMediaPlayer(QString name, QString oldOwner, QString newOwner)
{
if ( name.startsWith("org.mpris.MediaPlayer2") )
if ( name.startsWith(QLatin1String("org.mpris.MediaPlayer2")) )
{
if ( oldOwner.isEmpty() && !newOwner.isEmpty())
{
......
......@@ -112,7 +112,7 @@ MixDevice::ChannelType Mixer_OSS4::classifyAndRename(QString &name, int flags)
*it = "Treble";
cType = MixDevice::TREBLE;
} else
if ( (*it).startsWith ( "pcm" ) )
if ( (*it).startsWith ( QLatin1String("pcm") ) )
{
(*it).replace ( "pcm","PCM" );
cType = MixDevice::AUDIO;
......@@ -130,12 +130,12 @@ MixDevice::ChannelType Mixer_OSS4::classifyAndRename(QString &name, int flags)
*it = (*it).toUpper();
cType = MixDevice::CD;
}
if ( (*it).startsWith("vmix") )
if ( (*it).startsWith(QLatin1String("vmix")) )
{
(*it).replace("vmix","Virtual Mixer");
cType = MixDevice::VOLUME;
} else
if ( (*it).endsWith("vol") )
if ( (*it).endsWith(QLatin1String("vol")) )
{
QCharRef ref = (*it)[0];
ref = ref.toUpper();
......
......@@ -751,7 +751,7 @@ static devmap* get_widget_map(int type, QString id = QString())
else if (KMIXPA_CAPTURE == type)
return &captureDevices;
else if (KMIXPA_APP_PLAYBACK == type) {
if (id.startsWith("restore:"))
if (id.startsWith(QLatin1String("restore:")))
return &outputRoles;
return &outputStreams;
} else if (KMIXPA_APP_CAPTURE == type)
......@@ -1266,7 +1266,7 @@ int Mixer_PULSE::writeVolumeToHW( const QString& id, shared_ptr<MixDevice> md )
}
else if (KMIXPA_APP_PLAYBACK == m_devnum)
{
if (id.startsWith("stream:"))
if (id.startsWith(QLatin1String("stream:")))
{
for (iter = outputStreams.begin(); iter != outputStreams.end(); ++iter)
{
......@@ -1291,7 +1291,7 @@ int Mixer_PULSE::writeVolumeToHW( const QString& id, shared_ptr<MixDevice> md )
}
}
}
else if (id.startsWith("restore:"))
else if (id.startsWith(QLatin1String("restore:")))
{
for (iter = outputRoles.begin(); iter != outputRoles.end(); ++iter)
{
......
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