Commit e00fe5ec authored by Albert Astals Cid's avatar Albert Astals Cid

const & in foreach

svn path=/trunk/KDE/kdemultimedia/juk/; revision=801375
parent 3cf9e2a3
......@@ -102,7 +102,7 @@ void CoverDialog::loadCovers()
{
int i = 0;
foreach(coverKey cover, CoverManager::keys()) {
foreach(const coverKey &cover, CoverManager::keys()) {
(void) new CoverIconViewItem(cover, m_covers);
// TODO: Threading!
......@@ -125,7 +125,7 @@ void CoverDialog::slotArtistClicked(Q3ListViewItem *item)
else {
QString artist = item->text(0).toLower();
foreach(coverKey cover, CoverManager::keys()) {
foreach(const coverKey &cover, CoverManager::keys()) {
CoverDataPtr data = CoverManager::coverInfo(cover);
if(data->artist == artist)
(void) new CoverIconViewItem(cover, m_covers);
......
......@@ -168,7 +168,7 @@ protected:
// Check what hosts are allowed to proceed without being proxied,
// or if using reversed proxy, what hosts must be proxied.
foreach(QString host, noProxies) {
foreach(const QString &host, noProxies) {
QString normalizedHost = KNetwork::KResolver::normalizeDomain(host);
if(normalizedHost == tunepimpHost ||
......@@ -729,7 +729,7 @@ double stringSimilarity(const QStringList &l, const QString &s)
{
double max = 0, current = 0;
foreach(QString string, l) {
foreach(const QString &string, l) {
if(max < (current = stringSimilarity(string, s)))
max = current;
}
......
......@@ -327,7 +327,7 @@ void HistoryItem::update(const FileHandle &file)
QString current = QString("<b>%1</b>").arg(i18n("History"));
QString previous;
foreach(Item historyItem, m_history) {
foreach(const Item &historyItem, m_history) {
previous = current;
current.append(format.arg(historyItem.anchor).arg(Qt::escape(historyItem.file.tag()->title())));
setText(current);
......@@ -345,7 +345,7 @@ void HistoryItem::update(const FileHandle &file)
void HistoryItem::openLink(const QString &link)
{
foreach(Item historyItem, m_history) {
foreach(const Item &historyItem, m_history) {
if(historyItem.anchor == link) {
if(historyItem.playlist) {
CollectionListItem *collectionItem =
......
......@@ -1277,7 +1277,7 @@ void Playlist::read(QDataStream &s)
m_blockDataChanged = true;
foreach(QString file, files) {
foreach(const QString &file, files) {
if(file.isEmpty())
throw BICStreamException();
......
......@@ -92,7 +92,7 @@ void ViewMode::paintCell(PlaylistBox::Item *item,
y += pm->height() + fm.height() - fm.descent();
foreach(QString line, m_lines[item]) {
foreach(const QString &line, m_lines[item]) {
int x = (width - fm.width(line)) / 2;
x = qMax(x, item->listView()->itemMargin());
painter->drawText(x, y, line);
......@@ -372,10 +372,10 @@ void TreeViewMode::addItems(const QStringList &items, unsigned column)
PlaylistList playlists;
playlists.append(CollectionList::instance());
QString itemKey, item;
QString itemKey;
PlaylistBox::Item *itemParent = m_searchCategories.value(searchCategory, 0);
foreach(item, items) {
foreach(const QString &item, items) {
itemKey = searchCategory + item;
if(m_treeViewItems.contains(itemKey))
......@@ -399,7 +399,7 @@ void TreeViewMode::setDynamicListsFrozen(bool frozen)
if(frozen)
return;
foreach(QString pendingItem, m_pendingItemsToRemove) {
foreach(const QString &pendingItem, m_pendingItemsToRemove) {
m_treeViewItems[pendingItem]->deleteLater();
m_treeViewItems.remove(pendingItem);
}
......
......@@ -116,7 +116,7 @@ void WebImageFetcherDialog::setLayout()
QStandardItemModel *model = new QStandardItemModel(m_iconWidget);
QAbstractItemModel *oldModel = m_iconWidget->model();
foreach(WebImage image, m_imageList) {
foreach(const WebImage &image, m_imageList) {
CoverIconViewItem *item = new CoverIconViewItem(m_iconWidget, image);
model->appendRow(item);
}
......
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