diff --git a/src/freebusymodel/freeperiodmodel.cpp b/src/freebusymodel/freeperiodmodel.cpp --- a/src/freebusymodel/freeperiodmodel.cpp +++ b/src/freebusymodel/freeperiodmodel.cpp @@ -132,15 +132,9 @@ } // Perform some jiggery pokery to remove duplicates - - QList tmpList = splitList.toList(); -#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) - const QSet set = tmpList.toSet(); -#else - const QSet set = QSet(tmpList.begin(), tmpList.end()); -#endif - tmpList = QList::fromSet(set); - return KCalendarCore::Period::List::fromList(tmpList); + std::sort(splitList.begin(), splitList.end()); + splitList.erase(std::unique(splitList.begin(), splitList.end()), splitList.end()); + return splitList; } QString FreePeriodModel::day(int index) const