┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphincolumnview.cpp
diff options
context:
space:
mode:
authorDavid Faure <[email protected]>2007-08-13 21:57:20 +0000
committerDavid Faure <[email protected]>2007-08-13 21:57:20 +0000
commit81fcd720a2cc095262e52b8a40dd1472d774a415 (patch)
treea98ca305384c3e8ed8d4c49a4bff746fdc3dde2d /src/dolphincolumnview.cpp
parent1f5476dd45efa74d847b041bb03f64f4d4a8c9c4 (diff)
Use KFileItem by value rather than by pointer
- in KDirModel::itemForIndex, as noted there as a TODO - in dolphin, everywhere. svn path=/trunk/KDE/kdebase/apps/; revision=699691
Diffstat (limited to 'src/dolphincolumnview.cpp')
-rw-r--r--src/dolphincolumnview.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/dolphincolumnview.cpp b/src/dolphincolumnview.cpp
index e8aa243d7..e4669442c 100644
--- a/src/dolphincolumnview.cpp
+++ b/src/dolphincolumnview.cpp
@@ -301,8 +301,8 @@ void ColumnWidget::mousePressEvent(QMouseEvent* event)
const QAbstractProxyModel* proxyModel = static_cast<const QAbstractProxyModel*>(m_view->model());
const KDirModel* dirModel = static_cast<const KDirModel*>(proxyModel->sourceModel());
const QModelIndex dirIndex = proxyModel->mapToSource(index);
- KFileItem* item = dirModel->itemForIndex(dirIndex);
- if (item != 0) {
+ KFileItem item = dirModel->itemForIndex(dirIndex);
+ if (!item.isNull()) {
QItemSelectionModel* selModel = selectionModel();
bool activate = true;
@@ -317,8 +317,8 @@ void ColumnWidget::mousePressEvent(QMouseEvent* event)
}
selModel->select(index, QItemSelectionModel::Toggle);
swallowMousePressEvent = true;
- } else if (item->isDir()) {
- m_childUrl = item->url();
+ } else if (item.isDir()) {
+ m_childUrl = item.url();
viewport()->update();
// Only request the activation if not the left button is pressed.
@@ -515,9 +515,9 @@ QAbstractItemView* DolphinColumnView::createColumn(const QModelIndex& index)
const KDirModel* dirModel = static_cast<const KDirModel*>(proxyModel->sourceModel());
const QModelIndex dirModelIndex = proxyModel->mapToSource(index);
- KFileItem* fileItem = dirModel->itemForIndex(dirModelIndex);
- if (fileItem != 0) {
- columnUrl = fileItem->url();
+ KFileItem fileItem = dirModel->itemForIndex(dirModelIndex);
+ if (!fileItem.isNull()) {
+ columnUrl = fileItem.url();
}
}