Skip to content

Prevent using home directory as template directory

Fix unintentionally using home directory as template directory when configured incorrectly

BUG: 494679

On Fedora (my system) and other distros, the template directory can sometimes be set to the home directory. This means when trying to create a new folder in Dolphin, it instead offers you every item in the home directory as a template. Using a folder as a template makes it copy all the files... which is the correct template behavior, except that I didn't want my home directory to be a template! Also, if the home has enough items, it makes the New Folder option appear off top of the screen. Though that seems like a separate issue.

This checks if the template dir is the home dir, and if it is, does not use it as a template dir. As noted in the bug, this is only part of the ideal solution- there should be a warning shown to the user somehow that their templates aren't set up correctly, or offer a way to create one. However, this fix is enough to get the biggest issue out of the way.

I tested the fix and it works.

This is my first contribution, so if I did something wrong let me know.

Merge request reports