bool supportsDropping(int index) const override;
+ bool canEnterOnHover(int index) const override;
+
QString roleDescription(const QByteArray &role) const override;
QList<QPair<int, QVariant>> groups() const override;
void setMimeTypeFilters(const QStringList &filters);
QStringList mimeTypeFilters() const;
+ void setExcludeMimeTypeFilter(const QStringList &filters);
+ QStringList excludeMimeTypeFilter() const;
+
struct RoleInfo {
QByteArray role;
QString translation;
QString group;
+ QString tooltip;
bool requiresBaloo;
bool requiresIndexer;
};
*/
static QList<RoleInfo> rolesInformation();
+ /** set to true to hide application/x-trash files */
+ void setShowTrashMime(bool show);
+
Q_SIGNALS:
/**
* Is emitted if the loading of a directory has been started. It is
*/
void directoryLoadingCompleted();
+ /**
+ * Is emitted when the model is being refreshed (F5 key press)
+ */
+ void directoryRefreshing();
+
/**
* Is emitted after the loading of a directory has been canceled.
*/
* Is emitted if an error message (e.g. "Unknown location")
* should be shown.
*/
- void errorMessage(const QString &message);
+ void errorMessage(const QString &message, const int kioErrorCode);
/**
* Is emitted if a redirection from the current URL \a oldUrl
ItemData *parent;
};
- enum RemoveItemsBehavior { KeepItemData, DeleteItemData, DeleteItemDataIfUnfiltered };
+ enum RemoveItemsBehavior {
+ KeepItemData,
+ DeleteItemData,
+ DeleteItemDataIfUnfiltered
+ };
void insertItems(QList<ItemData *> &items);
void removeItems(const KItemRangeList &itemRanges, RemoveItemsBehavior behavior);
*/
bool isChildItem(int index) const;
+ void scheduleResortAllItems();
+
/**
* Is invoked by KFileItemModelRolesUpdater and results in emitting the
* sortProgress signal with a percent-value of the progress.
const RoleType roleType;
const KLazyLocalizedString roleTranslation;
const KLazyLocalizedString groupTranslation;
+ const KLazyLocalizedString tooltipTranslation;
const bool requiresBaloo;
const bool requiresIndexer;
};
inline bool KFileItemModel::nameLessThan(const ItemData *a, const ItemData *b)
{
- return a->item.text() < b->item.text();
+ // Split extension, taking into account it can be empty
+ constexpr QString::SectionFlags flags = QString::SectionSkipEmpty | QString::SectionIncludeLeadingSep;
+ return a->item.text().section('.', 0, 0, flags) < b->item.text().section('.', 0, 0, flags);
}
inline bool KFileItemModel::isChildItem(int index) const