Some clazy fixes.

This commit is contained in:
Martin Rotter 2017-04-22 21:13:16 +02:00
parent c715aa180a
commit 2a9eebad2a
2 changed files with 17 additions and 5 deletions

View File

@ -287,11 +287,17 @@ QMap<int,QVariant> OwnCloudServiceRoot::storeCustomFeedsData() {
return custom_data; return custom_data;
} }
void OwnCloudServiceRoot::restoreCustomFeedsData(const QMap<int,QVariant> &data, const QHash<int,Feed*> &feeds) { void OwnCloudServiceRoot::restoreCustomFeedsData(const QMap<int, QVariant> &data, const QHash<int, Feed*> &feeds) {
foreach (int custom_id, data.keys()) { QMapIterator<int, QVariant> i(data);
while (i.hasNext()) {
i.next();
const int custom_id = i.key();
if (feeds.contains(custom_id)) { if (feeds.contains(custom_id)) {
Feed *feed = feeds.value(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->setAutoUpdateInitialInterval(feed_custom_data.value(QSL("auto_update_interval")).toInt());
feed->setAutoUpdateType(static_cast<Feed::AutoUpdateType>(feed_custom_data.value(QSL("auto_update_type")).toInt())); feed->setAutoUpdateType(static_cast<Feed::AutoUpdateType>(feed_custom_data.value(QSL("auto_update_type")).toInt()));

View File

@ -297,10 +297,16 @@ QMap<int,QVariant> TtRssServiceRoot::storeCustomFeedsData() {
} }
void TtRssServiceRoot::restoreCustomFeedsData(const QMap<int,QVariant> &data, const QHash<int,Feed*> &feeds) { void TtRssServiceRoot::restoreCustomFeedsData(const QMap<int,QVariant> &data, const QHash<int,Feed*> &feeds) {
foreach (int custom_id, data.keys()) { QMapIterator<int, QVariant> i(data);
while (i.hasNext()) {
i.next();
const int custom_id = i.key();
if (feeds.contains(custom_id)) { if (feeds.contains(custom_id)) {
Feed *feed = feeds.value(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->setAutoUpdateInitialInterval(feed_custom_data.value(QSL("auto_update_interval")).toInt());
feed->setAutoUpdateType(static_cast<Feed::AutoUpdateType>(feed_custom_data.value(QSL("auto_update_type")).toInt())); feed->setAutoUpdateType(static_cast<Feed::AutoUpdateType>(feed_custom_data.value(QSL("auto_update_type")).toInt()));