diff --git a/3rdparty/pythonqt/src/PythonQt.cpp b/3rdparty/pythonqt/src/PythonQt.cpp index dfde7a028..d4c4b3cc6 100644 --- a/3rdparty/pythonqt/src/PythonQt.cpp +++ b/3rdparty/pythonqt/src/PythonQt.cpp @@ -534,7 +534,7 @@ PythonQtObjectPtr PythonQt::lookupObject(PyObject* module, const QString& name) PythonQtObjectPtr prev; QString s; QByteArray b; - for (QStringList::ConstIterator i = l.begin(); i!=l.end() && p; ++i) { + for (QStringList::ConstIterator i = l.constBegin(); i!=l.constEnd() && p; ++i) { prev = p; b = (*i).toLatin1(); if (PyDict_Check(p)) { diff --git a/3rdparty/pythonqt/src/PythonQtMethodInfo.cpp b/3rdparty/pythonqt/src/PythonQtMethodInfo.cpp index aee37deea..192e302ff 100644 --- a/3rdparty/pythonqt/src/PythonQtMethodInfo.cpp +++ b/3rdparty/pythonqt/src/PythonQtMethodInfo.cpp @@ -244,8 +244,8 @@ int PythonQtMethodInfo::nameToType(const char* name) _parameterTypeDict.insert("QVariant", PythonQtMethodInfo::Variant); // own special types... (none so far, could be e.g. ObjectList } - QHash::const_iterator it = _parameterTypeDict.find(name); - if (it!=_parameterTypeDict.end()) { + QHash::const_iterator it = _parameterTypeDict.constFind(name); + if (it!=_parameterTypeDict.constEnd()) { return it.value(); } else { return PythonQtMethodInfo::Unknown; diff --git a/CMakeLists.txt b/CMakeLists.txt index 278fc721d..955bfca0f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -176,7 +176,7 @@ if (WIN32) SET(CMAKE_RC_COMPILE_OBJECT " -O coff -o -I../../dist/windows") endif(WIN32) -add_definitions(-DQT_NO_CAST_TO_ASCII) +add_definitions(-DQT_NO_CAST_TO_ASCII -DQT_STRICT_ITERATORS) # Translations stuff find_program(GETTEXT_XGETTEXT_EXECUTABLE xgettext) diff --git a/src/core/encoding.cpp b/src/core/encoding.cpp index bd3824fb6..c7cf8b8bb 100644 --- a/src/core/encoding.cpp +++ b/src/core/encoding.cpp @@ -134,7 +134,8 @@ QTextCodec* UniversalEncodingHandler::Guess(const TagLib::FileRef& fileref) { return NULL; } - QHash::const_iterator max = std::max_element(usages.begin(), usages.end()); + QHash::const_iterator max = + std::max_element(usages.constBegin(), usages.constEnd()); return max.key(); } @@ -174,8 +175,9 @@ QTextCodec* UniversalEncodingHandler::Guess(const Engine::SimpleMetaBundle& bund ++usages[Guess(bundle, &Engine::SimpleMetaBundle::genre)]; usages.remove(NULL); // Remove votes for ASCII. - QHash::const_iterator max = std::max_element(usages.begin(), usages.end()); - if (max != usages.end()) { + QHash::const_iterator max = + std::max_element(usages.constBegin(), usages.constEnd()); + if (max != usages.constEnd()) { return max.key(); } return NULL; diff --git a/src/radio/spotifyservice.cpp b/src/radio/spotifyservice.cpp index 8ec08c190..7df742a63 100644 --- a/src/radio/spotifyservice.cpp +++ b/src/radio/spotifyservice.cpp @@ -568,9 +568,9 @@ void SpotifyService::SyncPlaylistProgress( task_id = starred_sync_id_; break; case protobuf::UserPlaylist: { - QMap::const_iterator it = playlist_sync_ids_.find( + QMap::const_iterator it = playlist_sync_ids_.constFind( progress.request().user_playlist_index()); - if (it != playlist_sync_ids_.end()) { + if (it != playlist_sync_ids_.constEnd()) { task_id = it.value(); } break;