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

Recent folders/files: Remove non-existing directories on attempt to open #375

Closed
tomlin7 opened this issue Jul 9, 2024 · 2 comments · Fixed by #454
Closed

Recent folders/files: Remove non-existing directories on attempt to open #375

tomlin7 opened this issue Jul 9, 2024 · 2 comments · Fixed by #454
Assignees
Labels
enhancement New feature or request file management file watchers, handling of opened files and folders, etc good first issue good for newcomers

Comments

@tomlin7
Copy link
Owner

tomlin7 commented Jul 9, 2024

Feature

The recently opened list may contain directories that no longer exist. On attempt to open such directories from recent links, remove them from database.

The recently opened files/folders are shown as a list in welcome page and through the palette.
These leverage the list method here to generate lambda functions for each recent path.

image

Modify the lambda to call a custom function that will check if the path still exists. If it exists, proceed to open, otherwise, delete the path from db and return.

@tomlin7 tomlin7 added enhancement New feature or request file management file watchers, handling of opened files and folders, etc labels Jul 9, 2024
@tomlin7 tomlin7 self-assigned this Jul 9, 2024
@tomlin7 tomlin7 changed the title Remove non-existing directories from recently opened list on attempt to open Recent folders/files: Remove non-existing directories on attempt to open Oct 8, 2024
@tomlin7 tomlin7 added the good first issue good for newcomers label Oct 10, 2024
@Jawwad011
Copy link

To resolve the issue of opening non-existent directories from the recent list:

  1. Retrieve recently opened directories from the database.
  2. Check if each directory still exists using os.path.exists().
  3. Remove non-existent directories from the database.
  4. Commit the changes to keep the list updated.

@tomlin7
Copy link
Owner Author

tomlin7 commented Oct 10, 2024

@Jawwad011 thanks for the steps, as this is a rough issue outline opened months ago, I didn't document it properly, I'll add more details above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request file management file watchers, handling of opened files and folders, etc good first issue good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants