diff options
| author | Peter Penz <[email protected]> | 2012-05-11 23:00:26 +0200 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2012-05-11 23:02:14 +0200 |
| commit | 28daa45a44bc172747bad6d948de2a58c8586845 (patch) | |
| tree | 0bee0a91d45dcfe57597a0dba256b393e58431d0 /src/panels/places/placespanel.cpp | |
| parent | b319c59b8d1e068cf621be852ced9c5396bd77f9 (diff) | |
Places Panel: Implement eject and teardown actions
Further fixes:
- Add/remove item when device has been added/removed
- Update emblem if the accessibility-state has been changed
Diffstat (limited to 'src/panels/places/placespanel.cpp')
| -rw-r--r-- | src/panels/places/placespanel.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index 4fa1fa852..979ef25a6 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -76,6 +76,8 @@ void PlacesPanel::showEvent(QShowEvent* event) m_model = new PlacesItemModel(this); m_model->setGroupedSorting(true); m_model->setSortRole("group"); + connect(m_model, SIGNAL(errorMessage(QString)), + this, SIGNAL(errorMessage(QString))); KStandardItemListView* view = new KStandardItemListView(); view->setWidgetCreator(new KItemListWidgetCreator<PlacesItemListWidget>()); @@ -128,7 +130,7 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos) QAction* addAction = 0; QAction* mainSeparator = 0; QAction* editAction = 0; - QAction* tearDownAction = 0; + QAction* teardownAction = 0; QAction* ejectAction = 0; const bool isSystemItem = m_model->isSystemItem(index); @@ -140,13 +142,13 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos) menu.addAction(ejectAction); } - tearDownAction = m_model->tearDownAction(index); - if (tearDownAction) { - tearDownAction->setParent(&menu); - menu.addAction(tearDownAction); + teardownAction = m_model->teardownAction(index); + if (teardownAction) { + teardownAction->setParent(&menu); + menu.addAction(teardownAction); } - if (tearDownAction || ejectAction) { + if (teardownAction || ejectAction) { mainSeparator = menu.addSeparator(); } } else { @@ -209,8 +211,10 @@ void PlacesPanel::slotItemContextMenuRequested(int index, const QPointF& pos) emit placeMiddleClicked(url); } else if (action == showAllAction) { m_model->setHiddenItemsShown(showAllAction->isChecked()); - } else if (action == tearDownAction) { + } else if (action == teardownAction) { + m_model->requestTeardown(index); } else if (action == ejectAction) { + m_model->requestEject(index); } } |
