~neon/juk/master

« back to all changes in this revision

Viewing changes to upcomingplaylist.cpp

  • Committer: Michael Pyne
  • Date: 2009-07-04 04:55:50 UTC
  • Revision ID: git-v1:ec8ce622602822568e9e63cdb265b98558d31b3f
Port most iterators to use foreach when feasible.  Not only is it easier to
read but I think I even saw an instance of an end iterator being
inappropriately cached which is normally bad news.

It builds, I haven't tested if it runs yet. ;)

svn path=/trunk/KDE/kdemultimedia/juk/; revision=991102

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
 
72
72
    PlaylistItem *after = static_cast<PlaylistItem *>(lastItem());
73
73
 
74
 
    for(PlaylistItemList::ConstIterator it = itemList.begin(); it != itemList.end(); ++it) {
75
 
        after = createItem(*it, after);
76
 
        m_playlistIndex.insert(after, (*it)->playlist());
 
74
    foreach(PlaylistItem *playlistItem, itemList) {
 
75
        after = createItem(playlistItem, after);
 
76
        m_playlistIndex.insert(after, playlistItem->playlist());
77
77
    }
78
78
 
79
79
    dataChanged();
120
120
    CollectionList::instance()->addFiles(files, after);
121
121
 
122
122
    PlaylistItemList l;
123
 
    for(QStringList::ConstIterator it = files.begin(); it != files.end(); ++it) {
124
 
        FileHandle f(*it);
 
123
    foreach(const QString &file, files) {
 
124
        FileHandle f(file);
125
125
        PlaylistItem *i = CollectionList::instance()->lookup(f.absFilePath());
126
126
        if(i)
127
127
            l.append(i);
254
254
 
255
255
    s << qint32(l.count());
256
256
 
257
 
    for(PlaylistItemList::Iterator it = l.begin(); it != l.end(); ++it)
258
 
        s << (*it)->file().absFilePath();
 
257
    foreach(const PlaylistItem *playlistItem, l)
 
258
        s << playlistItem->file().absFilePath();
259
259
 
260
260
    return s;
261
261
}