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/panels/information | |
| 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/panels/information')
| -rw-r--r-- | src/panels/information/informationpanel.cpp | 2 | ||||
| -rw-r--r-- | src/panels/information/informationpanelcontent.cpp | 8 | ||||
| -rw-r--r-- | src/panels/information/phononwidget.cpp | 14 |
3 files changed, 12 insertions, 12 deletions
diff --git a/src/panels/information/informationpanel.cpp b/src/panels/information/informationpanel.cpp index f1530c72c..9bfb711c6 100644 --- a/src/panels/information/informationpanel.cpp +++ b/src/panels/information/informationpanel.cpp @@ -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 diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp index b820be0a0..08121e78a 100644 --- a/src/panels/information/informationpanelcontent.cpp +++ b/src/panels/information/informationpanelcontent.cpp @@ -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); } diff --git a/src/panels/information/phononwidget.cpp b/src/panels/information/phononwidget.cpp index b6da339ea..5accf4d87 100644 --- a/src/panels/information/phononwidget.cpp +++ b/src/panels/information/phononwidget.cpp @@ -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); } } |
