Bug 258784 - KDirOperator creates new files and folders (via context menu item) in the current directory, not the directory that's right-clicked on
Summary: KDirOperator creates new files and folders (via context menu item) in the cur...
Status: RESOLVED WORKSFORME
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2010-12-04 12:09 UTC by Christian González
Modified: 2020-04-08 10:06 UTC (History)
6 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian González 2010-12-04 12:09:08 UTC
Version:           unspecified (using KDE 4.5.4) 
OS:                Linux

When creating a new file within kate per right click in the directory tree view, it is NOT created in the correct folder.

Reproducible: Always

Steps to Reproduce:
- Open kate, show the filesystembrowser on the left side, open a directory with a substructure.
- Right-click on any directory in the mid of the tree, "Create new" -> "Text file..."
- Give it a name and press Enter

Actual Results:  
the file is created in the root dir of the view

Expected Results:  
the file should be created IN the selected folder where the right-click occurs.

OS: Linux (x86_64) release 2.6.35-23-generic
Compiler: cc
Comment 1 Christian González 2010-12-04 12:13:32 UTC
Additional hint: when the file is created, per default it should be opened in the editor. I don't want to create an empty file WITHIN kate and NOT edit it.

IMO should be easy to fix
Comment 2 FiNeX 2011-01-29 15:54:30 UTC
Bug reproduced in KDE 4.6.0
Comment 3 Christian González 2011-07-07 20:00:52 UTC
still in 4.6.4
Comment 4 Thomas Fjellstrom 2011-07-07 20:06:26 UTC
If you haven't saved it yet, the filename the tree gets is "Untitled" and it has no path. AFAIK it isn't a filetree bug.
Comment 5 Christian González 2011-07-08 18:12:37 UTC
This is not true.
Please do exact what I described above:
open a tree like:

temp
  temp2

Now right-click on "temp2" and create a file or a dir there.
it always is created in the "root" directory of the view, in this case as sibling of "temp".
This has nothing to do with havin a file not saved. It IS saved immideately, but in the wrong dir. A better approach, yes, would be, after havin it created in the right dir, to open it in the editor as well, as this is the most wanted thing I do when I create a file in the tree WITHIN the editor, otherwise I could create it in Dolphin...
Comment 6 Thomas Fjellstrom 2011-07-08 18:21:54 UTC
If the fs browser isn't opening the file, then I'm surprised its showing up in the filetree at all. I suppose I can try taking a look at it, I still doubt its a filetree bug.
Comment 7 Christian González 2011-07-14 18:35:58 UTC
Did you test it?
Comment 8 Thomas Fjellstrom 2011-07-14 19:11:34 UTC
(In reply to comment #7)
> Did you test it?

Just now. The filebrowser isn't actually causing kate to open the file. So the filetree doesn't know about it. Also I tried right clicking on a folder and going "create new" but it created the file in the current dir, not the one right clicked.. Thinking about it, thats probably what you meant? You want the file to appear inside the dir you right click on? If so, I was confused and thought you meant the filetree (the main document view) was what was showing a problem, and not the filebrowser plugin. Who ever is in charge of the filebrowser plugin might want to take a look at this.
Comment 9 Christian González 2011-07-14 20:13:57 UTC
Exactly. I meant the file browser plugin, not the document tree.
This is an importand plugin (Textmate/OSX or Gedit/GNOME does it right)
Comment 10 Christian González 2011-11-12 15:43:33 UTC
I just saw that KDevelop (which has a similar plugin) creates the files/dirs in the right place - maybe you could save some time and share code with KDevelop?
This bug is nasty.
Can I help (as unexperienced programmer/experienced user) with this to help you fix it?
Comment 11 Dominik Haumann 2011-11-13 17:02:56 UTC
KDevelops "Filesystem" also creates files in the "root" folder the dir operator is currently showing. This is not a Kate or KDevelop issue.

If you want the context menu to create new folders/files in the folder of the context menu, it needs to be fixed in kdelibs, hence, reassign.
Comment 12 Christian González 2012-02-01 21:46:49 UTC
any hints - how can I (as unexperienced programmer, but heavy user) help?
Comment 13 Christian González 2012-10-14 18:02:51 UTC
Again: can I help to get rid of this bug as user? I don't know anything of the C++ kate internals... But If I can help in a way...?
Comment 14 Dan Dart 2016-11-23 23:19:06 UTC
Reproducible in 15.12. Also I note that (related) files can't be moved using the tree view as one would expect.
Comment 15 Ahmad Samir 2020-04-08 10:06:32 UTC
I've just tested this and it seems to have been fixed. Feel free to reopen if you still see this issue with a recent KF version.