Bug 494287 - Can't create new file after deleting a directory
Summary: Can't create new file after deleting a directory
Status: REPORTED
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: 24.08.1
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-08 10:16 UTC by sebaro
Modified: 2024-10-25 06:54 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sebaro 2024-10-08 10:16:10 UTC
SUMMARY
Can't create a new file after deleting a directory or after canceling the creation of a new directory

STEPS TO REPRODUCE
1. Delete a directory or create a new directory but cancel on prompt.
2. Create a new file.  The file name input is filled with " (1)" and the warning "The name ‘ (1)’ starts with a space, which will result in it being shown before other items when sorting alphabetically, among other potential oddities.".
3. Enter the file name and confirm.

OBSERVED RESULT
The new file is not created.

EXPECTED RESULT
The new file is created.

SOFTWARE/OS VERSIONS
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2

ADDITIONAL INFORMATION
In Dolphin I don't have this issue.
Comment 1 Stefano Crocco 2024-10-08 14:43:22 UTC
I tried to reproduce it following the steps you mentioned, but for me everything worked correctly. Just to be sure I'm doing the same you did:
- how did you delete the directory? Using the "Delete" menu entry (Shift+Del)? Using "Move to Trash"? Some other way? I used both "Delete" and "Move to Trash" with the same result
- how did you create the new file? I tried both the "Create new/Text File" and "Create new/Empty File" context menu entry
- in which directory did you do all this? I tried both in /tmp/ and in my home directory
- was there anything special in the name of the directories (both the one you were in and the one you deleted)?

I find it very strange, as I think Konqueror delegates all file managing (including creating and deleting files and directories) to the Dolphin part, which is the same used by Dolphin itself.

Could you please try creating a new user and checking whether the same problem happens with the new user?
Comment 2 sebaro 2024-10-08 19:49:06 UTC
I use FVWM which starts apps with "exec", for some reason this causes this issue:
> exec konqueror /home
If I redirect stderr to /dev/null the issue is gone:
> exec konqueror /home 2>/dev/null
A simple test would be to start X with "exec konqueror" in xinirc file.
Comment 3 sebaro 2024-10-09 06:20:27 UTC
It happens only when I redirect xinit/startx stderr to /home, my user home directory:
> xinit 2>/home/session.log
It's ok when I use a different directory:
> xinit 2>/tmp/session.log
or when in fvwm/xinitrc I redirect konqueror stderr to a directory other than /home
> xinit 2>/home/session.log
> exec konqueror 2>/nothome/session.log
Comment 4 Stefano Crocco 2024-10-09 12:18:22 UTC
Thanks for the additional information. I'll look into it, but I don't think I'll have time to do so before the end of next week.
Comment 5 Stefano Crocco 2024-10-20 17:08:07 UTC
I tried everything you said, but I couldn't reproduce your issue.

Have you tried checking whether this also happen with a new user?
Comment 6 sebaro 2024-10-23 08:17:35 UTC
The problem is caused by ~/.config/user-dirs.dirs

XDG_DESKTOP_DIR="$HOME/Temp"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Graphics"
XDG_VIDEOS_DIR="$HOME/Videos"
XDG_TEMPLATES_DIR="$HOME/"
XDG_PUBLICSHARE_DIR="$HOME/"

Removing the last two lines fixes the issue.
Comment 7 Stefano Crocco 2024-10-24 19:56:32 UTC
I think this is related to a change in the KIO framework which interprets any file in the directory $XDG_TEMPLATES_DIR as a template to be added to the "Create New" context menu entry. Which version of the KDE Frameworks are you using? You can check this by choosing the "Help/About Konqueror" menu entry in Konqueror then looking at the "Components" tab. If the KDE Frameworks listed there is 6.7.0, then you have this change. In this case, your "Create New" context menu entry should (after adding back the line XDG_TEMPLATES_DIR="$HOME/" to ~/.config/user-dirs.dirs) contain a list of all files and directories in your home directory: do you see any strange-looking entry in the menu? I'm asking because I, too, have XDG_TEMPLATES_DIR="$HOME/" and I'm not experiencing your issue, so I think there's something else involved in it.
Comment 8 sebaro 2024-10-25 06:54:36 UTC
KDE Frameworks Version: 6.6.0
KDE Apps Version: 24.08.1
Qt Version: 6.7.2

It happens only when I start xinit/startx with stderr redirected in user home directory and the two entries in the xdg dirs config file:
xinit 2>/home/session.log
XDG_TEMPLATES_DIR="$HOME/"
XDG_PUBLICSHARE_DIR="$HOME/"

It's the same as root, /root/.config/user-dirs.dirs, start xinit as root, stderr redirected in /root.

I don't have other issues wit Konqueror. For me it's ok if I remove the two entries in the xdg file, I don't even know what they are.
You can close this bug, it is not easy to replicate, most people don't use xinit.
Thanks for looking into this issue.