┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels/places/placesitemmodel.h
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2012-05-05 21:38:01 +0200
committerPeter Penz <[email protected]>2012-05-05 21:38:37 +0200
commit23fff35aeb4143b73666471d7f79f30d808e2cf2 (patch)
tree0788f8688b5579fa7f689a3b04d13b8561dcdd37 /src/panels/places/placesitemmodel.h
parent067642a23cfd759442a541335e42cef0e8c09e7f (diff)
Places Panel: Provide access to devices
Diffstat (limited to 'src/panels/places/placesitemmodel.h')
-rw-r--r--src/panels/places/placesitemmodel.h20
1 files changed, 19 insertions, 1 deletions
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 <QHash>
#include <QList>
#include <QSet>
+#include <Solid/Predicate>
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,16 +98,29 @@ 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<PlacesItem*>& items);
+
+ /**
* Creates system bookmarks that are shown per default and can
* only be hidden but not removed. The result will be stored
* in m_systemBookmarks.
*/
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<QString> m_availableDevices;
+ Solid::Predicate m_predicate;
KBookmarkManager* m_bookmarkManager;
struct SystemBookmarkData
@@ -171,7 +189,7 @@ private:
QList<SystemBookmarkData> m_systemBookmarks;
QHash<KUrl, int> m_systemBookmarksIndexes;
- QList<KStandardItem*> m_hiddenItems;
+ QList<PlacesItem*> m_hiddenItems;
};
#endif