X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/f2aae09edd023bb0bb4e56e6662bc0afc9550e54..2bd97cd745bc7f08c1443c8917fde4e5ef25e7f1:/src/dolphinview.cpp
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp
index b74cbea53..31b9de785 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
@@ -530,16 +534,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));
+ if (folderCount + fileCount == 1) {
+ // if only one item is selected, show the filename
+ const QString name = list.first().name();
+ text = (folderCount == 1) ? i18nc("@info:status", "%1 selected", name) :
+ i18nc("@info:status", "%1 selected (%2)",
+ name, KIO::convertSize(totalFileSize));
} else {
- Q_ASSERT(folderCount > 0);
- text = foldersText;
+ // at least 2 items are selected
+ 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);
@@ -900,7 +913,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)
@@ -1292,6 +1305,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) {