Changeset View
Changeset View
Standalone View
Standalone View
src/kitemviews/kfileitemmodel.h
Show First 20 Lines • Show All 254 Lines • ▼ Show 20 Line(s) | 201 | signals: | |||
---|---|---|---|---|---|
255 | /** | 255 | /** | ||
256 | * Is emitted when the URL passed by KFileItemModel::setUrl() represents a file. | 256 | * Is emitted when the URL passed by KFileItemModel::setUrl() represents a file. | ||
257 | * In this case no signal errorMessage() will be emitted. | 257 | * In this case no signal errorMessage() will be emitted. | ||
258 | */ | 258 | */ | ||
259 | void urlIsFileError(const QUrl& url); | 259 | void urlIsFileError(const QUrl& url); | ||
260 | 260 | | |||
261 | protected: | 261 | protected: | ||
262 | void onGroupedSortingChanged(bool current) override; | 262 | void onGroupedSortingChanged(bool current) override; | ||
263 | void onSortRoleChanged(const QByteArray& current, const QByteArray& previous) override; | 263 | void onSortRoleChanged(const QByteArray& current, const QByteArray& previous, bool resortItems = true) override; | ||
264 | void onSortOrderChanged(Qt::SortOrder current, Qt::SortOrder previous) override; | 264 | void onSortOrderChanged(Qt::SortOrder current, Qt::SortOrder previous) override; | ||
265 | 265 | | |||
266 | private slots: | 266 | private slots: | ||
267 | /** | 267 | /** | ||
268 | * Resorts all items dependent on the set sortRole(), sortOrder() | 268 | * Resorts all items dependent on the set sortRole(), sortOrder() | ||
269 | * and foldersFirst() settings. | 269 | * and foldersFirst() settings. | ||
270 | */ | 270 | */ | ||
271 | void resortAllItems(); | 271 | void resortAllItems(); | ||
▲ Show 20 Lines • Show All 94 Lines • ▼ Show 20 Line(s) | 283 | private: | |||
366 | * \b. The item-data may have different parent-items. | 366 | * \b. The item-data may have different parent-items. | ||
367 | */ | 367 | */ | ||
368 | bool lessThan(const ItemData* a, const ItemData* b, const QCollator& collator) const; | 368 | bool lessThan(const ItemData* a, const ItemData* b, const QCollator& collator) const; | ||
369 | 369 | | |||
370 | /** | 370 | /** | ||
371 | * Sorts the items between \a begin and \a end using the comparison | 371 | * Sorts the items between \a begin and \a end using the comparison | ||
372 | * function lessThan(). | 372 | * function lessThan(). | ||
373 | */ | 373 | */ | ||
374 | void sort(QList<ItemData*>::iterator begin, QList<ItemData*>::iterator end) const; | 374 | void sort(const QList<ItemData*>::iterator &begin, const QList<ItemData*>::iterator &end) const; | ||
375 | 375 | | |||
376 | /** | 376 | /** | ||
377 | * Helper method for lessThan() and expandedParentsCountCompare(): Compares | 377 | * Helper method for lessThan() and expandedParentsCountCompare(): Compares | ||
378 | * the passed item-data using m_sortRole as criteria. Both items must | 378 | * the passed item-data using m_sortRole as criteria. Both items must | ||
379 | * have the same parent item, otherwise the comparison will be wrong. | 379 | * have the same parent item, otherwise the comparison will be wrong. | ||
380 | */ | 380 | */ | ||
381 | int sortRoleCompare(const ItemData* a, const ItemData* b, const QCollator& collator) const; | 381 | int sortRoleCompare(const ItemData* a, const ItemData* b, const QCollator& collator) const; | ||
382 | 382 | | |||
383 | int stringCompare(const QString& a, const QString& b, const QCollator& collator) const; | 383 | int stringCompare(const QString& a, const QString& b, const QCollator& collator) const; | ||
384 | 384 | | |||
385 | bool useMaximumUpdateInterval() const; | 385 | bool useMaximumUpdateInterval() const; | ||
386 | 386 | | |||
387 | QList<QPair<int, QVariant> > nameRoleGroups() const; | 387 | QList<QPair<int, QVariant> > nameRoleGroups() const; | ||
388 | QList<QPair<int, QVariant> > sizeRoleGroups() const; | 388 | QList<QPair<int, QVariant> > sizeRoleGroups() const; | ||
389 | QList<QPair<int, QVariant> > timeRoleGroups(std::function<QDateTime(const ItemData *)> fileTimeCb) const; | 389 | QList<QPair<int, QVariant> > timeRoleGroups(const std::function<QDateTime(const ItemData *)> &fileTimeCb) const; | ||
390 | QList<QPair<int, QVariant> > permissionRoleGroups() const; | 390 | QList<QPair<int, QVariant> > permissionRoleGroups() const; | ||
391 | QList<QPair<int, QVariant> > ratingRoleGroups() const; | 391 | QList<QPair<int, QVariant> > ratingRoleGroups() const; | ||
392 | QList<QPair<int, QVariant> > genericStringRoleGroups(const QByteArray& typeForRole) const; | 392 | QList<QPair<int, QVariant> > genericStringRoleGroups(const QByteArray& typeForRole) const; | ||
393 | 393 | | |||
394 | /** | 394 | /** | ||
395 | * Helper method for all xxxRoleGroups() methods to check whether the | 395 | * Helper method for all xxxRoleGroups() methods to check whether the | ||
396 | * item with the given index is a child-item. A child-item is defined | 396 | * item with the given index is a child-item. A child-item is defined | ||
397 | * as item having an expansion-level > 0. All xxxRoleGroups() methods | 397 | * as item having an expansion-level > 0. All xxxRoleGroups() methods | ||
▲ Show 20 Lines • Show All 129 Lines • Show Last 20 Lines |