diff --git a/src/services/owncloud/owncloudserviceroot.cpp b/src/services/owncloud/owncloudserviceroot.cpp index c978ea1d5..e19c93604 100755 --- a/src/services/owncloud/owncloudserviceroot.cpp +++ b/src/services/owncloud/owncloudserviceroot.cpp @@ -287,11 +287,17 @@ QMap OwnCloudServiceRoot::storeCustomFeedsData() { return custom_data; } -void OwnCloudServiceRoot::restoreCustomFeedsData(const QMap &data, const QHash &feeds) { - foreach (int custom_id, data.keys()) { +void OwnCloudServiceRoot::restoreCustomFeedsData(const QMap &data, const QHash &feeds) { + QMapIterator i(data); + + while (i.hasNext()) { + i.next(); + + const int custom_id = i.key(); + if (feeds.contains(custom_id)) { Feed *feed = feeds.value(custom_id); - QVariantMap feed_custom_data = data.value(custom_id).toMap(); + QVariantMap feed_custom_data = i.value().toMap(); feed->setAutoUpdateInitialInterval(feed_custom_data.value(QSL("auto_update_interval")).toInt()); feed->setAutoUpdateType(static_cast(feed_custom_data.value(QSL("auto_update_type")).toInt())); diff --git a/src/services/tt-rss/ttrssserviceroot.cpp b/src/services/tt-rss/ttrssserviceroot.cpp index a3756f314..b5323fc0d 100755 --- a/src/services/tt-rss/ttrssserviceroot.cpp +++ b/src/services/tt-rss/ttrssserviceroot.cpp @@ -297,10 +297,16 @@ QMap TtRssServiceRoot::storeCustomFeedsData() { } void TtRssServiceRoot::restoreCustomFeedsData(const QMap &data, const QHash &feeds) { - foreach (int custom_id, data.keys()) { + QMapIterator i(data); + + while (i.hasNext()) { + i.next(); + + const int custom_id = i.key(); + if (feeds.contains(custom_id)) { Feed *feed = feeds.value(custom_id); - QVariantMap feed_custom_data = data.value(custom_id).toMap(); + QVariantMap feed_custom_data = i.value().toMap(); feed->setAutoUpdateInitialInterval(feed_custom_data.value(QSL("auto_update_interval")).toInt()); feed->setAutoUpdateType(static_cast(feed_custom_data.value(QSL("auto_update_type")).toInt()));