From 23fff35aeb4143b73666471d7f79f30d808e2cf2 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 5 May 2012 21:38:01 +0200 Subject: Places Panel: Provide access to devices --- src/panels/places/placesitemmodel.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/panels/places/placesitemmodel.h') diff --git a/src/panels/places/placesitemmodel.h b/src/panels/places/placesitemmodel.h index cd4fd2f75..a50375a69 100644 --- a/src/panels/places/placesitemmodel.h +++ b/src/panels/places/placesitemmodel.h @@ -28,8 +28,10 @@ #include #include #include +#include class KBookmarkManager; +class PlacesItem; class QAction; #ifdef HAVE_NEPOMUK @@ -58,6 +60,8 @@ public: explicit PlacesItemModel(QObject* parent = 0); virtual ~PlacesItemModel(); + PlacesItem* placesItem(int index) const; + void setHiddenItemsShown(bool show); bool hiddenItemsShown() const; @@ -94,9 +98,20 @@ protected: virtual void onItemInserted(int index); virtual void onItemRemoved(int index); +private slots: + void slotDeviceAdded(const QString& udi); + void slotDeviceRemoved(const QString& udi); + private: void loadBookmarks(); + /** + * Helper method for loadBookmarks(): Adds the items + * to the model if the "isHidden"-property is false, + * otherwise the items get added to m_hiddenItems. + */ + void addItems(const QList& items); + /** * Creates system bookmarks that are shown per default and can * only be hidden but not removed. The result will be stored @@ -104,6 +119,8 @@ private: */ void createSystemBookmarks(); + void initializeAvailableDevices(); + /** * @param index Item index related to the model. * @return Corresponding item index related to m_hiddenItems. @@ -153,6 +170,7 @@ private: bool m_hiddenItemsShown; QSet m_availableDevices; + Solid::Predicate m_predicate; KBookmarkManager* m_bookmarkManager; struct SystemBookmarkData @@ -171,7 +189,7 @@ private: QList m_systemBookmarks; QHash m_systemBookmarksIndexes; - QList m_hiddenItems; + QList m_hiddenItems; }; #endif -- cgit v1.3.1