┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/selectionmanager.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2011-02-09 19:21:58 +0100
committerPeter Penz <[email protected]>2011-02-09 19:24:27 +0100
commitd3496b12310d9fec0e52e537c341e87fcaa2f8b5 (patch)
tree590f58beeca31163e5b17950540601d8a5dec20e /src/views/selectionmanager.cpp
parentceba0f6f6a07babac230d1f136d16d34629b4cf3 (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/selectionmanager.cpp')
-rw-r--r--src/views/selectionmanager.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/views/selectionmanager.cpp b/src/views/selectionmanager.cpp
index 6befc2199..7a9e81412 100644
--- a/src/views/selectionmanager.cpp
+++ b/src/views/selectionmanager.cpp
@@ -71,7 +71,7 @@ bool SelectionManager::eventFilter(QObject* watched, QEvent* event)
if (watched == m_view->viewport()) {
switch (event->type()) {
case QEvent::Leave:
- if (m_toggle != 0) {
+ if (m_toggle) {
m_toggle->hide();
}
restoreCursor();
@@ -81,7 +81,7 @@ bool SelectionManager::eventFilter(QObject* watched, QEvent* event)
// Set the toggle invisible, if a mouse button has been pressed
// outside the toggle boundaries. This e.g. assures, that the toggle
// gets invisible during dragging items.
- if (m_toggle != 0) {
+ if (m_toggle) {
const QRect toggleBounds(m_toggle->mapToGlobal(QPoint(0, 0)), m_toggle->size());
m_toggle->setVisible(toggleBounds.contains(QCursor::pos()));
}
@@ -111,7 +111,7 @@ bool SelectionManager::eventFilter(QObject* watched, QEvent* event)
void SelectionManager::reset()
{
- if (m_toggle != 0) {
+ if (m_toggle) {
m_toggle->reset();
}
}
@@ -147,7 +147,7 @@ void SelectionManager::slotEntered(const QModelIndex& index)
m_connected = false;
}
- if (m_toggle == 0) {
+ if (!m_toggle) {
return;
}
@@ -187,7 +187,7 @@ void SelectionManager::slotEntered(const QModelIndex& index)
void SelectionManager::slotViewportEntered()
{
- if (m_toggle != 0) {
+ if (m_toggle) {
m_toggle->hide();
}
restoreCursor();
@@ -197,7 +197,7 @@ void SelectionManager::setItemSelected(bool selected)
{
emit selectionChanged();
- if ((m_toggle != 0) && !m_toggle->url().isEmpty()) {
+ if (m_toggle && !m_toggle->url().isEmpty()) {
const QModelIndex index = indexForUrl(m_toggle->url());
if (index.isValid()) {
QItemSelectionModel* selModel = m_view->selectionModel();
@@ -216,7 +216,7 @@ void SelectionManager::slotRowsRemoved(const QModelIndex& parent, int start, int
Q_UNUSED(parent);
Q_UNUSED(start);
Q_UNUSED(end);
- if (m_toggle != 0) {
+ if (m_toggle) {
m_toggle->hide();
}
restoreCursor();
@@ -228,7 +228,7 @@ void SelectionManager::slotSelectionChanged(const QItemSelection& selected,
// The selection has been changed outside the scope of the selection manager
// (e. g. by the rubberband or the "Select All" action). Take care updating
// the state of the toggle button.
- if ((m_toggle != 0) && !m_toggle->url().isEmpty()) {
+ if (m_toggle && !m_toggle->url().isEmpty()) {
const QModelIndex index = indexForUrl(m_toggle->url());
if (index.isValid()) {
if (selected.contains(index)) {