diff options
| author | Peter Penz <[email protected]> | 2008-06-18 19:34:03 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2008-06-18 19:34:03 +0000 |
| commit | b8a4e0fac2820ec8fc442c2abeea700ae4947e01 (patch) | |
| tree | 22d132204de327656614ee2dfe97834218eef776 /src/dolphinview.cpp | |
| parent | 91607d4c4d60d7d51827e770e5504aa4ff552e48 (diff) | |
Assure that when requesting the context menu for the column-view, that the correct items are used.
TODO for 4.2: get rid of those 'if (isColumnViewActive())' special cases and provide a generic model which also works with the way the column view is implemented
BUG: 164146
svn path=/trunk/KDE/kdebase/apps/; revision=821903
Diffstat (limited to 'src/dolphinview.cpp')
| -rw-r--r-- | src/dolphinview.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 573abf85a..221d20376 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -295,6 +295,10 @@ void DolphinView::clearSelection() KFileItemList DolphinView::selectedItems() const { + if (isColumnViewActive()) { + return m_columnView->selectedItems(); + } + const QAbstractItemView* view = itemView(); // Our view has a selection, we will map them back to the DolphinModel @@ -325,12 +329,6 @@ KUrl::List DolphinView::selectedUrls() const return urls; } -KFileItem DolphinView::fileItem(const QModelIndex& index) const -{ - const QModelIndex dolphinModelIndex = m_proxyModel->mapToSource(index); - return m_dolphinModel->itemForIndex(dolphinModelIndex); -} - void DolphinView::setContentsPosition(int x, int y) { QAbstractItemView* view = itemView(); @@ -774,10 +772,14 @@ void DolphinView::emitSelectionChangedSignal() void DolphinView::openContextMenu(const QPoint& pos) { KFileItem item; - - const QModelIndex index = itemView()->indexAt(pos); - if (index.isValid() && (index.column() == DolphinModel::Name)) { - item = fileItem(index); + if (isColumnViewActive()) { + item = m_columnView->itemAt(pos); + } else { + const QModelIndex index = itemView()->indexAt(pos); + if (index.isValid() && (index.column() == DolphinModel::Name)) { + const QModelIndex dolphinModelIndex = m_proxyModel->mapToSource(index); + item = m_dolphinModel->itemForIndex(dolphinModelIndex); + } } if (m_toolTipManager != 0) { |
