~neon/juk/master

« back to all changes in this revision

Viewing changes to playlistcollection.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:
364
364
        const bool reload = m_importPlaylists != result.addPlaylists;
365
365
        m_importPlaylists = result.addPlaylists;
366
366
 
367
 
        for(QStringList::const_iterator it = result.addedDirs.constBegin();
368
 
            it != result.addedDirs.constEnd(); it++)
369
 
        {
370
 
            m_dirLister.openUrl(KUrl::fromPath(*it), KDirLister::Keep);
371
 
            m_folderList.append(*it);
 
367
        foreach(const QString &dir, result.addedDirs) {
 
368
            m_dirLister.openUrl(KUrl::fromPath(dir), KDirLister::Keep);
 
369
            m_folderList.append(dir);
372
370
        }
373
371
 
374
 
        for(QStringList::const_iterator it = result.removedDirs.constBegin();
375
 
            it !=  result.removedDirs.constEnd(); it++)
376
 
        {
377
 
            m_dirLister.stop(KUrl::fromPath(*it));
378
 
            m_folderList.removeAll(*it);
 
372
        foreach(const QString &dir, result.removedDirs) {
 
373
            m_dirLister.stop(KUrl::fromPath(dir));
 
374
            m_folderList.removeAll(dir);
379
375
        }
380
376
 
381
377
        if(reload)
823
819
    m_importPlaylists  = config.readEntry("ImportPlaylists", true);
824
820
    m_folderList       = config.readEntry("DirectoryList", QStringList());
825
821
 
826
 
    for(QStringList::ConstIterator it = m_folderList.constBegin(); it != m_folderList.constEnd(); ++it)
827
 
        m_dirLister.openUrl(*it, KDirLister::Keep);
 
822
    foreach(const QString &folder, m_folderList)
 
823
        m_dirLister.openUrl(folder, KDirLister::Keep);
828
824
}
829
825
 
830
826
void PlaylistCollection::saveConfig()