Commit 7cc57d6a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port some deprecated methods

parent 6e3071bc
Pipeline #80036 passed with stage
in 13 minutes and 59 seconds
...@@ -746,7 +746,9 @@ void ResourceBase::requestItemDelivery(const QVector<qint64> &uids, const QByteA ...@@ -746,7 +746,9 @@ void ResourceBase::requestItemDelivery(const QVector<qint64> &uids, const QByteA
return Item{uid}; return Item{uid};
}) })
| Actions::toQVector; | Actions::toQVector;
d->scheduler->scheduleItemsFetch(items, QSet<QByteArray>::fromList(parts), message());
const QSet<QByteArray> partSet = QSet<QByteArray>(parts.begin(), parts.end());
d->scheduler->scheduleItemsFetch(items, partSet, message());
} }
void ResourceBase::collectionsRetrieved(const Collection::List &collections) void ResourceBase::collectionsRetrieved(const Collection::List &collections)
......
...@@ -293,7 +293,7 @@ void SearchManager::updateSearchImpl(const Collection &collection) ...@@ -293,7 +293,7 @@ void SearchManager::updateSearchImpl(const Collection &collection)
} }
// Query all plugins for search results // Query all plugins for search results
const QByteArray id = "searchUpdate-" + QByteArray::number(QDateTime::currentDateTimeUtc().toTime_t()); const QByteArray id = "searchUpdate-" + QByteArray::number(QDateTime::currentDateTimeUtc().toSecsSinceEpoch());
SearchRequest request(id, *this, mAgentSearchManager); SearchRequest request(id, *this, mAgentSearchManager);
request.setCollections(queryCollections); request.setCollections(queryCollections);
request.setMimeTypes(queryMimeTypes); request.setMimeTypes(queryMimeTypes);
......
...@@ -79,7 +79,7 @@ bool DbInitializer::run() ...@@ -79,7 +79,7 @@ bool DbInitializer::run()
// Now finally check and set the generation identifier if necessary // Now finally check and set the generation identifier if necessary
SchemaVersion version = SchemaVersion::retrieveAll().at(0); SchemaVersion version = SchemaVersion::retrieveAll().at(0);
if (version.generation() == 0) { if (version.generation() == 0) {
version.setGeneration(QDateTime::currentDateTimeUtc().toTime_t()); version.setGeneration(QDateTime::currentDateTimeUtc().toSecsSinceEpoch());
version.update(); version.update();
qCDebug(AKONADISERVER_LOG) << "Generation:" << version.generation(); qCDebug(AKONADISERVER_LOG) << "Generation:" << version.generation();
......
...@@ -1534,14 +1534,20 @@ public: ...@@ -1534,14 +1534,20 @@ public:
const bool isItemAction = (type == CopyItemToMenu || type == MoveItemToMenu); const bool isItemAction = (type == CopyItemToMenu || type == MoveItemToMenu);
const bool isCollectionAction = (type == CopyCollectionToMenu || type == MoveCollectionToMenu); const bool isCollectionAction = (type == CopyCollectionToMenu || type == MoveCollectionToMenu);
const bool canContainRequiredMimeTypes = collection.contentMimeTypes().toSet().intersects(mimeTypes); const auto contentMimeTypesList{collection.contentMimeTypes()};
const QSet<QString> contentMimeTypesSet = QSet<QString>(contentMimeTypesList.cbegin(), contentMimeTypesList.cend());
const bool canContainRequiredMimeTypes = contentMimeTypesSet.intersects(mimeTypes);
const bool canCreateNewItems = (collection.rights() & Collection::CanCreateItem); const bool canCreateNewItems = (collection.rights() & Collection::CanCreateItem);
const bool canCreateNewCollections = (collection.rights() & Collection::CanCreateCollection); const bool canCreateNewCollections = (collection.rights() & Collection::CanCreateCollection);
const bool canContainCollections = const bool canContainCollections =
collection.contentMimeTypes().contains(Collection::mimeType()) || collection.contentMimeTypes().contains(Collection::virtualMimeType()); collection.contentMimeTypes().contains(Collection::mimeType()) || collection.contentMimeTypes().contains(Collection::virtualMimeType());
const bool resourceAllowsRequiredMimeTypes = AgentManager::self()->instance(collection.resource()).type().mimeTypes().toSet().contains(mimeTypes); const auto mimeTypesList{AgentManager::self()->instance(collection.resource()).type().mimeTypes()};
const QSet<QString> mimeTypesListSet = QSet<QString>(mimeTypesList.cbegin(), mimeTypesList.cend());
const bool resourceAllowsRequiredMimeTypes = mimeTypesListSet.contains(mimeTypes);
const bool isReadOnlyForItems = (isItemAction && (!canCreateNewItems || !canContainRequiredMimeTypes)); const bool isReadOnlyForItems = (isItemAction && (!canCreateNewItems || !canContainRequiredMimeTypes));
const bool isReadOnlyForCollections = (isCollectionAction && (!canCreateNewCollections || !canContainCollections || !resourceAllowsRequiredMimeTypes)); const bool isReadOnlyForCollections = (isCollectionAction && (!canCreateNewCollections || !canContainCollections || !resourceAllowsRequiredMimeTypes));
......
Supports Markdown
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