]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kfileitemmodel.cpp
Merge branch 'release/20.08' into master
[dolphin.git] / src / kitemviews / kfileitemmodel.cpp
index 5e9603ba1876a539b6f6837e3a283f266aa9b8ea..28376c5d0c3c0ef841589b049661f42358fbc551 100644 (file)
@@ -1,23 +1,10 @@
-/*****************************************************************************
- *   Copyright (C) 2011 by Peter Penz <peter.penz19@gmail.com>               *
- *   Copyright (C) 2013 by Frank Reininghaus <frank78ac@googlemail.com>      *
- *   Copyright (C) 2013 by Emmanuel Pescosta <emmanuelpescosta099@gmail.com> *
- *                                                                           *
- *   This program is free software; you can redistribute it and/or modify    *
- *   it under the terms of the GNU General Public License as published by    *
- *   the Free Software Foundation; either version 2 of the License, or       *
- *   (at your option) any later version.                                     *
- *                                                                           *
- *   This program is distributed in the hope that it will be useful,         *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of          *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
- *   GNU General Public License for more details.                            *
- *                                                                           *
- *   You should have received a copy of the GNU General Public License       *
- *   along with this program; if not, write to the                           *
- *   Free Software Foundation, Inc.,                                         *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA              *
- *****************************************************************************/
+/*
+ * SPDX-FileCopyrightText: 2011 Peter Penz <peter.penz19@gmail.com>
+ * SPDX-FileCopyrightText: 2013 Frank Reininghaus <frank78ac@googlemail.com>
+ * SPDX-FileCopyrightText: 2013 Emmanuel Pescosta <emmanuelpescosta099@gmail.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
 
 #include "kfileitemmodel.h"
 
@@ -247,7 +234,7 @@ QMimeData* KFileItemModel::createMimeData(const KItemSet& indexes) const
 
     // The following code has been taken from KDirModel::mimeData()
     // (kdelibs/kio/kio/kdirmodel.cpp)
-    // Copyright (C) 2006 David Faure <faure@kde.org>
+    // SPDX-FileCopyrightText: 2006 David Faure <faure@kde.org>
     QList<QUrl> urls;
     QList<QUrl> mostLocalUrls;
     const ItemData* lastAddedItem = nullptr;
@@ -1770,12 +1757,12 @@ int KFileItemModel::sortRoleCompare(const ItemData* a, const ItemData* b, const
 
             QVariant valueA, valueB;
             if (DetailsModeSettings::directorySizeCount()) {
+                valueA = a->values.value("count");
+                valueB = b->values.value("count");
+            } else {
                 // use dir size then
                 valueA = a->values.value("size");
                 valueB = b->values.value("size");
-            } else {
-                valueA = a->values.value("count");
-                valueB = b->values.value("count");
             }
             if (valueA.isNull() && valueB.isNull()) {
                 result = 0;