Convert to C++11 style for loops
This commit is contained in:
parent
92af974894
commit
8b9e31d8e4
3 changed files with 9 additions and 13 deletions
|
@ -70,7 +70,8 @@ void DanbooruPool::addPosts(QList< int > posts)
|
|||
|
||||
void DanbooruPool::addPosts(const QStringList& posts)
|
||||
{
|
||||
foreach (const QString& post, posts) {
|
||||
|
||||
for (auto post: posts) {
|
||||
m_posts.append(post.toInt());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,6 +84,7 @@ namespace Danbooru {
|
|||
|
||||
const QMap< QString, Rating > DanbooruPost::initRatingMap()
|
||||
{
|
||||
|
||||
QMap<QString, Rating> map;
|
||||
map.insert("s", Safe);
|
||||
map.insert("q", Questionable);
|
||||
|
|
|
@ -45,12 +45,9 @@ namespace Danbooru {
|
|||
|
||||
if (!parameters.isEmpty()) {
|
||||
|
||||
QMap<QString, QString>::const_iterator iter;
|
||||
|
||||
for (iter = parameters.constBegin(); iter!= parameters.constEnd();
|
||||
++iter) {
|
||||
danbooruUrl.addQueryItem(iter.key(), iter.value());
|
||||
}
|
||||
for (auto key: parameters.keys()) {
|
||||
danbooruUrl.addQueryItem(key, parameters.value(key));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -80,12 +77,9 @@ namespace Danbooru {
|
|||
|
||||
if (!parameters.isEmpty()) {
|
||||
|
||||
QMap<QString, QString>::const_iterator iter;
|
||||
|
||||
for (iter = parameters.constBegin(); iter!= parameters.constEnd();
|
||||
++iter) {
|
||||
danbooruUrl.addQueryItem(iter.key(), iter.value());
|
||||
}
|
||||
for (auto key: parameters.keys()) {
|
||||
danbooruUrl.addQueryItem(key, parameters.value(key));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue