From d3496b12310d9fec0e52e537c341e87fcaa2f8b5 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Wed, 9 Feb 2011 19:21:58 +0100 Subject: 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. --- src/settings/applyviewpropsjob.cpp | 2 +- src/settings/viewpropertiesdialog.cpp | 11 ++++------- src/settings/viewpropsprogressinfo.cpp | 8 ++++---- 3 files changed, 9 insertions(+), 12 deletions(-) (limited to 'src/settings') diff --git a/src/settings/applyviewpropsjob.cpp b/src/settings/applyviewpropsjob.cpp index 4aa86ce4d..4010ab477 100644 --- a/src/settings/applyviewpropsjob.cpp +++ b/src/settings/applyviewpropsjob.cpp @@ -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); diff --git a/src/settings/viewpropertiesdialog.cpp b/src/settings/viewpropertiesdialog.cpp index 0ea197363..2a35f7eb8 100644 --- a/src/settings/viewpropertiesdialog.cpp +++ b/src/settings/viewpropertiesdialog.cpp @@ -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 diff --git a/src/settings/viewpropsprogressinfo.cpp b/src/settings/viewpropsprogressinfo.cpp index 2be0258ef..9b7797d02 100644 --- a/src/settings/viewpropsprogressinfo.cpp +++ b/src/settings/viewpropsprogressinfo.cpp @@ -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; } -- cgit v1.3