Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TreeBrowser: Allow new file/folder in top level #960

Merged
merged 1 commit into from Jan 22, 2022

Conversation

ChrisJAllan
Copy link
Contributor

@ChrisJAllan ChrisJAllan commented Mar 9, 2020

Uses the URI to get parent instead of the tree to allow for insertion at the top level.

Fixes #1152

@ChrisJAllan
Copy link
Contributor Author

Fixed being unable to create file from empty folder item "(Empty)".

@eht16
Copy link
Member

eht16 commented Jan 8, 2022

The assignment could be written shorter as: SETPTR(uri, g_path_get_dirname(uri)); but this is rather a matter of taste.

I tested the changes and it "probably" works. I cannot test for sure as my / (root) is not writable for my user and this is good. This is probably also why nobody noticed earlier, I guess the root directory isn't writable for most users, maybe except on Windows and macOS.

@ChrisJAllan just for my curiosity, are you on Linux and your / is user writable?

@ChrisJAllan ChrisJAllan changed the title TreeBrowser: Allow new file/folder in root folder TreeBrowser: Allow new file/folder in tree root Jan 8, 2022
@ChrisJAllan
Copy link
Contributor Author

ChrisJAllan commented Jan 8, 2022

Ah, I guess this was worded poorly. I meant the top folder shown in the tree browser, not /.

@ChrisJAllan ChrisJAllan changed the title TreeBrowser: Allow new file/folder in tree root TreeBrowser: Allow new file/folder in top level Jan 8, 2022
@eht16
Copy link
Member

eht16 commented Jan 9, 2022

Then I don't understand how to create a new file/folder without a parent.
Whenever I right-click a file/folder on the top level of the tree and choose "New Folder", it is created as expected.
Could you maybe precise the steps to reproduce?

Btw, it was not necessary to create a seperate issue for this, describing the problem and steps to reproduce in the PR description is usually enough.

@ChrisJAllan
Copy link
Contributor Author

ChrisJAllan commented Jan 9, 2022

At the top level:

2022-01-09.08-57-47.mp4

At non-top level:

2022-01-09.08-59-48.mp4

The behavior here should be the same and allow for creating files in the current directory.

I have tested this on Arch and Ubuntu, same problem. It does create at the top level if nothing is selected, but it's not obvious how to deselect after a file is selected (refresh does it, but that's a terribly convoluted user experience).

@ChrisJAllan
Copy link
Contributor Author

Update: use SETPTR and rebase

@eht16
Copy link
Member

eht16 commented Jan 22, 2022

Thanks for the explanation, I was finally able to reproduce the issue.

@eht16 eht16 merged commit 0abcc76 into geany:master Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TreeBrowser: "New File" and "New Folder" do nothing when top level file is selected
2 participants