Skip to content

Suppress hidden files in import dialog#13809

Merged
TurboGit merged 2 commits intodarktable-org:masterfrom
zisoft:import-suppress-hidden-files
Mar 4, 2023
Merged

Suppress hidden files in import dialog#13809
TurboGit merged 2 commits intodarktable-org:masterfrom
zisoft:import-suppress-hidden-files

Conversation

@zisoft
Copy link
Copy Markdown
Collaborator

@zisoft zisoft commented Mar 3, 2023

Trying to fix some old macOS issues...

fixes #11225

I think it doesn't make sense to display hidden files in the import dialog.

Found a strange bug: g_file_info_get_is_hidden() always returns 0, at least on macOS so I made an additional check if the filename starts with a .

@kmilos
Copy link
Copy Markdown
Contributor

kmilos commented Mar 3, 2023

A Step in the right direction 👍

I presume there is still an issue with recursive import though?

@zisoft
Copy link
Copy Markdown
Collaborator Author

zisoft commented Mar 3, 2023

I don't think so.
This function is called recursively, so the suppression should work as well.

@kmilos
Copy link
Copy Markdown
Contributor

kmilos commented Mar 3, 2023

Ok, sounded like it was UI only...

@victoryforce
Copy link
Copy Markdown
Collaborator

Found a strange bug: g_file_info_get_is_hidden() always returns 0, at least on macOS

I don't think it's a bug. Try the following: In Terminal, run the command

chflags hidden /path/to/the/file

You can check the success of the utility with a command

stat -f %f /path/to/the/file

This command should output 32768 (it outputs 0 for non-hidden files).

After that, check what g_file_info_get_is_hidden() returns on that file.

Apparently, .DS_Store files in macOS do not have a hidden attribute, and the Finder does not show them because of their special function and their name being reserved.

@zisoft
Copy link
Copy Markdown
Collaborator Author

zisoft commented Mar 4, 2023

I tried on my Mac:

chflags hidden /path/to/the/file

Finder does not show the file but g_file_info_get_is_hidden() still returns 0.

Apparently, .DS_Store files in macOS do not have a hidden attribute, and the Finder does not show them because of their special function and their name being reserved.

Yes, macOS handles Unix style hidden files (filename starts with a .) as well and does not show them. That's why I added the the check for filenames starting with a .

@TurboGit TurboGit added this to the 4.4 milestone Mar 4, 2023
@TurboGit TurboGit added the scope: DAM managing files, collections, archiving, metadata, etc. label Mar 4, 2023
Copy link
Copy Markdown
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@TurboGit TurboGit merged commit 5a4873f into darktable-org:master Mar 4, 2023
@zisoft zisoft deleted the import-suppress-hidden-files branch March 4, 2023 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: DAM managing files, collections, archiving, metadata, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS filesystem metadata files included on import

4 participants