Commit 595b58fb authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix some qtc6 compile error

parent 0c743410
Pipeline #140079 passed with stage
in 7 minutes and 58 seconds
......@@ -29,7 +29,7 @@
#include <KAboutData>
#include <kcoreaddons_version.h>
#if KCOREADDONS_VERSION < QT_VERSION_CHECK(6, 0, 0)
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <Kdelibs4ConfigMigrator>
#endif
......@@ -340,7 +340,7 @@ AgentBasePrivate::~AgentBasePrivate()
void AgentBasePrivate::init()
{
Q_Q(AgentBase);
#if KCOREADDONS_VERSION < QT_VERSION_CHECK(6, 0, 0)
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
Kdelibs4ConfigMigrator migrate(mId);
migrate.setConfigFiles(QStringList() << QStringLiteral("%1rc").arg(mId));
migrate.migrate();
......
......@@ -845,11 +845,19 @@ namespace
bool sortCollectionsForSync(const Collection &l, const Collection &r)
{
const auto lType = l.hasAttribute<SpecialCollectionAttribute>() ? l.attribute<SpecialCollectionAttribute>()->collectionType() : QByteArray();
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
const bool lInbox = (lType == "inbox") || (l.remoteId().midRef(1).compare(QLatin1String("inbox"), Qt::CaseInsensitive) == 0);
#else
const bool lInbox = (lType == "inbox") || (QStringView(l.remoteId()).mid(1).compare(QLatin1String("inbox"), Qt::CaseInsensitive) == 0);
#endif
const bool lFav = l.hasAttribute<FavoriteCollectionAttribute>();
const auto rType = r.hasAttribute<SpecialCollectionAttribute>() ? r.attribute<SpecialCollectionAttribute>()->collectionType() : QByteArray();
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
const bool rInbox = (rType == "inbox") || (r.remoteId().midRef(1).compare(QLatin1String("inbox"), Qt::CaseInsensitive) == 0);
#else
const bool rInbox = (rType == "inbox") || (QStringView(r.remoteId()).mid(1).compare(QLatin1String("inbox"), Qt::CaseInsensitive) == 0);
#endif
const bool rFav = r.hasAttribute<FavoriteCollectionAttribute>();
// inbox is always first
......
......@@ -117,7 +117,11 @@ void TrashJobPrivate::setAttribute(const Akonadi::Item::List &list)
{
Q_Q(TrashJob);
Item::List items = list;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QMutableVectorIterator<Item> i(items);
#else
QMutableListIterator<Item> i(items);
#endif
while (i.hasNext()) {
const Item &item = i.next();
auto eda = new EntityDeletedAttribute();
......@@ -221,8 +225,11 @@ void TrashJobPrivate::itemsReceived(const Akonadi::Item::List &items)
}
Item::List toDelete;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QVectorIterator<Item> i(items);
#else
QListIterator<Item> i(items);
#endif
while (i.hasNext()) {
const Item &item = i.next();
if (item.hasAttribute<EntityDeletedAttribute>()) {
......
......@@ -272,7 +272,11 @@ void TrashRestoreJobPrivate::removeAttribute(const Akonadi::Item::List &list)
{
Q_Q(TrashRestoreJob);
Item::List items = list;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QMutableVectorIterator<Item> i(items);
#else
QMutableListIterator<Item> i(items);
#endif
while (i.hasNext()) {
Item &item = i.next();
item.removeAttribute<EntityDeletedAttribute>();
......
......@@ -294,7 +294,7 @@ install(TARGETS akonadiserver
install(FILES
storage/mysql-global.conf
storage/mysql-global-mobile.conf
DESTINATION ${CONFIG_INSTALL_DIR}/akonadi
DESTINATION ${KDE_INSTALL_CONFDIR}/akonadi
)
install(FILES
......
......@@ -303,7 +303,7 @@ void CollectionFetchHandler::retrieveCollections(const Collection &topParent, in
QVariantList mimeTypeIds;
QVariantList attributeIds;
QVariantList ancestorIds;
const int collectionSize{mCollections.size()};
const auto collectionSize{mCollections.size()};
mimeTypeIds.reserve(collectionSize);
attributeIds.reserve(collectionSize);
// We'd only require the non-leaf collections, but we don't know which those are, so we take all.
......
......@@ -10,7 +10,7 @@ target_sources(akonadi_shared PRIVATE
akdebug.h
akremotelog.h
)
set_property(TARGET akonadi_shared PROPERTY POSITION_INDEPENDENT_CODE ON)
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(akonadi_shared PROPERTIES UNITY_BUILD ON)
endif()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment