diff options
| author | Peter Penz <[email protected]> | 2012-04-28 23:58:56 +0200 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2012-04-29 00:00:38 +0200 |
| commit | b419cfc5974192f3445b6a439b40bae4af119615 (patch) | |
| tree | 3e31094427b7f54fd6ffb5771890ed02e0662795 /src/panels/places/placesitemmodel.h | |
| parent | 0a00f13bf246d37182dafcd053776048f63d2299 (diff) | |
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).
Diffstat (limited to 'src/panels/places/placesitemmodel.h')
| -rw-r--r-- | src/panels/places/placesitemmodel.h | 31 |
1 files changed, 25 insertions, 6 deletions
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<QString> 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<DefaultBookmarkData> m_defaultBookmarks; - QHash<KUrl, int> m_defaultBookmarksIndexes; + QList<SystemBookmarkData> m_systemBookmarks; + QHash<KUrl, int> m_systemBookmarksIndexes; }; #endif |
