diff --git a/messagelist/src/core/manager.h b/messagelist/src/core/manager.h --- a/messagelist/src/core/manager.h +++ b/messagelist/src/core/manager.h @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include @@ -61,8 +61,8 @@ private: static Manager *mInstance; QList< Widget * > mWidgetList; - QHash< QString, Aggregation * > mAggregations; - QHash< QString, Theme * > mThemes; + QMap< QString, Aggregation * > mAggregations; + QMap< QString, Theme * > mThemes; KMime::DateFormatter *mDateFormatter = nullptr; QString mCachedLocalizedUnknownText; @@ -102,7 +102,7 @@ void addAggregation(Aggregation *set); void removeAllAggregations(); - const QHash< QString, Aggregation * > &aggregations() const + const QMap< QString, Aggregation * > &aggregations() const { return mAggregations; } @@ -132,7 +132,7 @@ void addTheme(Theme *set); void removeAllThemes(); - const QHash< QString, Theme * > &themes() const + const QMap< QString, Theme * > &themes() const { return mThemes; } diff --git a/messagelist/src/core/manager.cpp b/messagelist/src/core/manager.cpp --- a/messagelist/src/core/manager.cpp +++ b/messagelist/src/core/manager.cpp @@ -128,7 +128,7 @@ } // try just the first one - QHash< QString, Aggregation * >::ConstIterator it = mAggregations.constBegin(); + QMap< QString, Aggregation * >::ConstIterator it = mAggregations.constBegin(); if (it != mAggregations.constEnd()) { return *it; } @@ -379,8 +379,8 @@ void Manager::removeAllAggregations() { - QHash< QString, Aggregation * >::ConstIterator end(mAggregations.constEnd()); - for (QHash< QString, Aggregation * >::ConstIterator it = mAggregations.constBegin(); it != end; ++it) { + QMap< QString, Aggregation * >::ConstIterator end(mAggregations.constEnd()); + for (QMap< QString, Aggregation * >::ConstIterator it = mAggregations.constBegin(); it != end; ++it) { delete(*it); } @@ -448,7 +448,7 @@ } // try just the first one - QHash< QString, Theme * >::ConstIterator it = mThemes.constBegin(); + QMap< QString, Theme * >::ConstIterator it = mThemes.constBegin(); if (it != mThemes.constEnd()) { return *it; } @@ -807,8 +807,8 @@ void Manager::removeAllThemes() { - QHash< QString, Theme * >::ConstIterator end(mThemes.constEnd()); - for (QHash< QString, Theme * >::ConstIterator it = mThemes.constBegin(); it != end; ++it) { + QMap< QString, Theme * >::ConstIterator end(mThemes.constEnd()); + for (QMap< QString, Theme * >::ConstIterator it = mThemes.constBegin(); it != end; ++it) { delete(*it); } @@ -950,8 +950,8 @@ conf.writeEntry("Count", mAggregations.count()); int idx = 0; - QHash< QString, Aggregation * >::ConstIterator end(mAggregations.end()); - for (QHash< QString, Aggregation * >::ConstIterator it = mAggregations.constBegin(); it != end; ++it) { + QMap< QString, Aggregation * >::ConstIterator end(mAggregations.end()); + for (QMap< QString, Aggregation * >::ConstIterator it = mAggregations.constBegin(); it != end; ++it) { conf.writeEntry(QStringLiteral("Set%1").arg(idx), (*it)->saveToString()); ++idx; } @@ -966,8 +966,8 @@ conf.writeEntry("Count", mThemes.count()); int idx = 0; - QHash< QString, Theme * >::ConstIterator end(mThemes.constEnd()); - for (QHash< QString, Theme * >::ConstIterator it = mThemes.constBegin(); it != end; ++it) { + QMap< QString, Theme * >::ConstIterator end(mThemes.constEnd()); + for (QMap< QString, Theme * >::ConstIterator it = mThemes.constBegin(); it != end; ++it) { conf.writeEntry(QStringLiteral("Set%1").arg(idx), (*it)->saveToString()); ++idx; } diff --git a/messagelist/src/utils/configureaggregationsdialog.cpp b/messagelist/src/utils/configureaggregationsdialog.cpp --- a/messagelist/src/utils/configureaggregationsdialog.cpp +++ b/messagelist/src/utils/configureaggregationsdialog.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include @@ -258,9 +258,9 @@ if (!Manager::instance()) { return; } - const QHash< QString, Aggregation * > &sets = Manager::instance()->aggregations(); - QHash< QString, Aggregation * >::ConstIterator end(sets.constEnd()); - for (QHash< QString, Aggregation * >::ConstIterator it = sets.constBegin(); it != end; ++it) { + const QMap< QString, Aggregation * > &sets = Manager::instance()->aggregations(); + QMap< QString, Aggregation * >::ConstIterator end(sets.constEnd()); + for (QMap< QString, Aggregation * >::ConstIterator it = sets.constBegin(); it != end; ++it) { (void)new AggregationListWidgetItem(mAggregationList, *(*it)); } } diff --git a/messagelist/src/utils/configurethemesdialog.cpp b/messagelist/src/utils/configurethemesdialog.cpp --- a/messagelist/src/utils/configurethemesdialog.cpp +++ b/messagelist/src/utils/configurethemesdialog.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include @@ -256,10 +256,10 @@ void ConfigureThemesDialog::Private::fillThemeList() { - const QHash< QString, Theme * > &sets = Manager::instance()->themes(); + const QMap< QString, Theme * > &sets = Manager::instance()->themes(); - QHash< QString, Theme * >::ConstIterator end(sets.constEnd()); - for (QHash< QString, Theme * >::ConstIterator it = sets.constBegin(); it != end; ++it) { + QMap< QString, Theme * >::ConstIterator end(sets.constEnd()); + for (QMap< QString, Theme * >::ConstIterator it = sets.constBegin(); it != end; ++it) { (void)new ThemeListWidgetItem(mThemeList, *(*it)); } }