]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinview.cpp
when changing the view mode if the preview is turned on, the directory must get reloa...
[dolphin.git] / src / dolphinview.cpp
index f381bf07350f5d8e8f56126a85a38d88ffb24159..aec798d310d588446ae8a25ef55c66be921f7c2c 100644 (file)
@@ -222,7 +222,11 @@ void DolphinView::setMode(Mode mode)
     }
 
     emit modeChanged();
+    
     updateZoomLevel(oldZoomLevel);
+    if (m_showPreview) {
+        loadDirectory(viewPropsUrl);
+    }
 }
 
 DolphinView::Mode DolphinView::mode() const
@@ -529,26 +533,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 +904,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 +1296,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) {