Skip to content

FolderView: Disallow closing popup when creating new item

When user opens the folder popup, either through the hover action or clicking the down-arrow button on folder icon on the desktop, this opens a popup. User can use that to create new items inside that folder.

Previously this would crash, as opening the KNewFileMenu dialog would close the popup: This would cause the dialog to have a dangling pointer to the non-existent popup. Even if this worked, it would be weird UX, since the popup where user is creating items would close, not showing the file appearing there.

Instead, we tell the FolderViewDialog when it's allowed to be destroyed. Check first in foldermodel if we're creating any new files, then signal it to the FolderView, which then propagates it to FolderViewDialog. If we're creating anything, tell the FolderViewDialog to ignore any destruction attempts.

This keeps the popup open until the action is done, either after creation or rejection.

Edited by Akseli Lahtinen

Merge request reports

Loading