From 6e9713c558ad07b0baa2a79ae69328fda7b61a15 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sun, 13 May 2012 23:29:28 +0200 Subject: PlacesItemModel: Remove setItemHidden and isItemHidden This should be handled automatically when the hidden-state of the item itself gets toggled. --- src/panels/places/placesitemmodel.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/panels/places/placesitemmodel.h') diff --git a/src/panels/places/placesitemmodel.h b/src/panels/places/placesitemmodel.h index 14d0accc1..e9604ad22 100644 --- a/src/panels/places/placesitemmodel.h +++ b/src/panels/places/placesitemmodel.h @@ -35,7 +35,7 @@ class KBookmarkManager; class PlacesItem; class QAction; -#define PLACESITEMMODEL_DEBUG +// #define PLACESITEMMODEL_DEBUG /** * @brief Model for maintaining the bookmarks of the places panel. @@ -58,9 +58,6 @@ public: int hiddenCount() const; - void setItemHidden(int index, bool hide); - bool isItemHidden(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 @@ -90,12 +87,13 @@ signals: protected: virtual void onItemInserted(int index); virtual void onItemRemoved(int index); - virtual void onItemReplaced(int index); + virtual void onItemChanged(int index, const QSet& changedRoles); private slots: void slotDeviceAdded(const QString& udi); void slotDeviceRemoved(const QString& udi); void slotStorageTeardownDone(Solid::ErrorType error, const QVariant& errorData); + void removeHiddenItem(); private: void loadBookmarks(); @@ -155,6 +153,12 @@ private: QHash m_systemBookmarksIndexes; QList m_hiddenItems; + + // Index of the hidden item that should be removed in + // removeHiddenItem(). The removing must be done + // asynchronously as in the scope of onItemChanged() + // removing an item is not allowed. + int m_hiddenItemToRemove; }; #endif -- cgit v1.3.1