From: Peter Penz Date: Thu, 23 Jul 2009 06:14:57 +0000 (+0000) Subject: replace list.count() > 0 by !list.isEmpty() X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/fddd17030cf1da66415aad51e31575d2a1e2dda0 replace list.count() > 0 by !list.isEmpty() svn path=/trunk/KDE/kdebase/apps/; revision=1001386 --- diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index cd3195e9a..6d5e24dc5 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -88,7 +88,7 @@ void DolphinContextMenu::open() m_context |= TrashContext; } - if (!m_fileInfo.isNull() && (m_selectedItems.count() > 0)) { + if (!m_fileInfo.isNull() && !m_selectedItems.isEmpty()) { m_context |= ItemContext; // TODO: handle other use cases like devices + desktop files } @@ -394,7 +394,7 @@ void DolphinContextMenu::addRevisionControlActions(KMenu* menu) { const DolphinView* view = m_mainWindow->activeViewContainer()->view(); const QList revControlActions = view->revisionControlActions(m_selectedItems); - if (revControlActions.count() > 0) { + if (!revControlActions.isEmpty()) { foreach (QAction* action, revControlActions) { menu->addAction(action); } diff --git a/src/dolphincontroller.cpp b/src/dolphincontroller.cpp index 85ff5039f..eaa27c0f4 100644 --- a/src/dolphincontroller.cpp +++ b/src/dolphincontroller.cpp @@ -138,7 +138,7 @@ void DolphinController::handleKeyPressEvent(QKeyEvent* event) const bool trigger = currentIndex.isValid() && ((event->key() == Qt::Key_Return) || (event->key() == Qt::Key_Enter)) - && (selModel->selectedIndexes().count() > 0); + && !selModel->selectedIndexes().isEmpty(); if (trigger) { const QModelIndexList indexList = selModel->selectedIndexes(); foreach (const QModelIndex& index, indexList) { diff --git a/src/draganddrophelper.cpp b/src/draganddrophelper.cpp index fa4c98566..637117a2b 100644 --- a/src/draganddrophelper.cpp +++ b/src/draganddrophelper.cpp @@ -64,7 +64,7 @@ void DragAndDropHelper::startDrag(QAbstractItemView* itemView, isDragging = true; QModelIndexList indexes = itemView->selectionModel()->selectedIndexes(); - if (indexes.count() > 0) { + if (!indexes.isEmpty()) { QMimeData *data = itemView->model()->mimeData(indexes); if (data == 0) { return; diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp index d4c52a047..9f417a379 100644 --- a/src/panels/information/informationpanelcontent.cpp +++ b/src/panels/information/informationpanelcontent.cpp @@ -424,7 +424,7 @@ void InformationPanelContent::configureSettings() ++it; } - if (actions.count() > 0) { + if (!actions.isEmpty()) { popup.addSeparator(); // add all items alphabetically sorted to the popup diff --git a/src/revisioncontrolobserver.cpp b/src/revisioncontrolobserver.cpp index d6c2cb675..5b3c38947 100644 --- a/src/revisioncontrolobserver.cpp +++ b/src/revisioncontrolobserver.cpp @@ -63,7 +63,7 @@ void UpdateItemStatesThread::setData(RevisionControlPlugin* plugin, void UpdateItemStatesThread::run() { - Q_ASSERT(m_itemStates.count() > 0); + Q_ASSERT(!m_itemStates.isEmpty()); Q_ASSERT(m_plugin != 0); // it is assumed that all items have the same parent directory