]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/draganddrophelper.cpp
replace list.count() > 0 by !list.isEmpty()
[dolphin.git] / src / draganddrophelper.cpp
index c80aec7869254b7e10071b06369b595899f9c100..637117a2b72a3af586dcc614173271fbb9969aa1 100644 (file)
@@ -55,14 +55,16 @@ void DragAndDropHelper::startDrag(QAbstractItemView* itemView,
                                   Qt::DropActions supportedActions,
                                   DolphinController* controller)
 {
-       //do not start a new drag until the previous one has been finished
-       //This is a (possibly temporary) fix for bug #187884
-       static bool isDragging = false;
-       if (isDragging) return;
-       isDragging = true;
+    // Do not start a new drag until the previous one has been finished.
+    // This is a (possibly temporary) fix for bug #187884.
+    static bool isDragging = false;
+    if (isDragging) {
+        return;
+    }
+    isDragging = true;
 
     QModelIndexList indexes = itemView->selectionModel()->selectedIndexes();
-    if (indexes.count() > 0) {
+    if (!indexes.isEmpty()) {
         QMimeData *data = itemView->model()->mimeData(indexes);
         if (data == 0) {
             return;
@@ -91,7 +93,7 @@ void DragAndDropHelper::startDrag(QAbstractItemView* itemView,
         drag->exec(supportedActions, Qt::IgnoreAction);
         m_dragSource = 0;
     }
-       isDragging = false;
+    isDragging = false;
 }
 
 bool DragAndDropHelper::isDragSource(QAbstractItemView* itemView)