From b419cfc5974192f3445b6a439b40bae4af119615 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 28 Apr 2012 23:58:56 +0200 Subject: Places Panel fixes Implement adding, editing and removing of entries. Note that the result currently is still not stored in bookmarks.xml (this needs to wait until the hiding is implemented in the model). --- src/panels/places/placesitemmodel.h | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'src/panels/places/placesitemmodel.h') diff --git a/src/panels/places/placesitemmodel.h b/src/panels/places/placesitemmodel.h index 91678eee5..330e754b0 100644 --- a/src/panels/places/placesitemmodel.h +++ b/src/panels/places/placesitemmodel.h @@ -52,15 +52,34 @@ public: int hiddenCount() const; + /** + * @return True if the item is a default item created by + * the system (e.g. the places for home, root, trash etc.) + */ + bool isSystemItem(int index) const; + + /** + * Search the item which is equal to the URL or at least + * is a parent URL. If there are more than one possible + * candidates, return the item which covers the biggest + * range of the URL. -1 is returned if no closest item + * could be found. + */ + int closestItem(const KUrl& url) const; + + QString placesGroupName() const; + QString recentlyAccessedGroupName() const; + QString searchForGroupName() const; + QAction* ejectAction(int index) const; QAction* tearDownAction(int index) const; private: void loadBookmarks(); - void createDefaultBookmarks(); + void createSystemBookmarks(); - KUrl translatedDefaultBookmarkUrl(const KUrl& url) const; + KUrl translatedSystemBookmarkUrl(const KUrl& url) const; /** * @return URL using the timeline-protocol for searching. @@ -96,9 +115,9 @@ private: QSet m_availableDevices; KBookmarkManager* m_bookmarkManager; - struct DefaultBookmarkData + struct SystemBookmarkData { - DefaultBookmarkData(const KUrl& url, + SystemBookmarkData(const KUrl& url, const QString& icon, const QString& text, const QString& group) : @@ -109,8 +128,8 @@ private: QString group; }; - QList m_defaultBookmarks; - QHash m_defaultBookmarksIndexes; + QList m_systemBookmarks; + QHash m_systemBookmarksIndexes; }; #endif -- cgit v1.3.1