mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-18 04:19:55 +01:00
Define QT_STRICT_ITERATORS and fix the associated bugs.
This commit is contained in:
parent
9023aafdef
commit
6e86caae2c
2
3rdparty/pythonqt/src/PythonQt.cpp
vendored
2
3rdparty/pythonqt/src/PythonQt.cpp
vendored
@ -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)) {
|
||||
|
4
3rdparty/pythonqt/src/PythonQtMethodInfo.cpp
vendored
4
3rdparty/pythonqt/src/PythonQtMethodInfo.cpp
vendored
@ -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<QByteArray, int>::const_iterator it = _parameterTypeDict.find(name);
|
||||
if (it!=_parameterTypeDict.end()) {
|
||||
QHash<QByteArray, int>::const_iterator it = _parameterTypeDict.constFind(name);
|
||||
if (it!=_parameterTypeDict.constEnd()) {
|
||||
return it.value();
|
||||
} else {
|
||||
return PythonQtMethodInfo::Unknown;
|
||||
|
@ -176,7 +176,7 @@ if (WIN32)
|
||||
SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff -o <OBJECT> <SOURCE> -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)
|
||||
|
@ -134,7 +134,8 @@ QTextCodec* UniversalEncodingHandler::Guess(const TagLib::FileRef& fileref) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
QHash<QTextCodec*, int>::const_iterator max = std::max_element(usages.begin(), usages.end());
|
||||
QHash<QTextCodec*, int>::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<QTextCodec*, int>::const_iterator max = std::max_element(usages.begin(), usages.end());
|
||||
if (max != usages.end()) {
|
||||
QHash<QTextCodec*, int>::const_iterator max =
|
||||
std::max_element(usages.constBegin(), usages.constEnd());
|
||||
if (max != usages.constEnd()) {
|
||||
return max.key();
|
||||
}
|
||||
return NULL;
|
||||
|
@ -568,9 +568,9 @@ void SpotifyService::SyncPlaylistProgress(
|
||||
task_id = starred_sync_id_;
|
||||
break;
|
||||
case protobuf::UserPlaylist: {
|
||||
QMap<int, int>::const_iterator it = playlist_sync_ids_.find(
|
||||
QMap<int, int>::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;
|
||||
|
Loading…
Reference in New Issue
Block a user