On Sun Jan 8 19:49:29 2023 +0000, Gabriel Ivăncescu wrote:
Yeah, of course, should probably be a separate follow-up MR. I was just mentioning that I don't think there's a simpler way, unfortunately.
After staring at folder definitions for a bit, doesn't look like there's an obvious way of filtering them to get the same set of folders used on Windows, at least by just attributes and flags.
Hardcoding the list of accepted known folders is an option. By relying on `IShellFolder::GetDisplayNameOf` with `SHGDN_NORMAL` for round trip conversion. But from 19 default folders (that I could find by typing each letter in address edit on Windows 10) only 5 of those can work ,_, - Desktop - Computer - Trash - Documents - Control Panel (kind of useless for file picker, so could be removed)
2 of them don't exist on Wine (as in as folder in the prefix) at the moment: - Libraries - 3D Objects
Then there's `Network` which has `My Network Places` name on Wine, not sure if it even works.
Other don't have a virtual folder that's different from real path (so real path ends up converted into known folder as well) - User (C:\users%USERNAME%) - Contacts - Downloads - Favorites - Music - Pictures - Videos - Public Documents - Public Music - Public Pictures - Public Videos
`IShellFolder::GetDisplayNameOf` also doesn't return `Public` prefix on public folders, so they clash with user folders.
Pushed the prototype as a separate commit for now, in case it's too hacky.