mirror of
https://invent.kde.org/system/dolphin
synced 2024-07-04 17:30:55 +00:00
Check if namejob is already being run before opening new createDirectory dialog
This is a fix for a bug where in network views (or otherwise slow systems), pressing `Ctrl+Shift+N` multiple times opens multiple popup windows and thus causes a crash when any of the popups is interacted with after closing the topmost one. The problem is not the crash with popups themselves, but that we're opening multiple popups in the first place. In regular views this works fine, since the `nameJob` does not take long time at all and only one popup opens, immediately blocking the shortcut. In network views, the `nameJob` seems to take a while to run, since it is loading info from network. If user spams `Ctrl+Shift+N` shortcut in frustration, it starts more `nameJob`s and eventually when those jobs are done, it opens multiple popups. This code checks that if we're already running a `namejob`, we're very likely waiting for the `createDir` popup to appear, so we don't do anything until there is no more `nameJob` running. I've tested that it works in both network and regular Dolphin views. BUG:481401
This commit is contained in:
parent
6beb9dbc1f
commit
742566eb69
|
@ -8,7 +8,7 @@ set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE
|
||||||
project(Dolphin VERSION ${RELEASE_SERVICE_VERSION})
|
project(Dolphin VERSION ${RELEASE_SERVICE_VERSION})
|
||||||
|
|
||||||
set(QT_MIN_VERSION "6.4.0")
|
set(QT_MIN_VERSION "6.4.0")
|
||||||
set(KF6_MIN_VERSION "5.240.0")
|
set(KF6_MIN_VERSION "6.2.0")
|
||||||
|
|
||||||
# ECM setup
|
# ECM setup
|
||||||
find_package(ECM ${KF6_MIN_VERSION} CONFIG REQUIRED)
|
find_package(ECM ${KF6_MIN_VERSION} CONFIG REQUIRED)
|
||||||
|
|
|
@ -783,8 +783,14 @@ void DolphinMainWindow::updateNewMenu()
|
||||||
|
|
||||||
void DolphinMainWindow::createDirectory()
|
void DolphinMainWindow::createDirectory()
|
||||||
{
|
{
|
||||||
m_newFileMenu->setWorkingDirectory(activeViewContainer()->url());
|
// When creating directory, namejob is being run. In network folders,
|
||||||
m_newFileMenu->createDirectory();
|
// this job can take long time, so instead of starting multiple namejobs,
|
||||||
|
// just check if we are already running one. This prevents opening multiple
|
||||||
|
// dialogs. BUG:481401
|
||||||
|
if (!m_newFileMenu->isCreateDirectoryRunning()) {
|
||||||
|
m_newFileMenu->setWorkingDirectory(activeViewContainer()->url());
|
||||||
|
m_newFileMenu->createDirectory();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DolphinMainWindow::quit()
|
void DolphinMainWindow::quit()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user