]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinview.cpp
fixed issue that the preview size might get applied to the previous view when switchi...
[dolphin.git] / src / dolphinview.cpp
index f381bf07350f5d8e8f56126a85a38d88ffb24159..5ef00d60a1c5dd8964591ec60659a067272e6edf 100644 (file)
@@ -529,26 +529,25 @@ QString DolphinView::statusBarText() const
             }
             ++it;
         }
+        
+        const QString foldersText = i18ncp("@info:status", "1 Folder selected", "%1 Folders selected", folderCount);
+        const QString filesText = i18ncp("@info:status", "1 File selected", "%1 Files selected", fileCount);
+        if ((folderCount > 0) && (fileCount > 0)) {
+            text = i18nc("@info:status folders, files (size)", "%1, %2 (%3)",
+                         foldersText, filesText, KIO::convertSize(totalFileSize));
+        } else if (fileCount > 0) {
+            text = i18nc("@info:status files (size)", "%1 (%2)", filesText, KIO::convertSize(totalFileSize));
+        } else {
+            Q_ASSERT(folderCount > 0);
+            text = foldersText;
+        }
     } else {
         calculateItemCount(fileCount, folderCount, totalFileSize);
-    }
-    
-    if (folderCount > 0) {
-        text = hasSelection() ?
-               i18ncp("@info:status", "1 Folder selected", "%1 Folders selected", folderCount) :
-               i18ncp("@info:status", "1 Folder", "%1 Folders", folderCount);
-        if (fileCount > 0) {
-            text += i18nc("@info:status separator between 2 status infos", ", ");
-        }
+        text = KIO::itemsSummaryString(fileCount + folderCount,
+                                       fileCount, folderCount,
+                                       totalFileSize, true);
     }
 
-    if (fileCount > 0) {
-        const QString sizeText = KIO::convertSize(totalFileSize);
-        text += hasSelection() ?
-                i18ncp("@info:status", "1 File selected (%2)", "%1 Files selected (%2)", fileCount, sizeText) :
-                i18ncp("@info:status", "1 File (%2)", "%1 Files (%2)", fileCount, sizeText);
-    }    
-
     return text;
 }
 
@@ -901,7 +900,7 @@ void DolphinView::dropUrls(const KFileItem& destItem,
                            const KUrl& destPath,
                            QDropEvent* event)
 {
-    DragAndDropHelper::dropUrls(destItem, destPath, event, this);
+    DragAndDropHelper::instance().dropUrls(destItem, destPath, event, this);
 }
 
 void DolphinView::updateSorting(DolphinView::Sorting sorting)
@@ -1293,6 +1292,10 @@ void DolphinView::deleteView()
         m_topLayout->removeWidget(view);
         view->close();
         
+        disconnect(view);
+        m_controller->disconnect(view);
+        view->disconnect();
+        
         bool deleteView = true;
         foreach (const QAbstractItemView* expandedView, m_expandedViews) {
             if (view == expandedView) {