summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko Becker <[email protected]>2017-09-11 22:32:37 +0200
committerHeiko Becker <[email protected]>2017-09-11 22:59:10 +0200
commit7988f2336398493bbb4557ff4b1256af01306405 (patch)
treed14c569fd94581adc312f474813ad1338e480e9e
parent03de895fe428283cd083f9e7b78579ce9a1a879c (diff)
Pass QLatin1String to .startsWith
It has an overload for that.
-rw-r--r--backends/mixer_mpris2.cpp16
-rw-r--r--backends/mixer_oss4.cpp6
-rw-r--r--backends/mixer_pulse.cpp6
3 files changed, 14 insertions, 14 deletions
diff --git a/backends/mixer_mpris2.cpp b/backends/mixer_mpris2.cpp
index 99ec351..3ea6f7e 100644
--- a/backends/mixer_mpris2.cpp
+++ b/backends/mixer_mpris2.cpp
@@ -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())
{
diff --git a/backends/mixer_oss4.cpp b/backends/mixer_oss4.cpp
index c7d7561..78a4d24 100644
--- a/backends/mixer_oss4.cpp
+++ b/backends/mixer_oss4.cpp
@@ -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();
diff --git a/backends/mixer_pulse.cpp b/backends/mixer_pulse.cpp
index 6485da3..024d6fc 100644
--- a/backends/mixer_pulse.cpp
+++ b/backends/mixer_pulse.cpp
@@ -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)
{