diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.5) -set(PIM_VERSION "5.11.40") +set(PIM_VERSION "5.11.41") project(KCalCore VERSION ${PIM_VERSION}) diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt --- a/autotests/CMakeLists.txt +++ b/autotests/CMakeLists.txt @@ -34,7 +34,6 @@ testfreebusyperiod testperson testrecurtodo - testsortablelist testtodo testtimesininterval testcreateddatecompat diff --git a/autotests/testsortablelist.h b/autotests/testsortablelist.h deleted file mode 100644 --- a/autotests/testsortablelist.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - This file is part of the kcalcore library. - - Copyright (c) 2006 David Jarvie - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef TESTSORTABLELIST_H -#define TESTSORTABLELIST_H - -#include - -class SortableListTest : public QObject -{ - Q_OBJECT -private Q_SLOTS: - void general(); -}; - -#endif diff --git a/autotests/testsortablelist.cpp b/autotests/testsortablelist.cpp deleted file mode 100644 --- a/autotests/testsortablelist.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/* - This file is part of the kcalcore library. - - Copyright (c) 2006 David Jarvie - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "testsortablelist.h" -#include "sortablelist.h" - -#include - -#include -QTEST_MAIN(SortableListTest) - -using namespace KCalCore; - -void SortableListTest::general() -{ - SortableList list; - list << 10 << 8 << 6 << 4 << 6 << 3 << 10 << 6 << 1; - list.sortUnique(); - QCOMPARE(list.count(), 6); - QCOMPARE(list[0], 1); - QCOMPARE(list[1], 3); - QCOMPARE(list[2], 4); - QCOMPARE(list[3], 6); - QCOMPARE(list[4], 8); - QCOMPARE(list[5], 10); - - QVERIFY(!list.containsSorted(0)); - QVERIFY(list.containsSorted(1)); - QVERIFY(!list.containsSorted(2)); - QVERIFY(list.containsSorted(3)); - QVERIFY(list.containsSorted(4)); - QVERIFY(!list.containsSorted(5)); - QVERIFY(list.containsSorted(6)); - QVERIFY(!list.containsSorted(7)); - QVERIFY(list.containsSorted(8)); - QVERIFY(!list.containsSorted(9)); - QVERIFY(list.containsSorted(10)); - QVERIFY(!list.containsSorted(11)); - - QCOMPARE(list.findSorted(0), -1); - QCOMPARE(list.findSorted(1), 0); - QCOMPARE(list.findSorted(2), -1); - QCOMPARE(list.findSorted(3), 1); - QCOMPARE(list.findSorted(4), 2); - QCOMPARE(list.findSorted(5), -1); - QCOMPARE(list.findSorted(6), 3); - QCOMPARE(list.findSorted(7), -1); - QCOMPARE(list.findSorted(8), 4); - QCOMPARE(list.findSorted(9), -1); - QCOMPARE(list.findSorted(10), 5); - QCOMPARE(list.findSorted(11), -1); - - QCOMPARE(list.findLT(0), -1); - QCOMPARE(list.findLT(1), -1); - QCOMPARE(list.findLT(2), 0); - QCOMPARE(list.findLT(3), 0); - QCOMPARE(list.findLT(4), 1); - QCOMPARE(list.findLT(5), 2); - QCOMPARE(list.findLT(6), 2); - QCOMPARE(list.findLT(7), 3); - QCOMPARE(list.findLT(8), 3); - QCOMPARE(list.findLT(9), 4); - QCOMPARE(list.findLT(10), 4); - QCOMPARE(list.findLT(11), 5); - - QCOMPARE(list.findLE(0), -1); - QCOMPARE(list.findLE(1), 0); - QCOMPARE(list.findLE(2), 0); - QCOMPARE(list.findLE(3), 1); - QCOMPARE(list.findLE(4), 2); - QCOMPARE(list.findLE(5), 2); - QCOMPARE(list.findLE(6), 3); - QCOMPARE(list.findLE(7), 3); - QCOMPARE(list.findLE(8), 4); - QCOMPARE(list.findLE(9), 4); - QCOMPARE(list.findLE(10), 5); - QCOMPARE(list.findLE(11), 5); - - QCOMPARE(list.findGE(0), 0); - QCOMPARE(list.findGE(1), 0); - QCOMPARE(list.findGE(2), 1); - QCOMPARE(list.findGE(3), 1); - QCOMPARE(list.findGE(4), 2); - QCOMPARE(list.findGE(5), 3); - QCOMPARE(list.findGE(6), 3); - QCOMPARE(list.findGE(7), 4); - QCOMPARE(list.findGE(8), 4); - QCOMPARE(list.findGE(9), 5); - QCOMPARE(list.findGE(10), 5); - QCOMPARE(list.findGE(11), -1); - - QCOMPARE(list.findGT(0), 0); - QCOMPARE(list.findGT(1), 1); - QCOMPARE(list.findGT(2), 1); - QCOMPARE(list.findGT(3), 2); - QCOMPARE(list.findGT(4), 3); - QCOMPARE(list.findGT(5), 3); - QCOMPARE(list.findGT(6), 4); - QCOMPARE(list.findGT(7), 4); - QCOMPARE(list.findGT(8), 5); - QCOMPARE(list.findGT(9), 5); - QCOMPARE(list.findGT(10), -1); - QCOMPARE(list.findGT(11), -1); - - QCOMPARE(list.insertSorted(4), 2); - QCOMPARE(list.count(), 6); - QCOMPARE(list[2], 4); - QCOMPARE(list.insertSorted(0), 0); - QCOMPARE(list.count(), 7); - QCOMPARE(list[0], 0); - QCOMPARE(list.insertSorted(7), 5); - QCOMPARE(list.count(), 8); - QCOMPARE(list[5], 7); - QCOMPARE(list.insertSorted(14), 8); - QCOMPARE(list.count(), 9); - QCOMPARE(list[8], 14); - - QCOMPARE(list.removeSorted(7), 5); - QCOMPARE(list.count(), 8); - QCOMPARE(list[5], 8); - QCOMPARE(list.removeSorted(5), -1); - QCOMPARE(list.count(), 8); - QCOMPARE(list.removeSorted(0), 0); - QCOMPARE(list.count(), 7); - QCOMPARE(list[0], 1); -} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -93,7 +93,6 @@ Recurrence RecurrenceRule ScheduleMessage - SortableList Sorting Todo VCalFormat diff --git a/src/incidencebase.h b/src/incidencebase.h --- a/src/incidencebase.h +++ b/src/incidencebase.h @@ -59,7 +59,6 @@ #include "attendee.h" #include "customproperties.h" #include "duration.h" -#include "sortablelist.h" #include @@ -73,10 +72,10 @@ namespace KCalCore { /** List of dates */ -typedef SortableList DateList; +typedef QList DateList; /** List of times */ -typedef SortableList DateTimeList; +typedef QList DateTimeList; class Event; class Todo; diff --git a/src/recurrence.h b/src/recurrence.h --- a/src/recurrence.h +++ b/src/recurrence.h @@ -244,7 +244,7 @@ * @param end inclusive end of interval * @return list of date/time values */ - Q_REQUIRED_RESULT SortableList timesInInterval(const QDateTime &start, const QDateTime &end) const; + Q_REQUIRED_RESULT QList timesInInterval(const QDateTime &start, const QDateTime &end) const; /** Returns the date and time of the next recurrence, after the specified date/time. * If the recurrence has no time, the next date after the specified date is returned. @@ -616,17 +616,17 @@ void deleteExRule(RecurrenceRule *exrule); // RDATE - Q_REQUIRED_RESULT SortableList rDateTimes() const; + Q_REQUIRED_RESULT QList rDateTimes() const; Q_REQUIRED_RESULT DateList rDates() const; - void setRDateTimes(const SortableList &rdates); + void setRDateTimes(const QList &rdates); void setRDates(const DateList &rdates); void addRDateTime(const QDateTime &rdate); void addRDate(const QDate &rdate); // ExDATE - Q_REQUIRED_RESULT SortableList exDateTimes() const; + Q_REQUIRED_RESULT QList exDateTimes() const; Q_REQUIRED_RESULT DateList exDates() const; - void setExDateTimes(const SortableList &exdates); + void setExDateTimes(const QList &exdates); void setExDates(const DateList &exdates); void addExDateTime(const QDateTime &exdate); void addExDate(const QDate &exdate); diff --git a/src/recurrence.cpp b/src/recurrence.cpp --- a/src/recurrence.cpp +++ b/src/recurrence.cpp @@ -22,12 +22,12 @@ Boston, MA 02110-1301, USA. */ #include "recurrence.h" -#include "sortablelist.h" #include "utils.h" #include "recurrencehelper_p.h" #include "kcalcore_debug.h" +#include #include #include #include @@ -61,9 +61,9 @@ RecurrenceRule::List mExRules; RecurrenceRule::List mRRules; - SortableList mRDateTimes; + QList mRDateTimes; DateList mRDates; - SortableList mExDateTimes; + QList mExDateTimes; DateList mExDates; QDateTime mStartDateTime; // date/time of first recurrence QList mObservers; @@ -428,7 +428,7 @@ rdates, an invalid date is returned. */ QDateTime Recurrence::endDateTime() const { - SortableList dts; + QList dts; dts << startDateTime(); if (!d->mRDates.isEmpty()) { dts << QDateTime(d->mRDates.last(), QTime(0, 0, 0), d->mStartDateTime.timeZone()); @@ -1053,10 +1053,10 @@ return times; } -SortableList Recurrence::timesInInterval(const QDateTime &start, const QDateTime &end) const +QList Recurrence::timesInInterval(const QDateTime &start, const QDateTime &end) const { int i, count; - SortableList times; + QList times; for (i = 0, count = d->mRRules.count(); i < count; ++i) { times += d->mRRules[i]->timesInInterval(start, end); } @@ -1103,7 +1103,7 @@ --enddt; } } - SortableList extimes; + QList extimes; for (i = 0, count = d->mExRules.count(); i < count; ++i) { extimes += d->mExRules[i]->timesInInterval(start, end); } @@ -1135,7 +1135,7 @@ // of preDateTime). Loop at most 1000 times. ++loop; // First, get the next recurrence from the RDate lists - SortableList dates; + QList dates; if (nextDT < startDateTime()) { dates << startDateTime(); } @@ -1206,7 +1206,7 @@ // of preDateTime). Loop at most 1000 times. ++loop; // First, get the next recurrence from the RDate lists - SortableList dates; + QList dates; if (prevDT > startDateTime()) { dates << startDateTime(); } @@ -1337,12 +1337,12 @@ updated(); } -SortableList Recurrence::rDateTimes() const +QList Recurrence::rDateTimes() const { return d->mRDateTimes; } -void Recurrence::setRDateTimes(const SortableList &rdates) +void Recurrence::setRDateTimes(const QList &rdates) { if (d->mRecurReadOnly) { return; @@ -1389,12 +1389,12 @@ updated(); } -SortableList Recurrence::exDateTimes() const +QList Recurrence::exDateTimes() const { return d->mExDateTimes; } -void Recurrence::setExDateTimes(const SortableList &exdates) +void Recurrence::setExDateTimes(const QList &exdates) { if (d->mRecurReadOnly) { return; @@ -1499,8 +1499,8 @@ return out; } - serializeQDateTimeSortableList(out, r->d->mRDateTimes); - serializeQDateTimeSortableList(out, r->d->mExDateTimes); + serializeQDateTimeList(out, r->d->mRDateTimes); + serializeQDateTimeList(out, r->d->mExDateTimes); out << r->d->mRDates; serializeQDateTimeAsKDateTime(out, r->d->mStartDateTime); out << r->d->mCachedType @@ -1526,8 +1526,8 @@ int rruleCount, exruleCount; - deserializeQDateTimeSortableList(in, r->d->mRDateTimes); - deserializeQDateTimeSortableList(in, r->d->mExDateTimes); + deserializeQDateTimeList(in, r->d->mRDateTimes); + deserializeQDateTimeList(in, r->d->mExDateTimes); in >> r->d->mRDates; deserializeKDateTimeAsQDateTime(in, r->d->mStartDateTime); in >> r->d->mCachedType diff --git a/src/recurrencerule.h b/src/recurrencerule.h --- a/src/recurrencerule.h +++ b/src/recurrencerule.h @@ -25,18 +25,17 @@ #define KCALCORE_RECURRENCERULE_H #include "kcalcore_export.h" -#include "sortablelist.h" #include #include class QTimeZone; namespace KCalCore { // These two are duplicates wrt. incidencebase.h -typedef SortableList DateList; +typedef QList DateList; /* List of times */ -typedef SortableList TimeList; +typedef QList TimeList; /** This class represents a recurrence rule for a calendar incidence. @@ -246,7 +245,7 @@ * @param end inclusive end of interval * @return list of date/time values */ - Q_REQUIRED_RESULT SortableList timesInInterval(const QDateTime &start, const QDateTime &end) const; + Q_REQUIRED_RESULT QList timesInInterval(const QDateTime &start, const QDateTime &end) const; /** Returns the date and time of the next recurrence, after the specified date/time. * If the recurrence has no time, the next date after the specified date is returned. diff --git a/src/recurrencerule.cpp b/src/recurrencerule.cpp --- a/src/recurrencerule.cpp +++ b/src/recurrencerule.cpp @@ -24,6 +24,7 @@ #include "kcalcore_debug.h" #include "recurrencehelper_p.h" +#include #include #include #include @@ -725,7 +726,7 @@ bool buildCache() const; Constraint getNextValidDateInterval(const QDateTime &preDate, PeriodType type) const; Constraint getPreviousValidDateInterval(const QDateTime &afterDate, PeriodType type) const; - SortableList datesForInterval(const Constraint &interval, PeriodType type) const; + QList datesForInterval(const Constraint &interval, PeriodType type) const; RecurrenceRule *mParent; QString mRRule; // RRULE string @@ -756,7 +757,7 @@ QList mObservers; // Cache for duration - mutable SortableList mCachedDates; + mutable QList mCachedDates; mutable QDateTime mCachedDateEnd; mutable QDateTime mCachedLastDate; // when mCachedDateEnd invalid, last date checked mutable bool mCached; @@ -1737,12 +1738,12 @@ return QDateTime(); } -SortableList RecurrenceRule::timesInInterval(const QDateTime &dtStart, +QList RecurrenceRule::timesInInterval(const QDateTime &dtStart, const QDateTime &dtEnd) const { const QDateTime start = dtStart.toTimeZone(d->mDateStart.timeZone()); const QDateTime end = dtEnd.toTimeZone(d->mDateStart.timeZone()); - SortableList result; + QList result; if (end < d->mDateStart) { return result; // before start of recurrence } @@ -1987,16 +1988,16 @@ return Constraint(nextValid, type, mWeekStart); } -SortableList RecurrenceRule::Private::datesForInterval(const Constraint &interval, +QList RecurrenceRule::Private::datesForInterval(const Constraint &interval, PeriodType type) const { /* -) Loop through constraints, -) merge interval with each constraint -) if merged constraint is not consistent => ignore that constraint -) if complete => add that one date to the date list -) Loop through all missing fields => For each add the resulting */ - SortableList lst; + QList lst; for (int i = 0, iend = mConstraints.count(); i < iend; ++i) { Constraint merged(interval); if (merged.merge(mConstraints[i])) { diff --git a/src/sortablelist.h b/src/sortablelist.h deleted file mode 100644 --- a/src/sortablelist.h +++ /dev/null @@ -1,301 +0,0 @@ -/* - This file is part of the kcalcore library. - - Copyright (c) 2006 David Jarvie - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ -/** - @file - This file is part of the API for handling calendar data and - defines the Sortable List class. - - @author David Jarvie \. -*/ - -#ifndef KCALCORE_SORTABLELIST_H -#define KCALCORE_SORTABLELIST_H - -#include -#include -#include - -namespace KCalCore -{ - -//@cond PRIVATE -template class T> -void qSortUnique(T &list) -{ - std::sort(list.begin(), list.end()); - list.erase(std::unique(list.begin(), list.end()), list.end()); -} -//@endcond - -/** - @brief A QList which can be sorted - - For a QList is capable of being sorted, SortedList provides additional - optimized methods which can be used when the list is sorted and has no - duplicate entries. - - Because SortableList has no data members, an object may be referred to - interchangeably as either a QList or SortableList. Just bear in mind that - the results of the SortableList methods are undefined when the list is - unsorted or contains duplicate entries. - - To sort the list and remove duplicate entries, thereby allowing use of - other SortableList methods, use sortUnique(). Once sortUnique() has been - called, use findSorted(), containsSorted() and removeSorted() in preference - to QList::indexOf(), QList::contains() and QList::removeAll(). Use findLE(), - findLT(), findGE(), findGT() to find the index to the nearest value in the - list which is <=, <, >= or > a given value. To add a value to the list, - use insertSorted() in preference to insert(), append(), prepend(), - operator<<() or operator+=(). - - @author David Jarvie \. -*/ -template -class SortableList : public QList -{ -public: - /** - Constructs an empty sortable list. - */ - SortableList() {} - - /** - Constructs a sortable list by copying another one. - - @param list is the list to copy. - */ - SortableList(const QList &list) : QList(list) {} // implicit conversion - - /** - Return whether the list contains value @p value. The list must be sorted; - if not, the result is undefined. - When the list is sorted, use this optimised method in preference to - QList::contains(). - - @param value is the value to find. - @return true if list contains @p value; false otherwise. - */ - bool containsSorted(const T &value) const - { - return findSorted(value) >= 0; - } - - /** - Search the list for the item equal to @p value. The list must be sorted; - if not, the result is undefined. - When the list is sorted, use this optimised method in preference to - QList::indexOf(). - - @param value is the value to find. - @param start is the start index for search (default is from beginning). - @return index to item in list, or -1 if @p value not found in the list. - */ - Q_REQUIRED_RESULT int findSorted(const T &value, int start = 0) const; - - /** - Search the list for the last item <= @p value. The list must be sorted; - if not, the result is undefined. - - @param value is the value to find. - @param start is the start index for search (default is from beginning). - @return index to item in list, or -1 if @p value < first value in the list. - */ - Q_REQUIRED_RESULT int findLE(const T &value, int start = 0) const; - - /** - Search the list for the last item < @p value. The list must be sorted; - if not, the result is undefined. - - @param value is the value to find. - @param start is the start index for search (default is from beginning). - @return index to item in list, or -1 if @p value <= first value in the list. - */ - Q_REQUIRED_RESULT int findLT(const T &value, int start = 0) const; - - /** - Search the list for the first item >= @p value. The list must be sorted; - if not, the result is undefined. - - @param value is the value to find. - @param start is the start index for search (default is from beginning). - @return index to item in list, or -1 if @p value > last value in the list. - */ - Q_REQUIRED_RESULT int findGE(const T &value, int start = 0) const; - - /** - Search the list for the first item > @p value. The list must be sorted; - if not, the result is undefined. - - @param value is the value to find. - @param start is the start index for search (default is from beginning). - @return index to item in list, or -1 if @p value >= last value in the list. - */ - Q_REQUIRED_RESULT int findGT(const T &value, int start = 0) const; - - /** - Insert a value in the list, in correct sorted order. If the same value - is already in the list, no change is made. - - The list must already be sorted before calling this method; otherwise - the result is undefined. - - @param value is the value to insert. - @return index to inserted item in list, or to the pre-existing entry - equal to @p value. - */ - Q_REQUIRED_RESULT int insertSorted(const T &value); - - /** - Remove value @p value from the list. The list must be sorted. - When the list is sorted, use this optimised method in preference to - QList::removeAll(). - - @param value is the value to remove. - @param start is the start index for search (default is from beginning). - @return index to removed value, or -1 if not found. - */ - Q_REQUIRED_RESULT int removeSorted(const T &value, int start = 0); - - /** - Sort the list. Any duplicate values are removed. - */ - void sortUnique() - { - qSortUnique(*this); - } -}; - -template -int SortableList::findSorted(const T &value, int start) const -{ - // Do a binary search to find the item == value - int st = start - 1; - int end = QList::count(); - while (end - st > 1) { - int i = (st + end) / 2; - if (value < QList::at(i)) { - end = i; - } else { - st = i; - } - } - return (end > start && value == QList::at(st)) ? st : -1; -} - -template -int SortableList::findLE(const T &value, int start) const -{ - // Do a binary search to find the last item <= value - int st = start - 1; - int end = QList::count(); - while (end - st > 1) { - int i = (st + end) / 2; - if (value < QList::at(i)) { - end = i; - } else { - st = i; - } - } - return (end > start) ? st : -1; -} - -template -int SortableList::findLT(const T &value, int start) const -{ - // Do a binary search to find the last item < value - int st = start - 1; - int end = QList::count(); - while (end - st > 1) { - int i = (st + end) / 2; - if (value <= QList::at(i)) { - end = i; - } else { - st = i; - } - } - return (end > start) ? st : -1; -} - -template -int SortableList::findGE(const T &value, int start) const -{ - // Do a binary search to find the first item >= value - int st = start - 1; - int end = QList::count(); - while (end - st > 1) { - int i = (st + end) / 2; - if (value <= QList::at(i)) { - end = i; - } else { - st = i; - } - } - ++st; - return (st == QList::count()) ? -1 : st; -} - -template -int SortableList::findGT(const T &value, int start) const -{ - // Do a binary search to find the first item > value - int st = start - 1; - int end = QList::count(); - while (end - st > 1) { - int i = (st + end) / 2; - if (value < QList::at(i)) { - end = i; - } else { - st = i; - } - } - ++st; - return (st == QList::count()) ? -1 : st; -} - -template -int SortableList::insertSorted(const T &value) -{ - int i = findLE(value); - if (i < 0 || QList::at(i) != value) { - QList::insert(++i, value); - } - return i; -} - -template -int SortableList::removeSorted(const T &value, int start) -{ - int i = findSorted(value, start); - if (i >= 0) { - QList::removeAt(i); - } - return i; -} - -} // namespace KCalCore - -template -QDataStream &operator<<(QDataStream &stream, const KCalCore::SortableList &list) -{ - return operator<<(stream, static_cast>(list)); -} - -#endif diff --git a/src/utils.h b/src/utils.h --- a/src/utils.h +++ b/src/utils.h @@ -24,8 +24,6 @@ #include "kcalcore_export.h" -#include "sortablelist.h" - #include class QDataStream; @@ -39,8 +37,8 @@ KCALCORE_EXPORT void serializeQDateTimeAsKDateTime(QDataStream &out, const QDateTime &dt); KCALCORE_EXPORT void deserializeKDateTimeAsQDateTime(QDataStream &in, QDateTime &dt); -void serializeQDateTimeSortableList(QDataStream &out, const SortableList &list); -void deserializeQDateTimeSortableList(QDataStream &in, SortableList &list); +void serializeQDateTimeList(QDataStream &out, const QList &list); +void deserializeQDateTimeList(QDataStream &in, QList &list); void serializeQTimeZoneAsSpec(QDataStream &out, const QTimeZone &tz); void deserializeSpecAsQTimeZone(QDataStream &in, QTimeZone &tz); diff --git a/src/utils.cpp b/src/utils.cpp --- a/src/utils.cpp +++ b/src/utils.cpp @@ -112,15 +112,15 @@ } -void KCalCore::serializeQDateTimeSortableList(QDataStream &out, const SortableList &list) +void KCalCore::serializeQDateTimeList(QDataStream &out, const QList &list) { out << list.size(); for (const auto &i : list) { serializeQDateTimeAsKDateTime(out, i); } } -void KCalCore::deserializeQDateTimeSortableList(QDataStream& in, SortableList& list) +void KCalCore::deserializeQDateTimeList(QDataStream& in, QList& list) { int size; in >> size;