From 0cdcf041cf18db77a74ecd829f2e6bb586aabe08 Mon Sep 17 00:00:00 2001 From: Heiko Becker Date: Tue, 27 Jul 2021 21:29:00 +0200 Subject: [PATCH 1/4] GIT_SILENT Upgrade release service version to 21.07.90. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9679e4a6f9..7503dae923 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.16) # KDE Application Version, managed by release script set (RELEASE_SERVICE_VERSION_MAJOR "21") set (RELEASE_SERVICE_VERSION_MINOR "07") -set (RELEASE_SERVICE_VERSION_MICRO "80") +set (RELEASE_SERVICE_VERSION_MICRO "90") set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}") project(Dolphin VERSION ${RELEASE_SERVICE_VERSION}) From ea7d4f059d5cb81b51053e7fec6492a727a968c2 Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Wed, 28 Jul 2021 12:54:10 -0600 Subject: [PATCH 2/4] Revert "Don't session-restore invalid paths" This reverts commit c733b3aa9787a618a0ce5bb03b3fc731f5663b21. There are people who prefer the old behavior of session-restoring all paths including the ones which are currently inaccessible. The idea is that Dolphin is like a web browser; if a website is not currently available, the browser tells you that instead of silently discarding the URL and showing you the homepage. Doing this can be considered a form of data loss. In addition, the reason for the change was to prevent Dolphin from showing invalid paths on launch for unmounted removable disks, but that specific case was fixed separately by switching to ~ for any tabs/views that were showing locations on a just-unmounted removable disk. So you will never run into the problem if yo unmount a disk in Dolphin and then close it. Accordingly, let's revert the change because it causes more problems than it resolves. BUG: 439864 CCBUG: 427619 FIXED-IN: 21.08 --- src/dolphinmainwindow.cpp | 14 -------------- src/dolphinmainwindow.h | 6 ------ src/main.cpp | 4 ---- 3 files changed, 24 deletions(-) diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index fe39d4d2fb..52b3e8d6ab 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -239,20 +239,6 @@ QVector DolphinMainWindow::viewContainers() const return viewContainers; } -void DolphinMainWindow::setViewsWithInvalidPathsToHome() -{ - const QVector theViewContainers = viewContainers(); - for (DolphinViewContainer *viewContainer : theViewContainers) { - - // Only consider local dirs, not remote locations and abstract protocols - if (viewContainer->url().isLocalFile()) { - if (!QFileInfo::exists(viewContainer->url().toLocalFile())) { - viewContainer->setUrl(QUrl::fromLocalFile(QDir::homePath())); - } - } - } -} - void DolphinMainWindow::openDirectories(const QList& dirs, bool splitView) { m_tabWidget->openDirectories(dirs, splitView); diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h index 594c75691f..3a29d1c0a4 100644 --- a/src/dolphinmainwindow.h +++ b/src/dolphinmainwindow.h @@ -105,12 +105,6 @@ public: */ void setViewsToHomeIfMountPathOpen(const QString& mountPath); - /** - * Sets any of the window's view containers which are currently displaying - * invalid locations to the home path - */ - void setViewsWithInvalidPathsToHome(); - bool isFoldersPanelEnabled() const; bool isInformationPanelEnabled() const; diff --git a/src/main.cpp b/src/main.cpp index fba45f43c4..76b482688a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -204,10 +204,6 @@ int main(int argc, char **argv) if (startedWithURLs) { mainWindow->openDirectories(urls, splitView); } - - // Now handle invalid locations in the set of active views to - // avoid issues like https://bugs.kde.org/show_bug.cgi?id=427619 - mainWindow->setViewsWithInvalidPathsToHome(); } else { qCWarning(DolphinDebug) << "Unknown class " << className << " in session saved data!"; } From 7edce5a09c768805878d15e225cd063fb037cef3 Mon Sep 17 00:00:00 2001 From: Felix Ernst Date: Sat, 31 Jul 2021 17:01:52 +0200 Subject: [PATCH 3/4] Fix width issues when un-maximizing Dolphin Before this commit un-maximizing or to be more precise instantly changing the size of the window by a large amount could potentially change the width of the sidebars, the viewContainers and the window itself to unexpected/undesired widths. This happened because the spacing calculation is triggered when the primary ViewContainer is resized but at this point in time some of the other widgets, especially the secondary ViewContainer and the navigatorsWidget have generally not been resized yet. Therefore the width and spacing calculations are based on partly updated and partly outdated values leading to wrong results. This commit makes it so calculation of spacings is delayed until all widths have been updated. Yes, spacing probably should not have the power to resize the window but unfortunately the spacing can not be set to be less forceful when taking space because otherwise the UrlNavigators will take all space they can get with their QSizePolicy::MinimumExpanding. BUG: 430521 FIXED-IN: 21.08 --- src/dolphinnavigatorswidgetaction.cpp | 13 ++++++++++++- src/dolphinnavigatorswidgetaction.h | 6 ++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/dolphinnavigatorswidgetaction.cpp b/src/dolphinnavigatorswidgetaction.cpp index d66125af6c..4da5229ff8 100644 --- a/src/dolphinnavigatorswidgetaction.cpp +++ b/src/dolphinnavigatorswidgetaction.cpp @@ -47,6 +47,7 @@ DolphinNavigatorsWidgetAction::DolphinNavigatorsWidgetAction(QWidget *parent) : void DolphinNavigatorsWidgetAction::adjustSpacing() { + m_previousWindowWidth = parentWidget()->window()->width(); auto viewGeometries = m_viewGeometriesHelper.viewGeometries(); const int widthOfSplitterPrimary = viewGeometries.globalXOfPrimary + viewGeometries.widthOfPrimary - viewGeometries.globalXOfNavigatorsWidget; const QList splitterSizes = {widthOfSplitterPrimary, @@ -310,7 +311,17 @@ DolphinNavigatorsWidgetAction::ViewGeometriesHelper::ViewGeometriesHelper bool DolphinNavigatorsWidgetAction::ViewGeometriesHelper::eventFilter(QObject *watched, QEvent *event) { if (event->type() == QEvent::Resize) { - m_navigatorsWidgetAction->adjustSpacing(); + if (m_navigatorsWidgetAction->parentWidget()->window()->width() != m_navigatorsWidgetAction->m_previousWindowWidth) { + // The window is being resized which means not all widgets have gotten their new sizes yet. + // Let's wait a bit so the sizes of the navigatorsWidget and the viewContainers have all + // had a chance to be updated. + m_navigatorsWidgetAction->m_adjustSpacingTimer->start(); + } else { + m_navigatorsWidgetAction->adjustSpacing(); + // We could always use the m_adjustSpacingTimer instead of calling adjustSpacing() directly + // here but then the navigatorsWidget doesn't fluently align with the viewContainers when + // the DolphinTabPage::m_expandViewAnimation is animating. + } return false; } return QObject::eventFilter(watched, event); diff --git a/src/dolphinnavigatorswidgetaction.h b/src/dolphinnavigatorswidgetaction.h index 6f5f8e7af6..3f50728e93 100644 --- a/src/dolphinnavigatorswidgetaction.h +++ b/src/dolphinnavigatorswidgetaction.h @@ -216,6 +216,12 @@ private: }; ViewGeometriesHelper m_viewGeometriesHelper; + + /** + * Used to check if the window has been resized. + * @see ViewGeometriesHelper::eventFilter() for why this is needed. + */ + int m_previousWindowWidth = -1; }; #endif // DOLPHINNAVIGATORSWIDGETACTION_H From f190ae1cf8fc1c1bf0d87899a84f796a3e473032 Mon Sep 17 00:00:00 2001 From: Jordan Bucklin Date: Sat, 31 Jul 2021 12:31:49 -0700 Subject: [PATCH 4/4] Fix how --select treats files Previously, when passing file URLs with the --select option, Dolphin would open the file in its corresponding application, as well as opening an empty tab in Dolphin as if the file were a directory. This happens specifically when trying to restore a session. This commit prevents Dolphin from opening a file in an application and from opening an empty tab while passing the --select option, and selects the URLs instead. BUG: 436584 --- src/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 76b482688a..6e9ef0b2a6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -202,7 +202,11 @@ int main(int argc, char **argv) // If the user passed any URLs to Dolphin, open those in the // window after session-restoring it if (startedWithURLs) { - mainWindow->openDirectories(urls, splitView); + if (openFiles) { + mainWindow->openFiles(urls, splitView); + } else { + mainWindow->openDirectories(urls, splitView); + } } } else { qCWarning(DolphinDebug) << "Unknown class " << className << " in session saved data!";