Commit d097745d authored by Michael Pyne's avatar Michael Pyne
Browse files

clazy: Fix warnings about detaching from non-const temporaries.

parent 3a3bc5e5
......@@ -124,7 +124,7 @@ void SearchLine::setSearchComponent(const PlaylistSearch::Component &component)
if(component.columns().isEmpty() || component.columns().size() > 1)
m_searchFieldsBox->setCurrentIndex(0);
else
m_searchFieldsBox->setCurrentIndex(component.columns().front() + 1);
m_searchFieldsBox->setCurrentIndex(component.columns().constFirst() + 1);
}
}
......
......@@ -67,35 +67,35 @@ QString FileNameScheme::title() const
{
if(m_titleField == -1)
return QString();
return m_regExp.capturedTexts()[ m_titleField ];
return m_regExp.capturedTexts().at(m_titleField);
}
QString FileNameScheme::artist() const
{
if(m_artistField == -1)
return QString();
return m_regExp.capturedTexts()[ m_artistField ];
return m_regExp.capturedTexts().at(m_artistField);
}
QString FileNameScheme::album() const
{
if(m_albumField == -1)
return QString();
return m_regExp.capturedTexts()[ m_albumField ];
return m_regExp.capturedTexts().at(m_albumField);
}
QString FileNameScheme::track() const
{
if(m_trackField == -1)
return QString();
return m_regExp.capturedTexts()[ m_trackField ];
return m_regExp.capturedTexts().at(m_trackField);
}
QString FileNameScheme::comment() const
{
if(m_commentField == -1)
return QString();
return m_regExp.capturedTexts()[ m_commentField ];
return m_regExp.capturedTexts().at(m_commentField);
}
QString FileNameScheme::composeRegExp(const QString &s) const
......
......@@ -116,7 +116,7 @@ void DefaultSequenceIterator::advance()
if(!m_albumSearch.isNull()) {
PlaylistItemList albumMatches;
const Playlist* const playlist = m_albumSearch.playlists()[0];
const Playlist* const playlist = m_albumSearch.playlists().constFirst();
for(QModelIndex index : m_albumSearch.matchedItems())
playlist->itemAt(index.row(), index.column());
if(albumMatches.isEmpty()) {
......
......@@ -33,8 +33,9 @@ TreeViewItemPlaylist::TreeViewItemPlaylist(PlaylistCollection *collection,
const QString &name) :
SearchPlaylist(collection, search, name, false)
{
PlaylistSearch::Component component = *(search.components().begin());
m_columnType = static_cast<PlaylistItem::ColumnType>(*(component.columns().begin()));
const PlaylistSearch::ComponentList components(search.components());
const PlaylistSearch::Component component = components.first();
m_columnType = static_cast<PlaylistItem::ColumnType>(component.columns().constFirst());
}
void TreeViewItemPlaylist::retag(const QStringList &files, Playlist *)
......
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