Commit c96f5d4e authored by Laurent Montel's avatar Laurent Montel

Fix iterator

svn path=/trunk/KDE/kdemultimedia/juk/; revision=882934
parent 9d66031f
......@@ -84,8 +84,8 @@ AdvancedSearchDialog::AdvancedSearchDialog(const QString &defaultName,
}
else {
PlaylistSearch::ComponentList components = defaultSearch.components();
for(PlaylistSearch::ComponentList::ConstIterator it = components.begin();
it != components.end();
for(PlaylistSearch::ComponentList::ConstIterator it = components.constBegin();
it != components.constEnd();
++it)
{
SearchLine *s = new SearchLine(this);
......@@ -154,8 +154,8 @@ void AdvancedSearchDialog::accept()
m_search.addPlaylist(CollectionList::instance());
QList<SearchLine *>::const_iterator it = m_searchLines.begin();
for(; it != m_searchLines.end(); ++it)
QList<SearchLine *>::const_iterator it = m_searchLines.constBegin();
for(; it != m_searchLines.constEnd(); ++it)
m_search.addComponent((*it)->searchComponent());
PlaylistSearch::SearchMode m = PlaylistSearch::SearchMode(!m_matchAnyButton->isChecked());
......@@ -168,8 +168,8 @@ void AdvancedSearchDialog::accept()
void AdvancedSearchDialog::clear()
{
QList<SearchLine *>::const_iterator it = m_searchLines.begin();
for(; it != m_searchLines.end(); ++it)
QList<SearchLine *>::const_iterator it = m_searchLines.constBegin();
for(; it != m_searchLines.constEnd(); ++it)
(*it)->clear();
}
......
......@@ -128,7 +128,7 @@ PlaylistItem *CollectionList::createItem(const FileHandle &file, Q3ListViewItem
void CollectionList::clearItems(const PlaylistItemList &items)
{
for(PlaylistItemList::ConstIterator it = items.begin(); it != items.end(); ++it) {
for(PlaylistItemList::ConstIterator it = items.constBegin(); it != items.constEnd(); ++it) {
Cache::instance()->remove((*it)->file());
clearItem(*it, false);
}
......@@ -157,7 +157,7 @@ void CollectionList::slotNewItems(const KFileItemList &items)
{
QStringList files;
for(KFileItemList::ConstIterator it = items.begin(); it != items.end(); ++it)
for(KFileItemList::ConstIterator it = items.constBegin(); it != items.constEnd(); ++it)
files.append((*it).url().path());
addFiles(files);
......@@ -435,7 +435,7 @@ PlaylistItem *CollectionListItem::itemForPlaylist(const Playlist *playlist)
return this;
PlaylistItemList::ConstIterator it;
for(it = m_children.begin(); it != m_children.end(); ++it)
for(it = m_children.constBegin(); it != m_children.constEnd(); ++it)
if((*it)->playlist() == playlist)
return *it;
return 0;
......@@ -455,7 +455,7 @@ void CollectionListItem::updateCollectionDict(const QString &oldPath, const QStr
void CollectionListItem::repaint() const
{
Q3ListViewItem::repaint();
for(PlaylistItemList::ConstIterator it = m_children.begin(); it != m_children.end(); ++it)
for(PlaylistItemList::ConstIterator it = m_children.constBegin(); it != m_children.constEnd(); ++it)
(*it)->repaint();
}
......@@ -492,8 +492,8 @@ CollectionListItem::~CollectionListItem()
{
m_shuttingDown = true;
for(PlaylistItemList::ConstIterator it = m_children.begin();
it != m_children.end();
for(PlaylistItemList::ConstIterator it = m_children.constBegin();
it != m_children.constEnd();
++it)
{
delete *it;
......
......@@ -87,7 +87,7 @@ void CoverDialog::show()
m_artists->setSorting(-1);
new AllArtistsListViewItem(m_artists);
for(QStringList::ConstIterator it = artists.begin(); it != artists.end(); ++it)
for(QStringList::ConstIterator it = artists.constBegin(); it != artists.constEnd(); ++it)
new CaseInsensitiveItem(m_artists, *it);
m_artists->setSorting(0);
......
......@@ -57,7 +57,7 @@ DynamicPlaylist::DynamicPlaylist(const PlaylistList &playlists,
setSorting(columns() + 1);
for(PlaylistList::ConstIterator it = playlists.begin(); it != playlists.end(); ++it)
for(PlaylistList::ConstIterator it = playlists.constBegin(); it != playlists.constEnd(); ++it)
m_observers.append(new PlaylistDirtyObserver(this, *it));
connect(CollectionList::instance(), SIGNAL(signalCollectionChanged()), this, SLOT(slotSetDirty()));
......@@ -142,7 +142,7 @@ void DynamicPlaylist::updateItems()
{
PlaylistItemList siblings;
for(PlaylistList::ConstIterator it = m_playlists.begin(); it != m_playlists.end(); ++it)
for(PlaylistList::ConstIterator it = m_playlists.constBegin(); it != m_playlists.constEnd(); ++it)
siblings += (*it)->items();
......
......@@ -85,8 +85,8 @@ namespace FileHandleProperties
static QStringList l;
if(l.isEmpty()) {
QMap<QByteArray, const Property *>::ConstIterator it = propertyMap.begin();
for(; it != propertyMap.end(); ++it)
QMap<QByteArray, const Property *>::ConstIterator it = propertyMap.constBegin();
for(; it != propertyMap.constEnd(); ++it)
l.append(QString(it.key()));
}
return l;
......
......@@ -87,8 +87,8 @@ public:
int lvHeight = 0;
QMap<QString, QString>::ConstIterator it = files.begin();
for(; it != files.end(); ++it) {
QMap<QString, QString>::ConstIterator it = files.constBegin();
for(; it != files.constEnd(); ++it) {
K3ListViewItem *i = it.key() != it.value()
? new K3ListViewItem(lv, it.key(), it.value())
: new K3ListViewItem(lv, it.key(), i18n("No Change"));
......@@ -291,8 +291,8 @@ void FileRenamerWidget::loadConfig()
checkedSeparators = config.readEntry("CheckedDirSeparators", QList<int>());
for(QList<int>::ConstIterator it = checkedSeparators.begin();
it != checkedSeparators.end(); ++it)
for(QList<int>::ConstIterator it = checkedSeparators.constBegin();
it != checkedSeparators.constEnd(); ++it)
{
int separator = *it;
if(separator < m_folderSwitches.count())
......@@ -915,7 +915,7 @@ void FileRenamer::rename(const PlaylistItemList &items)
QMap<QString, QString> map;
QMap<QString, PlaylistItem *> itemMap;
for(PlaylistItemList::ConstIterator it = items.begin(); it != items.end(); ++it) {
for(PlaylistItemList::ConstIterator it = items.constBegin(); it != items.constEnd(); ++it) {
reader.setPlaylistItem(*it);
QString oldFile = (*it)->file().absFilePath();
QString extension = (*it)->file().fileInfo().suffix();
......@@ -931,8 +931,8 @@ void FileRenamer::rename(const PlaylistItemList &items)
return;
KApplication::setOverrideCursor(Qt::waitCursor);
for(QMap<QString, QString>::ConstIterator it = map.begin();
it != map.end(); ++it)
for(QMap<QString, QString>::ConstIterator it = map.constBegin();
it != map.constEnd(); ++it)
{
if(moveFile(it.key(), it.value())) {
itemMap[it.key()]->setFile(it.value());
......@@ -1004,7 +1004,7 @@ void FileRenamer::setFolderIcon(const KUrl &dst, const PlaylistItem *item)
QStringList elements = dstURL.directory().split("/", QString::SkipEmptyParts);
QString path;
for(QStringList::ConstIterator it = elements.begin(); it != elements.end(); ++it) {
for(QStringList::ConstIterator it = elements.constBegin(); it != elements.constEnd(); ++it) {
path.append('/' + (*it));
kDebug() << "Checking path: " << path;
......@@ -1067,8 +1067,8 @@ QString FileRenamer::fileName(const CategoryReaderInterface &interface)
lastEnabled = lastEnabledItem(categoryOrder, interface);
bool pastLast = false; // Toggles to true once we've passed lastEnabled.
for(QList<CategoryID>::ConstIterator it = categoryOrder.begin();
it != categoryOrder.end();
for(QList<CategoryID>::ConstIterator it = categoryOrder.constBegin();
it != categoryOrder.constEnd();
++it, ++i)
{
if(it == lastEnabled)
......
......@@ -128,7 +128,7 @@ QDataStream &operator<<(QDataStream &s, const HistoryPlaylist &p)
s << qint32(l.count());
for(PlaylistItemList::ConstIterator it = l.begin(); it != l.end(); ++it) {
for(PlaylistItemList::ConstIterator it = l.constBegin(); it != l.constEnd(); ++it) {
const HistoryPlaylistItem *i = static_cast<HistoryPlaylistItem *>(*it);
s << i->file().absFilePath();
s << i->dateTime();
......
This diff is collapsed.
......@@ -316,7 +316,7 @@ void PlaylistBox::remove()
if(remove == KMessageBox::Yes) {
QStringList couldNotDelete;
for(QStringList::ConstIterator it = files.begin(); it != files.end(); ++it) {
for(QStringList::ConstIterator it = files.constBegin(); it != files.constEnd(); ++it) {
if(!QFile::remove(*it))
couldNotDelete.append(*it);
}
......@@ -341,7 +341,7 @@ void PlaylistBox::remove()
PlaylistList removeQueue;
for(ItemList::ConstIterator it = items.begin(); it != items.end(); ++it) {
for(ItemList::ConstIterator it = items.constBegin(); it != items.constEnd(); ++it) {
if(*it != Item::collectionItem() &&
(*it)->playlist() &&
(!(*it)->playlist()->readOnly()))
......@@ -363,7 +363,7 @@ void PlaylistBox::remove()
setSingleItem(i);
}
for(PlaylistList::ConstIterator it = removeQueue.begin(); it != removeQueue.end(); ++it) {
for(PlaylistList::ConstIterator it = removeQueue.constBegin(); it != removeQueue.constEnd(); ++it) {
if(*it != upcomingPlaylist())
delete *it;
else {
......@@ -429,7 +429,7 @@ void PlaylistBox::decode(const QMimeData *s, Item *item)
if(!urls.isEmpty()) {
QStringList files;
for(KUrl::List::ConstIterator it = urls.begin(); it != urls.end(); ++it)
for(KUrl::List::ConstIterator it = urls.constBegin(); it != urls.constEnd(); ++it)
files.append((*it).path());
if(item) {
......@@ -610,7 +610,7 @@ void PlaylistBox::slotPlaylistChanged()
bool allowReload = false;
PlaylistList playlists;
for(ItemList::ConstIterator it = items.begin(); it != items.end(); ++it) {
for(ItemList::ConstIterator it = items.constBegin(); it != items.constEnd(); ++it) {
Playlist *p = (*it)->playlist();
if(p) {
......
......@@ -325,7 +325,7 @@ void PlaylistCollection::open(const QStringList &l)
bool justPlaylists = true;
for(QStringList::ConstIterator it = l.begin(); it != l.end() && justPlaylists; ++it)
for(QStringList::ConstIterator it = l.constBegin(); it != l.constEnd() && justPlaylists; ++it)
justPlaylists = !MediaFiles::isPlaylistFile(*it);
if(visiblePlaylist() == CollectionList::instance() || justPlaylists ||
......@@ -365,15 +365,15 @@ void PlaylistCollection::addFolder()
const bool reload = m_importPlaylists != result.addPlaylists;
m_importPlaylists = result.addPlaylists;
for(QStringList::const_iterator it = result.addedDirs.begin();
it != result.addedDirs.end(); it++)
for(QStringList::const_iterator it = result.addedDirs.constBegin();
it != result.addedDirs.constEnd(); it++)
{
m_dirLister.openUrl(KUrl::fromPath(*it), KDirLister::Keep);
m_folderList.append(*it);
}
for(QStringList::const_iterator it = result.removedDirs.begin();
it != result.removedDirs.end(); it++)
for(QStringList::const_iterator it = result.removedDirs.constBegin();
it != result.removedDirs.constEnd(); it++)
{
m_dirLister.stop(KUrl::fromPath(*it));
m_folderList.removeAll(*it);
......@@ -827,7 +827,7 @@ void PlaylistCollection::readConfig()
m_importPlaylists = config.readEntry("ImportPlaylists", true);
m_folderList = config.readEntry("DirectoryList", QStringList());
for(QStringList::ConstIterator it = m_folderList.begin(); it != m_folderList.end(); ++it)
for(QStringList::ConstIterator it = m_folderList.constBegin(); it != m_folderList.constEnd(); ++it)
m_dirLister.openUrl(*it, KDirLister::Keep);
}
......
......@@ -282,8 +282,8 @@ QDataStream &operator>>(QDataStream &s, PlaylistSearch &search)
search.clearComponents();
PlaylistSearch::ComponentList components;
s >> components;
PlaylistSearch::ComponentList::ConstIterator it = components.begin();
for(; it != components.end(); ++it)
PlaylistSearch::ComponentList::ConstIterator it = components.constBegin();
for(; it != components.constEnd(); ++it)
search.addComponent(*it);
qint32 mode;
......
......@@ -417,12 +417,12 @@ void TagEditor::updateCollection()
m_genreList = list->uniqueSet(CollectionList::Genres);
for(QStringList::ConstIterator it = m_genreList.begin(); it != m_genreList.end(); ++it)
for(QStringList::ConstIterator it = m_genreList.constBegin(); it != m_genreList.constEnd(); ++it)
genreHash.insert(*it);
TagLib::StringList genres = TagLib::ID3v1::genreList();
for(TagLib::StringList::ConstIterator it = genres.begin(); it != genres.end(); ++it)
for(TagLib::StringList::Iterator it = genres.begin(); it != genres.end(); ++it)
genreHash.insert(TStringToQString((*it)));
m_genreList = genreHash.values();
......
......@@ -182,8 +182,8 @@ void TagGuesser::guess(const QString &absFileName)
{
m_title = m_artist = m_album = m_track = m_comment = QString();
FileNameScheme::List::ConstIterator it = m_schemes.begin();
FileNameScheme::List::ConstIterator end = m_schemes.end();
FileNameScheme::List::ConstIterator it = m_schemes.constBegin();
FileNameScheme::List::ConstIterator end = m_schemes.constEnd();
for (; it != end; ++it) {
const FileNameScheme schema(*it);
if(schema.matches(absFileName)) {
......
......@@ -154,8 +154,8 @@ bool TagTransactionManager::processChangeList(bool undo)
TagAlterationList::ConstIterator it, end;
QStringList errorItems;
it = undo ? m_undoList.begin() : m_list.begin();
end = undo ? m_undoList.end() : m_list.end();
it = undo ? m_undoList.constBegin() : m_list.constBegin();
end = undo ? m_undoList.constEnd() : m_list.constEnd();
emit signalAboutToModifyTags();
......
......@@ -254,7 +254,7 @@ QDataStream &operator<<(QDataStream &s, const UpcomingPlaylist &p)
s << qint32(l.count());
for(PlaylistItemList::ConstIterator it = l.begin(); it != l.end(); ++it)
for(PlaylistItemList::Iterator it = l.begin(); it != l.end(); ++it)
s << (*it)->file().absFilePath();
return s;
......
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