From 0603e18cd4e36b988196a99810f2e3e803fe3125 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Thu, 16 Dec 2021 19:29:22 +0100 Subject: Port back to KFilePlacesView This removes the custom-view engine version of the places panel and replaces it with the upstream `KFilePlacesView` from KIO. --- src/dolphinplacesmodelsingleton.h | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'src/dolphinplacesmodelsingleton.h') diff --git a/src/dolphinplacesmodelsingleton.h b/src/dolphinplacesmodelsingleton.h index 645947aaa..7efe6e093 100644 --- a/src/dolphinplacesmodelsingleton.h +++ b/src/dolphinplacesmodelsingleton.h @@ -10,7 +10,33 @@ #include #include -class KFilePlacesModel; +#include + +/** + * @brief Dolphin's special-cased KFilePlacesModel + * + * It returns the trash's icon based on whether + * it is full or not. + */ +class DolphinPlacesModel : public KFilePlacesModel +{ + Q_OBJECT + +public: + explicit DolphinPlacesModel(const QString &alternativeApplicationName, QObject *parent = nullptr); + ~DolphinPlacesModel() override; + +protected: + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + +private Q_SLOTS: + void slotTrashEmptinessChanged(bool isEmpty); + +private: + bool isTrash(const QModelIndex &index) const; + + bool m_isEmpty = false; +}; /** * @brief Provides a global KFilePlacesModel instance. -- cgit v1.3