diff options
| author | Peter Penz <[email protected]> | 2012-05-01 23:11:06 +0200 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2012-05-01 23:14:52 +0200 |
| commit | d76b113ad10fe207ef23d5dd44c63ee076c71521 (patch) | |
| tree | 2cda5384e4036f4f048392548ea75243ce6b7fc2 /src/panels/places/placespanel.cpp | |
| parent | 6a7cb5ff7d29cc636b432a96e0db9ef9f9030527 (diff) | |
Places Panel: Allow hiding of items
Related changes:
- Animate changed items for the details-view in case it is not expandable
- Remove the hardcoded "isHidden"-code in KStandardItemListWidget and
allow derived widgets to define themselves what means "hidden" within
their context.
The current code needs a lot of bugfixing, but lets make this in smaller
steps during the next days...
Diffstat (limited to 'src/panels/places/placespanel.cpp')
| -rw-r--r-- | src/panels/places/placespanel.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index ea2ec3072..dc0f2b8ba 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -40,6 +40,7 @@ #include <KNotification> #include "placesitemeditdialog.h" #include "placesitemlistgroupheader.h" +#include "placesitemlistwidget.h" #include "placesitemmodel.h" #include <views/draganddrophelper.h> #include <QVBoxLayout> @@ -77,6 +78,7 @@ void PlacesPanel::showEvent(QShowEvent* event) m_model->setSortRole("group"); KStandardItemListView* view = new KStandardItemListView(); + view->setWidgetCreator(new KItemListWidgetCreator<PlacesItemListWidget>()); view->setGroupHeaderCreator(new KItemListGroupHeaderCreator<PlacesItemListGroupHeader>()); m_controller = new KItemListController(m_model, view, this); @@ -167,7 +169,7 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos) QAction* hideAction = menu.addAction(i18nc("@item:inmenu", "Hide Entry '%1'", label)); hideAction->setCheckable(true); - //hideEntry->setChecked(data.value("hidden").toBool()); + hideAction->setChecked(data.value("isHidden").toBool()); QAction* showAllAction = 0; if (m_model->hiddenCount() > 0) { @@ -176,7 +178,7 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos) } showAllAction = menu.addAction(i18nc("@item:inmenu", "Show All Entries")); showAllAction->setCheckable(true); - //showAllEntries->setChecked(showAll) + showAllAction->setChecked(m_model->hiddenItemsShown()); } QAction* removeAction = 0; @@ -200,7 +202,9 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos) } else if (action == removeAction) { m_model->removeItem(index); } else if (action == hideAction) { + m_model->setItemHidden(index, hideAction->isChecked()); } else if (action == showAllAction) { + m_model->setHiddenItemsShown(showAllAction->isChecked()); } else if (action == tearDownAction) { } else if (action == ejectAction) { } |
