diff options
| author | Peter Penz <[email protected]> | 2011-02-09 19:21:58 +0100 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-02-09 19:24:27 +0100 |
| commit | d3496b12310d9fec0e52e537c341e87fcaa2f8b5 (patch) | |
| tree | 590f58beeca31163e5b17950540601d8a5dec20e /src/views/dolphinviewcontroller.cpp | |
| parent | ceba0f6f6a07babac230d1f136d16d34629b4cf3 (diff) | |
Coding style update for pointer comparison
Most developers seem to prefer
if (ptr) ...
if (!ptr) ...
in comparison to
if (ptr != 0) ...
if (ptr == 0) ...
Adjusted the Dolphin-code to use the "most-prefered style" to make contributors happy.
Diffstat (limited to 'src/views/dolphinviewcontroller.cpp')
| -rw-r--r-- | src/views/dolphinviewcontroller.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/views/dolphinviewcontroller.cpp b/src/views/dolphinviewcontroller.cpp index f8f27ea38..672cffe65 100644 --- a/src/views/dolphinviewcontroller.cpp +++ b/src/views/dolphinviewcontroller.cpp @@ -53,14 +53,14 @@ void DolphinViewController::requestUrlChange(const KUrl& url) void DolphinViewController::setItemView(QAbstractItemView* view) { - if (m_itemView != 0) { + if (m_itemView) { disconnect(m_itemView, SIGNAL(pressed(const QModelIndex&)), this, SLOT(updateMouseButtonState())); } m_itemView = view; - if (m_itemView != 0) { + if (m_itemView) { // TODO: this is a workaround until Qt-issue 176832 has been fixed connect(m_itemView, SIGNAL(pressed(const QModelIndex&)), this, SLOT(updateMouseButtonState())); @@ -126,7 +126,7 @@ QList<QAction*> DolphinViewController::versionControlActions(const KFileItemList void DolphinViewController::handleKeyPressEvent(QKeyEvent* event) { - if (m_itemView == 0) { + if (!m_itemView) { return; } @@ -194,9 +194,9 @@ void DolphinViewController::emitItemTriggered(const KFileItem& item) KFileItem DolphinViewController::itemForIndex(const QModelIndex& index) const { - if (m_itemView != 0) { + if (m_itemView) { QAbstractProxyModel* proxyModel = static_cast<QAbstractProxyModel*>(m_itemView->model()); - if (proxyModel != 0) { + if (proxyModel) { KDirModel* dirModel = static_cast<KDirModel*>(proxyModel->sourceModel()); const QModelIndex dirIndex = proxyModel->mapToSource(index); return dirModel->itemForIndex(dirIndex); @@ -212,7 +212,7 @@ void DolphinViewController::triggerItem(const QModelIndex& index) const KFileItem item = itemForIndex(index); if (index.isValid() && (index.column() == KDirModel::Name)) { emit itemTriggered(item); - } else if (m_itemView != 0) { + } else if (m_itemView) { m_itemView->clearSelection(); emit itemEntered(KFileItem()); } |
