┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinplacesmodelsingleton.h
diff options
context:
space:
mode:
authorKai Uwe Broulik <[email protected]>2021-12-16 19:29:22 +0100
committerKai Uwe Broulik <[email protected]>2022-01-09 18:09:10 +0100
commit0603e18cd4e36b988196a99810f2e3e803fe3125 (patch)
tree6d70829efea053cb36c9e6618d8feadd45569a91 /src/dolphinplacesmodelsingleton.h
parent3abc4cfcd49df45c856e1b5f01da8de8f970ccb2 (diff)
Port back to KFilePlacesView
This removes the custom-view engine version of the places panel and replaces it with the upstream `KFilePlacesView` from KIO.
Diffstat (limited to 'src/dolphinplacesmodelsingleton.h')
-rw-r--r--src/dolphinplacesmodelsingleton.h28
1 files changed, 27 insertions, 1 deletions
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 <QString>
#include <QScopedPointer>
-class KFilePlacesModel;
+#include <KFilePlacesModel>
+
+/**
+ * @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.