From 37c496b2baafb0518eec1d440413d6ce4033c7b9 Mon Sep 17 00:00:00 2001 From: Dan Dennedy Date: Tue, 21 Jan 2025 16:10:48 -0800 Subject: [PATCH] fix Show in Files not updating File > Location --- src/docks/filesdock.cpp | 10 +++++----- src/docks/filesdock.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/docks/filesdock.cpp b/src/docks/filesdock.cpp index 53930e9c6b..ea679a378e 100644 --- a/src/docks/filesdock.cpp +++ b/src/docks/filesdock.cpp @@ -1087,7 +1087,7 @@ void FilesDock::onOpenActionTriggered() } } -void FilesDock::changeDirectory(const QString &filePath, bool resetLocations) +void FilesDock::changeDirectory(const QString &filePath) { LOG_DEBUG() << filePath; QFileInfo info(filePath); @@ -1099,10 +1099,10 @@ void FilesDock::changeDirectory(const QString &filePath, bool resetLocations) index = m_filesModel->setRootPath(path); Settings.setFilesCurrentDir(path); ui->locationsCombo->setToolTip(path); + if (path != ui->locationsCombo->currentText()) + ui->locationsCombo->setCurrentText(path); m_view->setRootIndex(m_filesProxyModel->mapFromSource(index)); m_iconsView->updateSizes(); - if (resetLocations) - ui->locationsCombo->setCurrentIndex(0); if (info.isDir()) { m_view->scrollToTop(); } else { @@ -1311,7 +1311,7 @@ void FilesDock::onLocationsEditingFinished() if (QLatin1String("/") == path) path = QStringLiteral("C:/"); #endif - changeDirectory(path, false); + changeDirectory(path); } void FilesDock::on_locationsCombo_activated(int index) @@ -1328,7 +1328,7 @@ void FilesDock::on_locationsCombo_activated(int index) if (QLatin1String("/") == path) path = QStringLiteral("C:/"); #endif - changeDirectory(path, false); + changeDirectory(path); } void FilesDock::on_addLocationButton_clicked() diff --git a/src/docks/filesdock.h b/src/docks/filesdock.h index 8ba4ccb154..03954ffac5 100644 --- a/src/docks/filesdock.h +++ b/src/docks/filesdock.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Meltytech, LLC + * Copyright (c) 2024-2025 Meltytech, LLC * * 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 @@ -59,7 +59,7 @@ class FilesDock : public QDockWidget public slots: void onOpenActionTriggered(); - void changeDirectory(const QString &path, bool resetLocations = true); + void changeDirectory(const QString &path); void changeFilesDirectory(const QModelIndex &index); private slots: