X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/98139616ac65bb0b96352da03d2c106bd9c8f8bb..040bdcea237e2576aad744bc4e7b5cadedcc98dc:/src/dolphinview.cpp diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index f381bf073..aec798d31 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -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) {