]> cloud.milkyroute.net Git - dolphin.git/commit
Check if namejob is already being run before opening new createDirectory dialog
authorAkseli Lahtinen <akselmo@akselmo.dev>
Sat, 11 May 2024 15:59:03 +0000 (15:59 +0000)
committerFelix Ernst <felixernst@kde.org>
Sat, 11 May 2024 15:59:03 +0000 (15:59 +0000)
commit742566eb69e6bf46e7abb74e9ce9293c4b3ed7e8
tree34cf03f9909755023e0c5e8e5baaec1701378beb
parent6beb9dbc1f0c27b7b09d6ed0bc3719e9b0050950
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
CMakeLists.txt
src/dolphinmainwindow.cpp