]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Coding style update for pointer comparison
authorPeter Penz <peter.penz19@gmail.com>
Wed, 9 Feb 2011 18:21:58 +0000 (19:21 +0100)
committerPeter Penz <peter.penz19@gmail.com>
Wed, 9 Feb 2011 18:24:27 +0000 (19:24 +0100)
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.

37 files changed:
src/dolphinapplication.cpp
src/dolphincontextmenu.cpp
src/dolphindockwidget.cpp
src/dolphinmainwindow.cpp
src/dolphinviewcontainer.cpp
src/panels/filter/filterpanel.cpp
src/panels/folders/folderspanel.cpp
src/panels/information/informationpanel.cpp
src/panels/information/informationpanelcontent.cpp
src/panels/information/phononwidget.cpp
src/panels/terminal/terminalpanel.cpp
src/search/filenamesearchprotocol.cpp
src/settings/applyviewpropsjob.cpp
src/settings/viewpropertiesdialog.cpp
src/settings/viewpropsprogressinfo.cpp
src/tests/dolphinviewtest_allviewmodes.cpp
src/views/dolphincolumnview.cpp
src/views/dolphincolumnviewcontainer.cpp
src/views/dolphindetailsview.cpp
src/views/dolphindetailsviewexpander.cpp
src/views/dolphiniconsview.cpp
src/views/dolphinremoteencoding.cpp
src/views/dolphinview.cpp
src/views/dolphinviewactionhandler.cpp
src/views/dolphinviewautoscroller.cpp
src/views/dolphinviewcontroller.cpp
src/views/draganddrophelper.cpp
src/views/folderexpander.cpp
src/views/selectionmanager.cpp
src/views/selectiontoggle.cpp
src/views/tooltips/filemetadatatooltip.cpp
src/views/tooltips/tooltipmanager.cpp
src/views/versioncontrol/pendingthreadsmaintainer.cpp
src/views/versioncontrol/pendingthreadsmaintainer.h
src/views/versioncontrol/updateitemstatesthread.cpp
src/views/versioncontrol/versioncontrolobserver.cpp
src/views/viewextensionsfactory.cpp

index d37fa78defeca6759e4ad1b6eca8290b0161b505..468c7a0f799c18005af6979bd019401b1a3f2b52 100644 (file)
@@ -37,7 +37,7 @@ DolphinApplication::DolphinApplication() :
 DolphinApplication::~DolphinApplication()
 {
     // cleanup what ever is left from the MainWindows
-    while (m_mainWindows.count() != 0) {
+    while (!m_mainWindows.isEmpty()) {
         delete m_mainWindows.takeFirst();
     }
 }
index d7de33cb44d05fda8240909d45e5fe81543fa1da..9b6512aa26231a01256f9dd509d1f8a375cec859 100644 (file)
@@ -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;
index f7ee16fdc975ac1406238d45e7e9f1d2367a3a70..72e06a656bce71c4ffc83871c0f7d8dcea30bbee 100644 (file)
@@ -64,7 +64,7 @@ void DolphinDockWidget::setLocked(bool lock)
         m_locked = lock;
 
         if (lock) {
-            if (m_dockTitleBar == 0) {
+            if (!m_dockTitleBar) {
                 m_dockTitleBar = new DolphinDockTitleBar(this);
             }
             setTitleBarWidget(m_dockTitleBar);
index f0335a4cdb1e2a3534f409f9a2669a79fe32edc8..11597fe1eb3bac599519cf7b84d0ba8c58bb61b3 100644 (file)
@@ -213,7 +213,7 @@ void DolphinMainWindow::openFiles(const QList<KUrl>& files)
     const int tabCount = m_viewTab.count();
     for (int i = 0; i < tabCount; ++i) {
         m_viewTab[i].primaryView->view()->markUrlsAsSelected(files);
-        if (m_viewTab[i].secondaryView != 0) {
+        if (m_viewTab[i].secondaryView) {
             m_viewTab[i].secondaryView->view()->markUrlsAsSelected(files);
         }
     }
@@ -256,7 +256,7 @@ void DolphinMainWindow::showCommand(CommandType command)
 
 void DolphinMainWindow::refreshViews()
 {
-    Q_ASSERT(m_viewTab[m_tabIndex].primaryView != 0);
+    Q_ASSERT(m_viewTab[m_tabIndex].primaryView);
 
     // remember the current active view, as because of
     // the refreshing the active view might change to
@@ -266,7 +266,7 @@ void DolphinMainWindow::refreshViews()
     const int tabCount = m_viewTab.count();
     for (int i = 0; i < tabCount; ++i) {
         m_viewTab[i].primaryView->refresh();
-        if (m_viewTab[i].secondaryView != 0) {
+        if (m_viewTab[i].secondaryView) {
             m_viewTab[i].secondaryView->refresh();
         }
     }
@@ -279,8 +279,8 @@ void DolphinMainWindow::refreshViews()
         // Synchronize the split-view setting with the active view:
         const bool splitView = generalSettings->splitView();
         const ViewTab& activeTab = m_viewTab[m_tabIndex];
-        const bool toggle =    ( splitView && (activeTab.secondaryView == 0))
-                            || (!splitView && (activeTab.secondaryView != 0));
+        const bool toggle =    ( splitView && !activeTab.secondaryView)
+                            || (!splitView &&  activeTab.secondaryView);
         if (toggle) {
             toggleSplitView();
         }
@@ -302,7 +302,7 @@ void DolphinMainWindow::changeUrl(const KUrl& url)
     }
 
     DolphinViewContainer* view = activeViewContainer();
-    if (view != 0) {
+    if (view) {
         view->setUrl(url);
         updateEditActions();
         updateViewActions();
@@ -328,9 +328,9 @@ void DolphinMainWindow::slotSelectionChanged(const KFileItemList& selection)
 {
     updateEditActions();
 
-    Q_ASSERT(m_viewTab[m_tabIndex].primaryView != 0);
+    Q_ASSERT(m_viewTab[m_tabIndex].primaryView);
     int selectedUrlsCount = m_viewTab[m_tabIndex].primaryView->view()->selectedItemsCount();
-    if (m_viewTab[m_tabIndex].secondaryView != 0) {
+    if (m_viewTab[m_tabIndex].secondaryView) {
         selectedUrlsCount += m_viewTab[m_tabIndex].secondaryView->view()->selectedItemsCount();
     }
 
@@ -356,13 +356,13 @@ void DolphinMainWindow::updateHistory()
 
     QAction* backAction = actionCollection()->action("go_back");
     backAction->setToolTip(i18nc("@info", "Go back"));
-    if (backAction != 0) {
+    if (backAction) {
         backAction->setEnabled(index < urlNavigator->historySize() - 1);
     }
 
     QAction* forwardAction = actionCollection()->action("go_forward");
     forwardAction->setToolTip(i18nc("@info", "Go forward"));
-    if (forwardAction != 0) {
+    if (forwardAction) {
         forwardAction->setEnabled(index > 0);
     }
 }
@@ -434,7 +434,7 @@ void DolphinMainWindow::openNewTab(const KUrl& url)
         m_viewTab[tabIndex].isPrimaryViewActive = false;
     }
 
-    if (focusWidget != 0) {
+    if (focusWidget) {
         // The DolphinViewContainer grabbed the keyboard focus. As the tab is opened
         // in background, assure that the previous focused widget gets the focus back.
         focusWidget->setFocus();
@@ -494,13 +494,13 @@ void DolphinMainWindow::openInNewWindow()
 
 void DolphinMainWindow::toggleActiveView()
 {
-    if (m_viewTab[m_tabIndex].secondaryView == 0) {
+    if (!m_viewTab[m_tabIndex].secondaryView) {
         // only one view is available
         return;
     }
 
-    Q_ASSERT(m_activeViewContainer != 0);
-    Q_ASSERT(m_viewTab[m_tabIndex].primaryView != 0);
+    Q_ASSERT(m_activeViewContainer);
+    Q_ASSERT(m_viewTab[m_tabIndex].primaryView);
 
     DolphinViewContainer* left  = m_viewTab[m_tabIndex].primaryView;
     DolphinViewContainer* right = m_viewTab[m_tabIndex].secondaryView;
@@ -576,7 +576,7 @@ void DolphinMainWindow::closeEvent(QCloseEvent* event)
 
     if (m_filterDockIsTemporaryVisible) {
         QDockWidget* filterDock = findChild<QDockWidget*>("filterDock");
-        if (filterDock != 0) {
+        if (filterDock) {
             filterDock->hide();
         }
         m_filterDockIsTemporaryVisible = false;
@@ -598,7 +598,7 @@ void DolphinMainWindow::saveProperties(KConfigGroup& group)
                          cont->urlNavigator()->isUrlEditable());
 
         cont = m_viewTab[i].secondaryView;
-        if (cont != 0) {
+        if (cont) {
             group.writeEntry(tabProperty("Secondary URL", i), cont->url().url());
             group.writeEntry(tabProperty("Secondary Editable", i),
                              cont->urlNavigator()->isUrlEditable());
@@ -619,18 +619,18 @@ void DolphinMainWindow::readProperties(const KConfigGroup& group)
         cont = m_viewTab[i].secondaryView;
         const QString secondaryUrl = group.readEntry(tabProperty("Secondary URL", i));
         if (!secondaryUrl.isEmpty()) {
-            if (cont == 0) {
+            if (!cont) {
                 // a secondary view should be shown, but no one is available
                 // currently -> create a new view
                 toggleSplitView();
                 cont = m_viewTab[i].secondaryView;
-                Q_ASSERT(cont != 0);
+                Q_ASSERT(cont);
             }
 
             cont->setUrl(secondaryUrl);
             const bool editable = group.readEntry(tabProperty("Secondary Editable", i), false);
             cont->urlNavigator()->setUrlEditable(editable);
-        } else if (cont != 0) {
+        } else if (cont) {
             // no secondary view should be shown, but the default setting shows
             // one already -> close the view
             toggleSplitView();
@@ -676,7 +676,7 @@ void DolphinMainWindow::showErrorMessage(const QString& message)
 void DolphinMainWindow::slotUndoAvailable(bool available)
 {
     QAction* undoAction = actionCollection()->action(KStandardAction::name(KStandardAction::Undo));
-    if (undoAction != 0) {
+    if (undoAction) {
         undoAction->setEnabled(available);
     }
 }
@@ -713,7 +713,7 @@ void DolphinMainWindow::restoreClosedTab(QAction* action)
 void DolphinMainWindow::slotUndoTextChanged(const QString& text)
 {
     QAction* undoAction = actionCollection()->action(KStandardAction::name(KStandardAction::Undo));
-    if (undoAction != 0) {
+    if (undoAction) {
         undoAction->setText(text);
     }
 }
@@ -779,7 +779,7 @@ void DolphinMainWindow::invertSelection()
 
 void DolphinMainWindow::toggleSplitView()
 {
-    if (m_viewTab[m_tabIndex].secondaryView == 0) {
+    if (!m_viewTab[m_tabIndex].secondaryView) {
         createSecondaryView(m_tabIndex);
         setActiveViewContainer(m_viewTab[m_tabIndex].secondaryView);
     } else if (m_activeViewContainer == m_viewTab[m_tabIndex].secondaryView) {
@@ -859,7 +859,7 @@ void DolphinMainWindow::togglePanelLockState()
     const bool newLockState = !generalSettings->lockPanels();
     foreach (QObject* child, children()) {
         DolphinDockWidget* dock = qobject_cast<DolphinDockWidget*>(child);
-        if (dock != 0) {
+        if (dock) {
             dock->setLocked(newLockState);
         }
     }
@@ -935,7 +935,7 @@ void DolphinMainWindow::compareFiles()
     // - both in the secondary view
     // - one in the primary view and the other in the secondary
     //   view
-    Q_ASSERT(m_viewTab[m_tabIndex].primaryView != 0);
+    Q_ASSERT(m_viewTab[m_tabIndex].primaryView);
 
     KUrl urlA;
     KUrl urlB;
@@ -944,7 +944,7 @@ void DolphinMainWindow::compareFiles()
 
     switch (items.count()) {
     case 0: {
-        Q_ASSERT(m_viewTab[m_tabIndex].secondaryView != 0);
+        Q_ASSERT(m_viewTab[m_tabIndex].secondaryView);
         items = m_viewTab[m_tabIndex].secondaryView->view()->selectedItems();
         Q_ASSERT(items.count() == 2);
         urlA = items[0].url();
@@ -954,7 +954,7 @@ void DolphinMainWindow::compareFiles()
 
     case 1: {
         urlA = items[0].url();
-        Q_ASSERT(m_viewTab[m_tabIndex].secondaryView != 0);
+        Q_ASSERT(m_viewTab[m_tabIndex].secondaryView);
         items = m_viewTab[m_tabIndex].secondaryView->view()->selectedItems();
         Q_ASSERT(items.count() == 1);
         urlB = items[0].url();
@@ -1006,7 +1006,7 @@ void DolphinMainWindow::openTerminal()
 
 void DolphinMainWindow::editSettings()
 {
-    if (m_settingsDialog == 0) {
+    if (!m_settingsDialog) {
         const KUrl url = activeViewContainer()->url();
         m_settingsDialog = new DolphinSettingsDialog(url, this);
         m_settingsDialog->setAttribute(Qt::WA_DeleteOnClose);
@@ -1028,7 +1028,7 @@ void DolphinMainWindow::setActiveTab(int index)
     ViewTab& hiddenTab = m_viewTab[m_tabIndex];
     hiddenTab.isPrimaryViewActive = hiddenTab.primaryView->isActive();
     hiddenTab.primaryView->setActive(false);
-    if (hiddenTab.secondaryView != 0) {
+    if (hiddenTab.secondaryView) {
         hiddenTab.secondaryView->setActive(false);
     }
     QSplitter* splitter = m_viewTab[m_tabIndex].splitter;
@@ -1041,7 +1041,7 @@ void DolphinMainWindow::setActiveTab(int index)
     ViewTab& viewTab = m_viewTab[index];
     m_centralWidgetLayout->addWidget(viewTab.splitter, 1);
     viewTab.primaryView->show();
-    if (viewTab.secondaryView != 0) {
+    if (viewTab.secondaryView) {
         viewTab.secondaryView->show();
     }
     viewTab.splitter->show();
@@ -1073,7 +1073,7 @@ void DolphinMainWindow::closeTab(int index)
 
     // delete tab
     m_viewTab[index].primaryView->deleteLater();
-    if (m_viewTab[index].secondaryView != 0) {
+    if (m_viewTab[index].secondaryView) {
         m_viewTab[index].secondaryView->deleteLater();
     }
     m_viewTab[index].splitter->deleteLater();
@@ -1113,21 +1113,21 @@ void DolphinMainWindow::openTabContextMenu(int index, const QPoint& pos)
     QAction* selectedAction = menu.exec(pos);
     if (selectedAction == newTabAction) {
         const ViewTab& tab = m_viewTab[index];
-        Q_ASSERT(tab.primaryView != 0);
-        const KUrl url = (tab.secondaryView != 0) && tab.secondaryView->isActive() ?
+        Q_ASSERT(tab.primaryView);
+        const KUrl url = tab.secondaryView && tab.secondaryView->isActive() ?
                          tab.secondaryView->url() : tab.primaryView->url();
         openNewTab(url);
         m_tabBar->setCurrentIndex(m_viewTab.count() - 1);
     } else if (selectedAction == detachTabAction) {
         const ViewTab& tab = m_viewTab[index];
-        Q_ASSERT(tab.primaryView != 0);
+        Q_ASSERT(tab.primaryView);
         const KUrl primaryUrl = tab.primaryView->url();
         DolphinMainWindow* window = DolphinApplication::app()->createMainWindow();
         window->changeUrl(primaryUrl);
 
-        if (tab.secondaryView != 0) {
+        if (tab.secondaryView) {
             const KUrl secondaryUrl = tab.secondaryView->url();
-            if (window->m_viewTab[0].secondaryView == 0) {
+            if (!window->m_viewTab[0].secondaryView) {
                 window->toggleSplitView();
             }
             window->m_viewTab[0].secondaryView->setUrl(secondaryUrl);
@@ -1228,7 +1228,7 @@ void DolphinMainWindow::slotSearchModeChanged(bool enabled)
     }
 
     QDockWidget* filterDock = findChild<QDockWidget*>("filterDock");
-    if (filterDock == 0) {
+    if (!filterDock) {
         return;
     }
 
@@ -1375,7 +1375,7 @@ void DolphinMainWindow::init()
 
 void DolphinMainWindow::setActiveViewContainer(DolphinViewContainer* viewContainer)
 {
-    Q_ASSERT(viewContainer != 0);
+    Q_ASSERT(viewContainer);
     Q_ASSERT((viewContainer == m_viewTab[m_tabIndex].primaryView) ||
              (viewContainer == m_viewTab[m_tabIndex].secondaryView));
     if (m_activeViewContainer == viewContainer) {
@@ -1796,7 +1796,7 @@ void DolphinMainWindow::rememberClosedTab(int index)
     ClosedTab closedTab;
     closedTab.primaryUrl = m_viewTab[index].primaryView->url();
 
-    if (m_viewTab[index].secondaryView != 0) {
+    if (m_viewTab[index].secondaryView) {
         closedTab.secondaryUrl = m_viewTab[index].secondaryView->url();
         closedTab.isSplit = true;
     } else {
@@ -1866,7 +1866,7 @@ void DolphinMainWindow::connectViewSignals(DolphinViewContainer* container)
 void DolphinMainWindow::updateSplitAction()
 {
     QAction* splitAction = actionCollection()->action("split_view");
-    if (m_viewTab[m_tabIndex].secondaryView != 0) {
+    if (m_viewTab[m_tabIndex].secondaryView) {
         if (m_activeViewContainer == m_viewTab[m_tabIndex].secondaryView) {
             splitAction->setText(i18nc("@action:intoolbar Close right view", "Close"));
             splitAction->setToolTip(i18nc("@info", "Close right view"));
index af333ba4f8442e61d14eb00c065feeac611009c7..0ecdaf6855769bf8913120e3f6b6ab57905396ed 100644 (file)
@@ -259,7 +259,7 @@ void DolphinViewContainer::setUrl(const KUrl& newUrl)
 
 void DolphinViewContainer::setFilterBarVisible(bool visible)
 {
-    Q_ASSERT(m_filterBar != 0);
+    Q_ASSERT(m_filterBar);
     if (visible) {
         m_filterBar->show();
         m_filterBar->setFocus();
@@ -338,7 +338,7 @@ void DolphinViewContainer::slotFinishedPathLoading()
         m_statusBar->setProgress(100);
     }
 
-    if (isSearchUrl(url()) && (m_view->items().count() == 0)) {
+    if (isSearchUrl(url()) && m_view->items().isEmpty()) {
         // The dir lister has been completed on a Nepomuk-URI and no items have been found. Instead
         // of showing the default status bar information ("0 items") a more helpful information is given:
         m_statusBar->setMessage(i18nc("@info:status", "No items found."), DolphinStatusBar::Information);
index 12cf642dba5924ed7d0fb42780e91df90de4eaf9..e4d352ba64a86514f2553b6b6473a359907c6b31 100644 (file)
@@ -95,7 +95,7 @@ void FilterPanel::showEvent(QShowEvent* event)
         QVBoxLayout* layout = new QVBoxLayout(this);
         layout->setMargin(0);
 
-        Q_ASSERT(m_facetWidget == 0);
+        Q_ASSERT(!m_facetWidget);
         m_facetWidget = new Nepomuk::Utils::FacetWidget(this);
         layout->addWidget(m_facetWidget, 1);
 
@@ -133,7 +133,7 @@ void FilterPanel::showEvent(QShowEvent* event)
         m_facetWidget->addFacet(Nepomuk::Utils::Facet::createRatingFacet());
         m_facetWidget->addFacet(Nepomuk::Utils::Facet::createTagFacet());
 
-        Q_ASSERT(m_lastSetUrlStatJob == 0);
+        Q_ASSERT(!m_lastSetUrlStatJob);
         m_lastSetUrlStatJob = KIO::stat(url(), KIO::HideProgressInfo);
         connect(m_lastSetUrlStatJob, SIGNAL(result(KJob*)),
                 this, SLOT(slotSetUrlStatFinished(KJob*)));
index 4e4efed445a849415492d1eaa2f41fe3fa1d333e..ccdf13decc165cfe886498e198643dea191caa46 100644 (file)
@@ -73,7 +73,7 @@ FoldersPanel::~FoldersPanel()
 void FoldersPanel::setShowHiddenFiles(bool show)
 {
     FoldersPanelSettings::setShowHiddenFiles(show);
-    if (m_dirLister != 0) {
+    if (m_dirLister) {
         m_dirLister->setShowingDotFiles(show);
         m_dirLister->openUrl(m_dirLister->url(), KDirLister::Reload);
     }
@@ -118,7 +118,7 @@ bool FoldersPanel::urlChanged()
         return false;
     }
 
-    if (m_dirLister != 0) {
+    if (m_dirLister) {
         m_setLeafVisible = true;
         loadTree(url());
     }
@@ -133,7 +133,7 @@ void FoldersPanel::showEvent(QShowEvent* event)
         return;
     }
 
-    if (m_dirLister == 0) {
+    if (!m_dirLister) {
         // Postpone the creating of the dir lister to the first show event.
         // This assures that no performance and memory overhead is given when the TreeView is not
         // used at all (see FoldersPanel::setUrl()).
@@ -146,18 +146,18 @@ void FoldersPanel::showEvent(QShowEvent* event)
         m_dirLister->setShowingDotFiles(FoldersPanelSettings::showHiddenFiles());
         connect(m_dirLister, SIGNAL(completed()), this, SLOT(slotDirListerCompleted()));
 
-        Q_ASSERT(m_dolphinModel == 0);
+        Q_ASSERT(!m_dolphinModel);
         m_dolphinModel = new DolphinModel(this);
         m_dolphinModel->setDirLister(m_dirLister);
         m_dolphinModel->setDropsAllowed(DolphinModel::DropOnDirectory);
         connect(m_dolphinModel, SIGNAL(expand(const QModelIndex&)),
                 this, SLOT(expandToDir(const QModelIndex&)));
 
-        Q_ASSERT(m_proxyModel == 0);
+        Q_ASSERT(!m_proxyModel);
         m_proxyModel = new DolphinSortFilterProxyModel(this);
         m_proxyModel->setSourceModel(m_dolphinModel);
 
-        Q_ASSERT(m_treeView == 0);
+        Q_ASSERT(!m_treeView);
         m_treeView = new PanelTreeView(this);
         m_treeView->setModel(m_proxyModel);
         m_proxyModel->setSorting(DolphinView::SortByName);
@@ -278,7 +278,7 @@ void FoldersPanel::slotVerticalScrollBarMoved(int value)
 
 void FoldersPanel::loadTree(const KUrl& url)
 {
-    Q_ASSERT(m_dirLister != 0);
+    Q_ASSERT(m_dirLister);
     m_leafDir = url;
 
     KUrl baseUrl;
index f1530c72ce80770cd57b20d33bccaf27bd853414..9bfb711c65dd18edf0983b84376983a3a82f0998 100644 (file)
@@ -52,7 +52,7 @@ void InformationPanel::setSelection(const KFileItemList& selection)
         return;
     }
 
-    if ((selection.count() == 0) && (m_selection.count() == 0)) {
+    if (selection.isEmpty() && m_selection.isEmpty()) {
         // The selection has not really changed, only the current index.
         // QItemSelectionModel emits a signal in this case and it is less
         // expensive doing the check this way instead of patching
index b820be0a0f89c0cf57b96166e2152f0fe10550ec..08121e78ab82beaf042687cb8279e53dd31ec377 100644 (file)
@@ -192,7 +192,7 @@ void InformationPanelContent::showItem(const KFileItem& item)
         }
     }
 
-    if (m_metaDataWidget != 0) {
+    if (m_metaDataWidget) {
         m_metaDataWidget->show();
         m_metaDataWidget->setItems(KFileItemList() << item);
     }
@@ -234,7 +234,7 @@ void InformationPanelContent::showItems(const KFileItemList& items)
     m_preview->setPixmap(icon);
     setNameLabelText(i18ncp("@info", "%1 item selected", "%1 items selected", items.count()));
 
-    if (m_metaDataWidget != 0) {
+    if (m_metaDataWidget) {
         m_metaDataWidget->setItems(items);
     }
 
@@ -289,7 +289,7 @@ void InformationPanelContent::configureSettings(const QList<QAction*>& customCon
     // Open the popup and adjust the settings for the
     // selected action.
     QAction* action = popup.exec(QCursor::pos());
-    if (action == 0) {
+    if (!action) {
         return;
     }
 
@@ -418,7 +418,7 @@ void InformationPanelContent::adjustWidgetSizes(int width)
 
     // The metadata widget also contains a text widget which may return
     // a large preferred width.
-    if (m_metaDataWidget != 0) {
+    if (m_metaDataWidget) {
         m_metaDataWidget->setMaximumWidth(maxWidth);
     }
 
index b6da339eaf6da36065e3c1b100f02f11ef290a89..5accf4d87ec6f59b57104fcdfb86ecd5d33ca3ed 100644 (file)
@@ -118,7 +118,7 @@ void PhononWidget::showEvent(QShowEvent *event)
         return;
     }
 
-    if (m_topLayout == 0) {
+    if (!m_topLayout) {
         m_topLayout = new QVBoxLayout(this);
         m_topLayout->setMargin(0);
         m_topLayout->setSpacing(KDialog::spacingHint());
@@ -185,7 +185,7 @@ void PhononWidget::play()
 {
     switch (m_mode) {
     case Audio:
-        if (m_audioMedia == 0) {
+        if (!m_audioMedia) {
             m_audioMedia = Phonon::createPlayer(Phonon::MusicCategory, m_url);
             m_audioMedia->setParent(this);
         }
@@ -195,7 +195,7 @@ void PhononWidget::play()
         break;
 
     case Video:
-        if (m_videoPlayer == 0) {
+        if (!m_videoPlayer) {
             m_videoPlayer = new EmbeddedVideoPlayer(Phonon::VideoCategory, this);
             m_topLayout->insertWidget(0, m_videoPlayer);
         }
@@ -209,7 +209,7 @@ void PhononWidget::play()
         break;
     }
 
-    Q_ASSERT(m_media != 0);
+    Q_ASSERT(m_media);
     connect(m_media, SIGNAL(stateChanged(Phonon::State, Phonon::State)),
             this, SLOT(stateChanged(Phonon::State)));
     m_seekSlider->setMediaObject(m_media);
@@ -219,7 +219,7 @@ void PhononWidget::play()
 
 void PhononWidget::stop()
 {
-    if (m_media != 0) {
+    if (m_media) {
         m_media->stop();
         disconnect(m_media, SIGNAL(stateChanged(Phonon::State, Phonon::State)),
                    this, SLOT(stateChanged(Phonon::State)));
@@ -229,14 +229,14 @@ void PhononWidget::stop()
         m_playButton->show();
     }
 
-    if (m_videoPlayer != 0) {
+    if (m_videoPlayer) {
         m_videoPlayer->hide();
     }
 }
 
 void PhononWidget::applyVideoSize()
 {
-    if ((m_videoPlayer != 0) && m_videoSize.isValid()) {
+    if ((m_videoPlayer) && m_videoSize.isValid()) {
         m_videoPlayer->setSizeHint(m_videoSize);
     }
 }
index d928380d8802a29f293fab3e5b4f0814dcbe641b..61d80cbfa26fb17d0ba403a52f2ab57fbae7b3cc 100644 (file)
@@ -58,9 +58,7 @@ bool TerminalPanel::urlChanged()
         return false;
     }
 
-    const bool sendInput = (m_terminal != 0)
-                           && (m_terminal->foregroundProcessId() == -1)
-                           && isVisible();
+    const bool sendInput = m_terminal && (m_terminal->foregroundProcessId() == -1) && isVisible();
     if (sendInput) {
         changeDir(url());
     }
@@ -75,18 +73,18 @@ void TerminalPanel::showEvent(QShowEvent* event)
         return;
     }
 
-    if (m_terminal == 0) {
+    if (!m_terminal) {
         m_clearTerminal = true;
         KPluginFactory* factory = KPluginLoader("libkonsolepart").factory();
         KParts::ReadOnlyPart* part = factory ? (factory->create<KParts::ReadOnlyPart>(this)) : 0;
-        if (part != 0) {
+        if (part) {
             connect(part, SIGNAL(destroyed(QObject*)), this, SLOT(terminalExited()));
             m_terminalWidget = part->widget();
             m_layout->addWidget(m_terminalWidget);
             m_terminal = qobject_cast<TerminalInterfaceV2 *>(part);
         }
     }
-    if (m_terminal != 0) {
+    if (m_terminal) {
         m_terminal->showShellInDir(url().toLocalFile());
         changeDir(url());
         m_terminalWidget->setFocus();
index ddc23789c865544ba77e12d201826a686f44631c..4d6f59fa4c608e92598a1465b80aedcbc94f343f 100644 (file)
@@ -89,7 +89,7 @@ void FileNameSearchProtocol::searchDirectory(const KUrl& directory)
     const KFileItemList items = dirLister->items();
     foreach (const KFileItem& item, items) {
         bool addItem = false;
-        if ((m_regExp == 0) || item.name().contains(*m_regExp)) {
+        if (!m_regExp || item.name().contains(*m_regExp)) {
             addItem = true;
         } else if (m_checkContent && item.mimetype().startsWith(QLatin1String("text/"))) {
             addItem = contentContainsPattern(item.url());
@@ -129,7 +129,7 @@ void FileNameSearchProtocol::searchDirectory(const KUrl& directory)
 
 bool FileNameSearchProtocol::contentContainsPattern(const KUrl& fileName) const
 {
-    Q_ASSERT(m_regExp != 0);
+    Q_ASSERT(m_regExp);
 
     QString path;
     KTemporaryFile tempFile;
index 4aa86ce4d0e0443fdf2df9ccacbf5d6e7f48fedd..4010ab47785f0bc3139b9f8e17995f6206ac80a8 100644 (file)
@@ -61,7 +61,7 @@ void ApplyViewPropsJob::slotEntries(KIO::Job*, const KIO::UDSEntryList& list)
             KUrl url(m_dir);
             url.addPath(name);
 
-            Q_ASSERT(m_viewProps != 0);
+            Q_ASSERT(m_viewProps);
 
             ViewProperties props(url);
             props.setDirProperties(*m_viewProps);
index 0ea197363b3c577c230866306f05bd0fe74eb4f9..2a35f7eb8bba8b1107f1edebcc06fc782135e918 100644 (file)
@@ -73,7 +73,7 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
     m_applyToAllFolders(0),
     m_useAsDefault(0)
 {
-    Q_ASSERT(dolphinView != 0);
+    Q_ASSERT(dolphinView);
     const bool useGlobalViewProps = DolphinSettings::instance().generalSettings()->globalViewProps();
 
     setCaption(i18nc("@title:window", "View Properties"));
@@ -332,8 +332,7 @@ void ViewPropertiesDialog::applyViewProperties()
         return;
     }
 
-    const bool applyToSubFolders = (m_applyToSubFolders != 0) &&
-                                   m_applyToSubFolders->isChecked();
+    const bool applyToSubFolders = m_applyToSubFolders && m_applyToSubFolders->isChecked();
     if (applyToSubFolders) {
         const QString text(i18nc("@info", "The view properties of all sub-folders will be changed. Do you want to continue?"));
         if (KMessageBox::questionYesNo(this, text) == KMessageBox::No) {
@@ -348,13 +347,11 @@ void ViewPropertiesDialog::applyViewProperties()
         info->show();
     }
 
-    const bool applyToAllFolders = (m_applyToAllFolders != 0) &&
-                                   m_applyToAllFolders->isChecked();
+    const bool applyToAllFolders = m_applyToAllFolders && m_applyToAllFolders->isChecked();
 
     // If the user selected 'Apply To All Folders' the view properties implicitely
     // are also used as default for new folders.
-    const bool useAsDefault = applyToAllFolders ||
-                              ((m_useAsDefault != 0) && m_useAsDefault->isChecked());
+    const bool useAsDefault = applyToAllFolders || (m_useAsDefault && m_useAsDefault->isChecked());
     if (useAsDefault) {
         // For directories where no .directory file is available, the .directory
         // file stored for the global view properties is used as fallback. To update
index 2be0258efdda0ea201510d45087812b0de29c937..9b7797d02d61c2b7f61b1662dfaf01253938ad0e 100644 (file)
@@ -104,12 +104,12 @@ void ViewPropsProgressInfo::closeEvent(QCloseEvent* event)
 
 void ViewPropsProgressInfo::updateProgress()
 {
-    if (m_dirSizeJob != 0) {
+    if (m_dirSizeJob) {
         const int subdirs = m_dirSizeJob->totalSubdirs();
         m_label->setText(i18nc("@info:progress", "Counting folders: %1", subdirs));
     }
 
-    if (m_applyViewPropsJob != 0) {
+    if (m_applyViewPropsJob) {
         const int progress = m_applyViewPropsJob->progress();
         m_progressBar->setValue(progress);
     }
@@ -134,12 +134,12 @@ void ViewPropsProgressInfo::applyViewProperties()
 
 void ViewPropsProgressInfo::cancelApplying()
 {
-    if (m_dirSizeJob != 0) {
+    if (m_dirSizeJob) {
         m_dirSizeJob->kill();
         m_dirSizeJob = 0;
     }
 
-    if (m_applyViewPropsJob != 0) {
+    if (m_applyViewPropsJob) {
         m_applyViewPropsJob->kill();
         m_applyViewPropsJob = 0;
     }
index 743ce9fd41e2c284edacab5c296009087017d57c..8d7a5bd0d73d2f279573a777ce905861b4d867b8 100644 (file)
@@ -409,7 +409,7 @@ void DolphinViewTest_AllViewModes::verifySelectedItemsCount(int itemsCount) cons
     QCOMPARE(m_view->selectedItemsCount(), itemsCount);
     QCOMPARE(spySelectionChanged.count(), 1);
     QCOMPARE(qvariant_cast<KFileItemList>(spySelectionChanged.at(0).at(0)).count(), itemsCount);
-    if (itemsCount != 0) {
+    if (itemsCount) {
         QVERIFY(m_view->hasSelection());
     }
     else {
index 6b0f43cd99286b2a32c71f9b59dd99051ed139ee..fec0879ea39e58d27c2be079602494c81fa1cc1a 100644 (file)
@@ -90,7 +90,7 @@ DolphinColumnView::DolphinColumnView(QWidget* parent,
     m_resizeWidget->installEventFilter(this);
 
     const ColumnModeSettings* settings = DolphinSettings::instance().columnModeSettings();
-    Q_ASSERT(settings != 0);
+    Q_ASSERT(settings);
 
     if (settings->useSystemFont()) {
         m_font = KGlobalSettings::generalFont();
@@ -241,7 +241,7 @@ void DolphinColumnView::setSelectionModel(QItemSelectionModel* model)
     // If a change of the selection is done although the view is not active
     // (e. g. by the selection markers), the column must be activated. This
     // is done by listening to the current selectionChanged() signal.
-    if (selectionModel() != 0) {
+    if (selectionModel()) {
         disconnect(selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)),
                    this, SLOT(requestActivation()));
     }
@@ -507,7 +507,7 @@ void DolphinColumnView::requestActivation()
 void DolphinColumnView::updateFont()
 {
     const ColumnModeSettings* settings = DolphinSettings::instance().columnModeSettings();
-    Q_ASSERT(settings != 0);
+    Q_ASSERT(settings);
 
     if (settings->useSystemFont()) {
         m_font = KGlobalSettings::generalFont();
index 7baded96c92695752bbfa76720073846205925ae..3216dd2b6643b74e8ef1262c159359b3881ccc4a 100644 (file)
@@ -49,8 +49,8 @@ DolphinColumnViewContainer::DolphinColumnViewContainer(QWidget* parent,
     m_activeUrlTimer(0),
     m_assureVisibleActiveColumnTimer(0)
 {
-    Q_ASSERT(dolphinViewController != 0);
-    Q_ASSERT(viewModeController != 0);
+    Q_ASSERT(dolphinViewController);
+    Q_ASSERT(viewModeController);
 
     setAcceptDrops(true);
     setFocusPolicy(Qt::NoFocus);
@@ -392,7 +392,7 @@ void DolphinColumnViewContainer::removeAllColumns()
 
 void DolphinColumnViewContainer::deleteColumn(DolphinColumnView* column)
 {
-    if (column == 0) {
+    if (!column) {
         return;
     }
 
@@ -412,7 +412,7 @@ void DolphinColumnViewContainer::deleteColumn(DolphinColumnView* column)
         // during drag operations" is used). Deleting the view
         // during an ongoing drag operation is not allowed, so
         // this will postponed.
-        if (m_dragSource != 0) {
+        if (m_dragSource) {
             // the old stored view is obviously not the drag source anymore
             m_dragSource->deleteLater();
             m_dragSource = 0;
index 482925aaa3ee7cb1175885b6e162910227fd468b..5c2e9576fe26f12cec44bb03c412e7f703b2d670 100644 (file)
@@ -59,9 +59,9 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent,
     m_decorationSize()
 {
     const DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
-    Q_ASSERT(settings != 0);
-    Q_ASSERT(dolphinViewController != 0);
-    Q_ASSERT(viewModeController != 0);
+    Q_ASSERT(settings);
+    Q_ASSERT(dolphinViewController);
+    Q_ASSERT(viewModeController);
 
     setLayoutDirection(Qt::LeftToRight);
     setAcceptDrops(true);
@@ -388,7 +388,7 @@ void DolphinDetailsView::configureSettings(const QPoint& pos)
     popup.addSeparator();
 
     QAction* activatedAction = popup.exec(header()->mapToGlobal(pos));
-    if (activatedAction != 0) {
+    if (activatedAction) {
         const bool show = activatedAction->isChecked();
         const int columnIndex = activatedAction->data().toInt();
 
@@ -574,7 +574,7 @@ void DolphinDetailsView::slotGlobalSettingsChanged(int category)
     Q_UNUSED(category);
 
     const DetailsModeSettings* settings = DolphinSettings::instance().detailsModeSettings();
-    Q_ASSERT(settings != 0);
+    Q_ASSERT(settings);
     if (settings->useSystemFont()) {
         m_font = KGlobalSettings::generalFont();
     }
index c2734ed3a6cc333d60dda1dc331ecaf80c9da916..cc4bc67be3d7917ac3db457e88467ad2b2350d81 100644 (file)
@@ -34,16 +34,16 @@ DolphinDetailsViewExpander::DolphinDetailsViewExpander(DolphinDetailsView* paren
     m_dolphinModel(0),
     m_proxyModel(0)
 {
-    Q_ASSERT(parent != 0);
+    Q_ASSERT(parent);
 
     m_proxyModel = qobject_cast<const DolphinSortFilterProxyModel*>(parent->model());
-    Q_ASSERT(m_proxyModel != 0);
+    Q_ASSERT(m_proxyModel);
 
     m_dolphinModel = qobject_cast<const DolphinModel*>(m_proxyModel->sourceModel());
-    Q_ASSERT(m_dolphinModel != 0);
+    Q_ASSERT(m_dolphinModel);
 
     m_dirLister = m_dolphinModel->dirLister();
-    Q_ASSERT(m_dirLister != 0);
+    Q_ASSERT(m_dirLister);
 
     // The URLs must be sorted. E.g. /home/user/ cannot be expanded before /home/
     // because it is not known to the dir model before.
index 6527c861170da1c1a66915cdb8ab80e1008d05dc..a863de72df5600b58b6e8a66a4ea7f408a83c903 100644 (file)
@@ -54,8 +54,8 @@ DolphinIconsView::DolphinIconsView(QWidget* parent,
     m_itemSize(),
     m_dropRect()
 {
-    Q_ASSERT(dolphinViewController != 0);
-    Q_ASSERT(viewModeController != 0);
+    Q_ASSERT(dolphinViewController);
+    Q_ASSERT(viewModeController);
 
     setModel(proxyModel);
     setLayoutDirection(Qt::LeftToRight);
@@ -93,7 +93,7 @@ DolphinIconsView::DolphinIconsView(QWidget* parent,
 
     // apply the icons mode settings to the widget
     const IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
-    Q_ASSERT(settings != 0);
+    Q_ASSERT(settings);
 
     if (settings->useSystemFont()) {
         m_font = KGlobalSettings::generalFont();
@@ -405,7 +405,7 @@ void DolphinIconsView::slotGlobalSettingsChanged(int category)
     Q_UNUSED(category);
 
     const IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
-    Q_ASSERT(settings != 0);
+    Q_ASSERT(settings);
     if (settings->useSystemFont()) {
         m_font = KGlobalSettings::generalFont();
     }
@@ -449,7 +449,7 @@ void DolphinIconsView::categoryDrawerActionRequested(int action, const QModelInd
 void DolphinIconsView::updateGridSize(bool showPreview, int additionalInfoCount)
 {
     const IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
-    Q_ASSERT(settings != 0);
+    Q_ASSERT(settings);
 
     int itemWidth = settings->itemWidth();
     int itemHeight = settings->itemHeight();
@@ -510,7 +510,7 @@ void DolphinIconsView::updateGridSize(bool showPreview, int additionalInfoCount)
     setGridSizeOwn(QSize(itemWidth + spacing * 2, itemHeight + spacing));
 
     KFileItemDelegate* delegate = dynamic_cast<KFileItemDelegate*>(itemDelegate());
-    if (delegate != 0) {
+    if (delegate) {
         delegate->setMaximumSize(m_itemSize);
     }
 }
index f3bd157729ca5f1ad4d46de7ae5c31185f7345c9..475769e9122afec47781e0d6fedf97b7f7511edc 100644 (file)
@@ -169,7 +169,7 @@ void DolphinRemoteEncoding::slotAboutToShow()
 
 void DolphinRemoteEncoding::slotItemSelected(QAction* action)
 {
-    if (action != 0) {
+    if (action) {
         int id = action->data().toInt();
     
         KConfig config(("kio_" + m_currentURL.protocol() + "rc").toLatin1());
@@ -200,7 +200,7 @@ void DolphinRemoteEncoding::slotDefault()
         // Remove the exact name match...
         domains << m_currentURL.host();
 
-        while (partList.count()) {
+        while (!partList.isEmpty()) {
             if (partList.count() == 2) {
                 if (partList[0].length() <= 2 && partList[1].length() == 2) {
                     break;
index 534eabfee18da7ccb7c4ace2a5b3911265393803..4ab16e0528a7eb3e4a8ae98c3cc25437c673ad61 100644 (file)
@@ -290,7 +290,7 @@ KFileItemList DolphinView::selectedItems() const
 {
     KFileItemList itemList;
     const QAbstractItemView* view = m_viewAccessor.itemView();
-    if (view == 0) {
+    if (!view) {
         return itemList;
     }
 
@@ -310,7 +310,7 @@ KFileItemList DolphinView::selectedItems() const
 int DolphinView::selectedItemsCount() const
 {
     const QAbstractItemView* view = m_viewAccessor.itemView();
-    if (view == 0) {
+    if (!view) {
         return 0;
     }
 
@@ -886,7 +886,7 @@ void DolphinView::updateAdditionalInfoActions(KActionCollection* collection)
     foreach (const KFileItemDelegate::Information& info, infoKeys) {
         const QString name = infoAccessor.actionCollectionName(info, AdditionalInfoAccessor::AdditionalInfoType);
         QAction* action = collection->action(name);
-        Q_ASSERT(action != 0);
+        Q_ASSERT(action);
         action->setEnabled(enable);
         action->setChecked(checkedInfo.contains(info));
     }
@@ -929,7 +929,7 @@ void DolphinView::restoreState(QDataStream& stream)
     QSet<KUrl> urlsToExpand;
     stream >> urlsToExpand;
     const DolphinDetailsViewExpander* expander = m_viewAccessor.setExpandedUrls(urlsToExpand);
-    if (expander != 0) {
+    if (expander) {
         m_expanderActive = true;
         connect (expander, SIGNAL(completed()), this, SLOT(slotLoadingCompleted()));
     }
@@ -944,7 +944,7 @@ void DolphinView::saveState(QDataStream& stream)
     KFileItem currentItem;
     const QAbstractItemView* view = m_viewAccessor.itemView();
 
-    if (view != 0) {
+    if (view) {
         const QModelIndex proxyIndex = view->currentIndex();
         const QModelIndex dirModelIndex = m_viewAccessor.proxyModel()->mapToSource(proxyIndex);
         currentItem = m_viewAccessor.dirModel()->itemForIndex(dirModelIndex);
@@ -972,7 +972,7 @@ void DolphinView::saveState(QDataStream& stream)
 bool DolphinView::hasSelection() const
 {
     const QAbstractItemView* view = m_viewAccessor.itemView();
-    return (view != 0) && view->selectionModel()->hasSelection();
+    return view && view->selectionModel()->hasSelection();
 }
 
 void DolphinView::observeCreatedItem(const KUrl& url)
@@ -1011,7 +1011,7 @@ void DolphinView::restoreContentsPosition()
         m_restoredContentsPosition = QPoint();
 
         QAbstractItemView* view = m_viewAccessor.itemView();
-        Q_ASSERT(view != 0);
+        Q_ASSERT(view);
         view->horizontalScrollBar()->setValue(x);
         view->verticalScrollBar()->setValue(y);
     }
@@ -1163,12 +1163,12 @@ void DolphinView::applyViewProperties()
 
         updateZoomLevel(oldZoomLevel);
     }
-    if (m_viewAccessor.itemView() == 0) {
+    if (!m_viewAccessor.itemView()) {
         createView();
     }
 
-    Q_ASSERT(m_viewAccessor.itemView() != 0);
-    Q_ASSERT(m_viewAccessor.itemDelegate() != 0);
+    Q_ASSERT(m_viewAccessor.itemView());
+    Q_ASSERT(m_viewAccessor.itemDelegate());
 
     const bool showHiddenFiles = props.showHiddenFiles();
     if (showHiddenFiles != m_viewAccessor.dirLister()->showingDotFiles()) {
@@ -1224,12 +1224,12 @@ void DolphinView::createView()
 {
     deleteView();
 
-    Q_ASSERT(m_viewAccessor.itemView() == 0);
-    Q_ASSERT(m_dolphinViewController->itemView() == 0);
+    Q_ASSERT(!m_viewAccessor.itemView());
+    Q_ASSERT(!m_dolphinViewController->itemView());
     m_viewAccessor.createView(this, m_dolphinViewController, m_viewModeController, m_mode);
 
     QAbstractItemView* view = m_viewAccessor.itemView();
-    Q_ASSERT(view != 0);
+    Q_ASSERT(view);
     view->installEventFilter(this);
     view->viewport()->installEventFilter(this);
 
@@ -1247,10 +1247,10 @@ void DolphinView::createView()
 void DolphinView::deleteView()
 {
     QAbstractItemView* view = m_viewAccessor.itemView();
-    Q_ASSERT((m_dolphinViewController->itemView() == 0) || (m_dolphinViewController->itemView() == view));
+    Q_ASSERT(!m_dolphinViewController->itemView() || (m_dolphinViewController->itemView() == view));
     m_dolphinViewController->setItemView(0);
 
-    if (view != 0) {
+    if (view) {
         disconnectViewAccessor();
 
         if (hasFocus()) {
@@ -1303,7 +1303,7 @@ KUrl::List DolphinView::simplifiedSelectedUrls() const
 QMimeData* DolphinView::selectionMimeData() const
 {
     const QAbstractItemView* view = m_viewAccessor.itemView();
-    Q_ASSERT((view != 0) && (view->selectionModel() != 0));
+    Q_ASSERT((view) && (view->selectionModel()));
     const QItemSelection selection = m_viewAccessor.proxyModel()->mapSelectionToSource(view->selectionModel()->selection());
     return m_viewAccessor.dirModel()->mimeData(selection.indexes());
 }
@@ -1438,7 +1438,7 @@ void DolphinView::ViewAccessor::createView(QWidget* parent,
                                            const ViewModeController* viewModeController,
                                            Mode mode)
 {
-    Q_ASSERT(itemView() == 0);
+    Q_ASSERT(!itemView());
 
     switch (mode) {
     case IconsView:
@@ -1474,14 +1474,14 @@ void DolphinView::ViewAccessor::createView(QWidget* parent,
 
 void DolphinView::ViewAccessor::deleteView()
 {
-    if (m_columnsContainer != 0) {
+    if (m_columnsContainer) {
         m_columnsContainer->close();
         m_columnsContainer->disconnect();
         m_columnsContainer->deleteLater();
         m_columnsContainer = 0;
     } else {
         QAbstractItemView* view = itemView();
-        if (view != 0) {
+        if (view) {
             view->close();
             view->disconnect();
 
@@ -1490,7 +1490,7 @@ void DolphinView::ViewAccessor::deleteView()
                 // during drag operations" is used). Deleting the view
                 // during an ongoing drag operation is not allowed, so
                 // this will postponed.
-                if (m_dragSource != 0) {
+                if (m_dragSource) {
                     // the old stored view is obviously not the drag source anymore
                     m_dragSource->deleteLater();
                     m_dragSource = 0;
@@ -1510,22 +1510,22 @@ void DolphinView::ViewAccessor::deleteView()
 
 void DolphinView::ViewAccessor::prepareUrlChange(const KUrl& url)
 {
-    if (m_columnsContainer != 0) {
+    if (m_columnsContainer) {
         m_columnsContainer->showColumn(url);
     }
 }
 
 QAbstractItemView* DolphinView::ViewAccessor::itemView() const
 {
-    if (m_iconsView != 0) {
+    if (m_iconsView) {
         return m_iconsView;
     }
 
-    if (m_detailsView != 0) {
+    if (m_detailsView) {
         return m_detailsView;
     }
 
-    if (m_columnsContainer != 0) {
+    if (m_columnsContainer) {
         return m_columnsContainer->activeColumn();
     }
 
@@ -1539,7 +1539,7 @@ KFileItemDelegate* DolphinView::ViewAccessor::itemDelegate() const
 
 QWidget* DolphinView::ViewAccessor::layoutTarget() const
 {
-    if (m_columnsContainer != 0) {
+    if (m_columnsContainer) {
         return m_columnsContainer;
     }
     return itemView();
@@ -1552,7 +1552,7 @@ void DolphinView::ViewAccessor::setRootUrl(const KUrl& rootUrl)
 
 KUrl DolphinView::ViewAccessor::rootUrl() const
 {
-    return (m_columnsContainer != 0) ? m_columnsContainer->rootUrl() : m_rootUrl;
+    return m_columnsContainer ? m_columnsContainer->rootUrl() : m_rootUrl;
 }
 
 bool DolphinView::ViewAccessor::supportsCategorizedSorting() const
@@ -1562,12 +1562,12 @@ bool DolphinView::ViewAccessor::supportsCategorizedSorting() const
 
 bool DolphinView::ViewAccessor::itemsExpandable() const
 {
-    return (m_detailsView != 0) && m_detailsView->itemsExpandable();
+    return m_detailsView && m_detailsView->itemsExpandable();
 }
 
 QSet<KUrl> DolphinView::ViewAccessor::expandedUrls() const
 {
-    if (m_detailsView != 0) {
+    if (m_detailsView) {
         return m_detailsView->expandedUrls();
     }
 
@@ -1576,7 +1576,7 @@ QSet<KUrl> DolphinView::ViewAccessor::expandedUrls() const
 
 const DolphinDetailsViewExpander* DolphinView::ViewAccessor::setExpandedUrls(const QSet<KUrl>& urlsToExpand)
 {
-    if ((m_detailsView != 0) && m_detailsView->itemsExpandable() && !urlsToExpand.isEmpty()) {
+    if (m_detailsView && m_detailsView->itemsExpandable() && !urlsToExpand.isEmpty()) {
         // Check if another expander is already active and stop it if necessary.
         if(!m_detailsViewExpander.isNull()) {
             m_detailsViewExpander->stop();
@@ -1604,7 +1604,7 @@ DolphinModel* DolphinView::ViewAccessor::dirModel() const
 
 DolphinSortFilterProxyModel* DolphinView::ViewAccessor::proxyModel() const
 {
-    if (m_columnsContainer != 0) {
+    if (m_columnsContainer) {
         return static_cast<DolphinSortFilterProxyModel*>(m_columnsContainer->activeColumn()->model());
     }
     return m_proxyModel;
index 0959a03f75902cbf7d1eaeaba8c5b9312ab9bdda..6046abc8c0a43c7bbd76bbc86bcc91a4ab34557c 100644 (file)
@@ -320,7 +320,7 @@ KActionCollection* DolphinViewActionHandler::actionCollection()
 void DolphinViewActionHandler::updateViewActions()
 {
     QAction* viewModeAction = m_actionCollection->action(currentViewModeActionName());
-    if (viewModeAction != 0) {
+    if (viewModeAction) {
         viewModeAction->setChecked(true);
 
         QAction* viewModeMenu = m_actionCollection->action("view_mode");
@@ -484,7 +484,7 @@ void DolphinViewActionHandler::slotSortingChanged(DolphinView::Sorting sorting)
         }
     }
 
-    if (action != 0) {
+    if (action) {
         action->setChecked(true);
 
         QAction* sortByMenu =  m_actionCollection->action("sort");
@@ -495,12 +495,12 @@ void DolphinViewActionHandler::slotSortingChanged(DolphinView::Sorting sorting)
 void DolphinViewActionHandler::slotZoomLevelChanged(int level)
 {
     QAction* zoomInAction = m_actionCollection->action(KStandardAction::name(KStandardAction::ZoomIn));
-    if (zoomInAction != 0) {
+    if (zoomInAction) {
         zoomInAction->setEnabled(level < ZoomLevelInfo::maximumLevel());
     }
 
     QAction* zoomOutAction = m_actionCollection->action(KStandardAction::name(KStandardAction::ZoomOut));
-    if (zoomOutAction != 0) {
+    if (zoomOutAction) {
         zoomOutAction->setEnabled(level > ZoomLevelInfo::minimumLevel());
     }
 }
index 4f645d026e8aefb8bf4acaf59477cb79fed99462..5b338cc372ba9f70accbc981954eccda8434670b 100644 (file)
@@ -131,13 +131,13 @@ void DolphinViewAutoScroller::scrollViewport()
     }
 
     QScrollBar* verticalScrollBar = m_itemView->verticalScrollBar();
-    if (verticalScrollBar != 0) {
+    if (verticalScrollBar) {
         const int value = verticalScrollBar->value();
         verticalScrollBar->setValue(value + m_verticalScrollInc);
 
     }
     QScrollBar* horizontalScrollBar = m_itemView->horizontalScrollBar();
-    if (horizontalScrollBar != 0) {
+    if (horizontalScrollBar) {
         const int value = horizontalScrollBar->value();
         horizontalScrollBar->setValue(value + m_horizontalScrollInc);
 
@@ -156,9 +156,9 @@ void DolphinViewAutoScroller::scrollViewport()
 
 void DolphinViewAutoScroller::triggerAutoScroll()
 {
-    const bool verticalScrolling = (m_itemView->verticalScrollBar() != 0) &&
+    const bool verticalScrolling = m_itemView->verticalScrollBar() &&
                                    m_itemView->verticalScrollBar()->isVisible();
-    const bool horizontalScrolling = (m_itemView->horizontalScrollBar() != 0) &&
+    const bool horizontalScrolling = m_itemView->horizontalScrollBar() &&
                                      m_itemView->horizontalScrollBar()->isVisible();
     if (!verticalScrolling && !horizontalScrolling) {
         // no scrollbars are shown at all, so no autoscrolling is necessary
index f8f27ea382099ee4eb89c8587370d294a9d89cca..672cffe655ebb57cb76ed263f89bd77527ce446b 100644 (file)
@@ -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());
         }
index 24d5156e57a9bb490739d962694557c42fe3d6f1..f7508e094160edc4abc3bfd930a8944ef7b963a5 100644 (file)
@@ -62,11 +62,11 @@ void DragAndDropHelper::startDrag(QAbstractItemView* itemView,
     const QModelIndexList indexes = itemView->selectionModel()->selectedIndexes();
     if (!indexes.isEmpty()) {
         QMimeData *data = itemView->model()->mimeData(indexes);
-        if (data == 0) {
+        if (!data) {
             return;
         }
 
-        if (dolphinViewController != 0) {
+        if (dolphinViewController) {
             dolphinViewController->requestToolTipHiding();
         }
 
@@ -83,7 +83,7 @@ void DragAndDropHelper::startDrag(QAbstractItemView* itemView,
 
 bool DragAndDropHelper::isDragSource(QAbstractItemView* itemView) const
 {
-    return (m_dragSource != 0) && (m_dragSource == itemView);
+    return m_dragSource && (m_dragSource == itemView);
 }
 
 void DragAndDropHelper::dropUrls(const KFileItem& destItem,
index 4e22fdb0a46e7c7b3178545f6761886097597183..a9f5971c2f7ca93efd390d09547fbc626c29429c 100644 (file)
@@ -39,14 +39,11 @@ FolderExpander::FolderExpander(QAbstractItemView *view, QSortFilterProxyModel *p
     m_autoExpandTriggerTimer(0),
     m_autoExpandPos()
 {
-    if (m_view == 0)  {
-        return;
-    }
-    if (m_proxyModel == 0)  {
+    if (!m_view || !m_proxyModel)  {
         return;
     }
     KDirModel *m_dirModel = qobject_cast<KDirModel*>(m_proxyModel->sourceModel());
-    if (m_dirModel == 0) {
+    if (!m_dirModel) {
         return;
     }
 
@@ -100,7 +97,7 @@ void FolderExpander::autoExpandTimeout()
     QModelIndex proxyIndexToExpand = m_view->indexAt(m_autoExpandPos);
     QModelIndex indexToExpand = m_proxyModel->mapToSource(proxyIndexToExpand);
     KDirModel* m_dirModel = qobject_cast< KDirModel* >(m_proxyModel->sourceModel());
-    Q_ASSERT(m_dirModel != 0);
+    Q_ASSERT(m_dirModel);
     KFileItem itemToExpand = m_dirModel->itemForIndex(indexToExpand);
 
     if (itemToExpand.isNull() || itemToExpand == m_dirModel->itemForIndex(QModelIndex())) {
@@ -111,7 +108,7 @@ void FolderExpander::autoExpandTimeout()
 
     if (itemToExpand.isDir()) {
         QTreeView* treeView = qobject_cast<QTreeView*>(m_view);
-        if ((treeView != 0) && treeView->itemsExpandable()) {
+        if (treeView && treeView->itemsExpandable()) {
             // Toggle expanded state of this directory.
             treeView->setExpanded(proxyIndexToExpand, !treeView->isExpanded(proxyIndexToExpand));
         }
index 6befc219998618d6bc7920d6989b73f20ea4f505..7a9e814126c998bc1400d2c3d1003ab1cda819e8 100644 (file)
@@ -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)) {
index e08a0220e19e274b16d3f48de791f00cca722670..d602600c58754a3211056c2fc95d2c588636c5a3 100644 (file)
@@ -125,7 +125,7 @@ void SelectionToggle::enterEvent(QEvent* event)
     // if the mouse cursor is above the selection toggle, display
     // it immediately without fading timer
     m_isHovered = true;
-    if (m_fadingTimeLine != 0) {
+    if (m_fadingTimeLine) {
         m_fadingTimeLine->stop();
     }
     m_fadingValue = 255;
@@ -192,7 +192,7 @@ void SelectionToggle::setFadingValue(int value)
 {
     m_fadingValue = value;
     if (m_fadingValue >= 255) {
-        Q_ASSERT(m_fadingTimeLine != 0);
+        Q_ASSERT(m_fadingTimeLine);
         m_fadingTimeLine->stop();
     }
     update();
@@ -215,7 +215,7 @@ void SelectionToggle::refreshIcon()
 
 void SelectionToggle::startFading()
 {
-    Q_ASSERT(m_fadingTimeLine == 0);
+    Q_ASSERT(!m_fadingTimeLine);
 
     const bool animate = KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::SimpleAnimationEffects;
     const int duration = animate ? 600 : 1;
@@ -230,7 +230,7 @@ void SelectionToggle::startFading()
 
 void SelectionToggle::stopFading()
 {
-    if (m_fadingTimeLine != 0) {
+    if (m_fadingTimeLine) {
         m_fadingTimeLine->stop();
         delete m_fadingTimeLine;
         m_fadingTimeLine = 0;
index 0705d09b29dd8eb7845ae04c6b8ea0447924e516..cef5530604a6fae34b7122f4f8c7a85f344f8539 100644 (file)
@@ -84,7 +84,7 @@ void FileMetaDataToolTip::setPreview(const QPixmap& pixmap)
 
 QPixmap FileMetaDataToolTip::preview() const
 {
-    if (m_preview->pixmap() != 0) {
+    if (m_preview->pixmap()) {
         return *m_preview->pixmap();
     }
     return QPixmap();
index fdf83d13d89d19783177af5e0a2f8082ee5cfb42..cb86b3355020e1c056cdc59dffec3ed4a461fcca 100644 (file)
@@ -51,7 +51,7 @@ ToolTipManager::ToolTipManager(QAbstractItemView* parent,
     m_enabledPlugins()
 {
     static FileMetaDataToolTip* sharedToolTip = 0;
-    if (sharedToolTip == 0) {
+    if (!sharedToolTip) {
         sharedToolTip = new FileMetaDataToolTip();
         // TODO: Using K_GLOBAL_STATIC would be preferable to maintain the
         // instance, but the cleanup of KFileMetaDataWidget at this stage does
index fc463aeb3dafee1f48a401a451c5a56bc2686f6a..ee143a94a93dc651f78f8d4ced46247d5161cfa8 100644 (file)
@@ -41,7 +41,7 @@ PendingThreadsMaintainer::~PendingThreadsMaintainer()
 
 void PendingThreadsMaintainer::append(QThread* thread)
 {
-    Q_ASSERT(thread != 0);
+    Q_ASSERT(thread);
     m_threads.append(thread);
     m_timer->start();
 }
index a1ad3551677aa8dab37e42299eec02741c5ed9ee..3e99c8657aca673a6e48380cbc60a3b9068dfa78 100644 (file)
@@ -38,7 +38,7 @@ class QTimer;
  * \code
  * ThreadCreator::~ThreadCreator()
  * {
- *     if (m_thread != 0) {
+ *     if (m_thread) {
  *         PendingThreadsMaintainer::instance().append(m_thread);
  *         m_thread = 0;
  *     }
index b04d66f170970d5d61a5efd6b428abef86f37cd4..e6bd761cc47ebe52899f3f8cf414c078d4051456 100644 (file)
@@ -53,7 +53,7 @@ void UpdateItemStatesThread::setData(KVersionControlPlugin* plugin,
 void UpdateItemStatesThread::run()
 {
     Q_ASSERT(!m_itemStates.isEmpty());
-    Q_ASSERT(m_plugin != 0);
+    Q_ASSERT(m_plugin);
 
     // The items from m_itemStates may be located in different directory levels. The version
     // plugin requires the root directory for KVersionControlPlugin::beginRetrieval(). Instead
index 26528f9741a829d5e5fe79f97ade26cf4ae604af..62f50f30b7bfb0261e41bcf47c4bcbd623ae0f63 100644 (file)
@@ -49,13 +49,14 @@ VersionControlObserver::VersionControlObserver(QAbstractItemView* view) :
     m_plugin(0),
     m_updateItemStatesThread(0)
 {
-    Q_ASSERT(view != 0);
+    Q_ASSERT(view);
 
     QAbstractProxyModel* proxyModel = qobject_cast<QAbstractProxyModel*>(view->model());
-    m_dolphinModel = (proxyModel == 0) ?
-                     qobject_cast<DolphinModel*>(view->model()) :
-                     qobject_cast<DolphinModel*>(proxyModel->sourceModel());
-    if (m_dolphinModel != 0) {
+    m_dolphinModel = proxyModel ?
+                     qobject_cast<DolphinModel*>(proxyModel->sourceModel()) :
+                     qobject_cast<DolphinModel*>(view->model());
+
+    if (m_dolphinModel) {
         m_dirLister = m_dolphinModel->dirLister();
         connect(m_dirLister, SIGNAL(completed()),
                 this, SLOT(delayedDirectoryVerification()));
@@ -75,7 +76,7 @@ VersionControlObserver::VersionControlObserver(QAbstractItemView* view) :
 
 VersionControlObserver::~VersionControlObserver()
 {
-    if (m_updateItemStatesThread != 0) {
+    if (m_updateItemStatesThread) {
         if (m_updateItemStatesThread->isFinished()) {
             delete m_updateItemStatesThread;
             m_updateItemStatesThread = 0;
@@ -91,7 +92,7 @@ VersionControlObserver::~VersionControlObserver()
         }
     }
 
-    if (m_plugin != 0) {
+    if (m_plugin) {
         m_plugin->disconnect();
         m_plugin = 0;
     }
@@ -137,12 +138,12 @@ void VersionControlObserver::verifyDirectory()
         return;
     }
 
-    if (m_plugin != 0) {
+    if (m_plugin) {
         m_plugin->disconnect();
     }
 
     m_plugin = searchPlugin(versionControlUrl);
-    if (m_plugin != 0) {
+    if (m_plugin) {
         connect(m_plugin, SIGNAL(versionStatesChanged()),
                 this, SLOT(silentDirectoryVerification()));
         connect(m_plugin, SIGNAL(infoMessage(QString)),
@@ -180,7 +181,7 @@ void VersionControlObserver::verifyDirectory()
 
 void VersionControlObserver::slotThreadFinished()
 {
-    if (m_plugin == 0) {
+    if (!m_plugin) {
         return;
     }
 
@@ -222,8 +223,8 @@ void VersionControlObserver::slotThreadFinished()
 
 void VersionControlObserver::updateItemStates()
 {
-    Q_ASSERT(m_plugin != 0);
-    if (m_updateItemStatesThread == 0) {
+    Q_ASSERT(m_plugin);
+    if (!m_updateItemStatesThread) {
         m_updateItemStatesThread = new UpdateItemStatesThread();
         connect(m_updateItemStatesThread, SIGNAL(finished()),
                 this, SLOT(slotThreadFinished()));
@@ -282,7 +283,7 @@ KVersionControlPlugin* VersionControlObserver::searchPlugin(const KUrl& director
         for (KService::List::ConstIterator it = pluginServices.constBegin(); it != pluginServices.constEnd(); ++it) {
             if (enabledPlugins.contains((*it)->name())) {
                 KVersionControlPlugin* plugin = (*it)->createInstance<KVersionControlPlugin>();
-                if (plugin != 0) {
+                if (plugin) {
                     plugins.append(plugin);
                 }
             }
@@ -330,7 +331,7 @@ KVersionControlPlugin* VersionControlObserver::searchPlugin(const KUrl& director
 
 bool VersionControlObserver::isVersioned() const
 {
-    return m_dolphinModel->hasVersionData() && (m_plugin != 0);
+    return m_dolphinModel->hasVersionData() && m_plugin;
 }
 
 #include "versioncontrolobserver.moc"
index adf9da3fc5b3fdb295daf36f6330453cefd343ef..1a395dea9b770eecbc4a8dba69905a9752c514fa 100644 (file)
@@ -155,7 +155,7 @@ bool ViewExtensionsFactory::autoFolderExpandingEnabled() const
 bool ViewExtensionsFactory::eventFilter(QObject* watched, QEvent* event)
 {
     Q_UNUSED(watched);
-    if ((event->type() == QEvent::Wheel) && (m_selectionManager != 0)) {
+    if ((event->type() == QEvent::Wheel) && m_selectionManager) {
         m_selectionManager->reset();
     }
     return false;
@@ -164,7 +164,7 @@ bool ViewExtensionsFactory::eventFilter(QObject* watched, QEvent* event)
 void ViewExtensionsFactory::slotZoomLevelChanged()
 {
     m_previewGenerator->updateIcons();
-    if (m_selectionManager != 0) {
+    if (m_selectionManager) {
         m_selectionManager->reset();
     }
 }