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/dolphincontextmenu.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/dolphincontextmenu.cpp')
| -rw-r--r-- | src/dolphincontextmenu.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index d7de33cb4..9b6512aa2 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -81,7 +81,7 @@ DolphinContextMenu::DolphinContextMenu(DolphinMainWindow* parent, const DolphinView* view = m_mainWindow->activeViewContainer()->view(); m_selectedItems = view->selectedItems(); - if (m_keyInfo != 0) { + if (m_keyInfo) { if (m_keyInfo->isKeyPressed(Qt::Key_Shift) || m_keyInfo->isKeyLatched(Qt::Key_Shift)) { m_shiftPressed = true; } @@ -306,7 +306,7 @@ void DolphinContextMenu::openItemContextMenu() m_popup->addAction(propertiesAction); QAction* activatedAction = m_popup->exec(QCursor::pos()); - if (activatedAction != 0) { + if (activatedAction) { if (activatedAction == addToPlacesAction) { const KUrl selectedUrl(m_fileInfo.url()); if (selectedUrl.isValid()) { @@ -374,7 +374,7 @@ void DolphinContextMenu::openViewportContextMenu() KPropertiesDialog* dialog = new KPropertiesDialog(url, m_mainWindow); dialog->setAttribute(Qt::WA_DeleteOnClose); dialog->show(); - } else if ((addToPlacesAction != 0) && (action == addToPlacesAction)) { + } else if (addToPlacesAction && (action == addToPlacesAction)) { const KUrl& url = m_mainWindow->activeViewContainer()->url(); if (url.isValid()) { DolphinSettings::instance().placesModel()->addPlace(placesName(url), url); @@ -459,7 +459,7 @@ QAction* DolphinContextMenu::createPasteAction() KFileItemListProperties& DolphinContextMenu::selectedItemsProperties() { - if (m_selectedItemsProperties == 0) { + if (!m_selectedItemsProperties) { m_selectedItemsProperties = new KFileItemListProperties(m_selectedItems); } return *m_selectedItemsProperties; @@ -467,7 +467,7 @@ KFileItemListProperties& DolphinContextMenu::selectedItemsProperties() KFileItem DolphinContextMenu::baseFileItem() { - if (m_baseFileItem == 0) { + if (!m_baseFileItem) { m_baseFileItem = new KFileItem(KFileItem::Unknown, KFileItem::Unknown, m_baseUrl); } return *m_baseFileItem; |
