])))
4494-������������������������������ mkdir(szMyStuffTarget, 0777);
4495-�������������� }
Windows Vista (and newer) do not nest the User profile directories. Since Wine is targeting Windows 7 by default - this
legacy behaviour should be removed. (As an end user, who used to use Windows XP, this was simply an annoying default
layout anyway.)
5)
4447-������������������������������ /* '$HOME/My Documents' exists. Create 'My Pictures',
4448-�������������������������������� * 'My Videos' and 'My Music' subfolders or fail silently if
4449-�������������������������������� * they already exist.
4450-�������������������������������� */
4451-������������������������������ for (i = 0; i < ARRAY_SIZE(aidsMyStuff); i++)
4452-������������������������������ {
4453-�������������������������������������� strcpy(szMyStuffTarget, szPersonalTarget);
4454-�������������������������������������� if (_SHAppendToUnixPath(szMyStuffTarget, MAKEINTRESOURCEW(aidsMyStuff[i])))
4455-���������������������������������������������� mkdir(szMyStuffTarget, 0777);
4456-������������������������������ }
4457-������������������������������ break;
Ditto as per (4). This is an obsolete User Profile directory layout (pre-Vista).
Also if "${HOME}/My Documents" exists then this block of code will start creating subdirectories in this
folder. I don't think that Wine should be making the rather arbitrary assumption that a Wine user wants
their "${HOME}" directory spammed with new subdirectories.
I often read online, comments from Wine users, complaining about this sort of behaviour...
6)
4543-������ /* Last but not least, the Desktop folder */
4544-������ if (pszHome)
4545-�������������� strcpy(szDesktopTarget, pszHome);
4546-������ else
4547-�������������� strcpy(szDesktopTarget, pszPersonal);
4548-������ heap_free(pszPersonal);
4549-
4550-������ xdg_desktop_dir = xdg_results ? xdg_results[num - 1] : NULL;
4551-������ if (xdg_desktop_dir ||
4552-�������������� (_SHAppendToUnixPath(szDesktopTarget, DesktopW) &&
4553-�������������� !stat(szDesktopTarget, &statFolder) && S_ISDIR(statFolder.st_mode)))
4554-������ {
4555-�������������� hr = SHGetFolderPathW(NULL, CSIDL_DESKTOPDIRECTORY|CSIDL_FLAG_CREATE, NULL,
4556-���������������������������������������������������������� SHGFP_TYPE_DEFAULT, wszTempPath);
4557-�������������� if (SUCCEEDED(hr) && (pszDesktop = wine_get_unix_file_name(wszTempPath)))
4558-�������������� {
4559-���������������������� remove(pszDesktop);
4560-���������������������� if (xdg_desktop_dir)
4561-������������������������������ symlink(xdg_desktop_dir, pszDesktop);
4562-���������������������� else
4563-������������������������������ symlink(szDesktopTarget, pszDesktop);
4564-���������������������� heap_free(pszDesktop);
4565-�������������� }
4566-������ }
This code uses pszPersonal as a fallback target for when HOME is unset.
This will be the equivalent of:
"${WINEPREFIX}/dosdevices/c:/users/${USER}/My Documents"
Say the XDG_DESKTOP_DIR check fails. Then Wine tries to find the directory:
"${WINEPREFIX}/dosdevices/c:/users/${USER}/My Documents/Desktop"
as a symlink target. Which never succeeds because Wine never creates this directory...
This extra path appears to be redundant (HOME unset / XDG_DESKTOP_DIR unset).
--------------------------------------------------------------------------------------------------------------------------------
I can of course leave the variable names unchanged and the function name.
I was "told off" for not using snake case on a previous Wine commit - so I assumed
I had to follow this standard if I wanted to refactor existing code. :-)
I'd like to tidy this function up and make it more readable (including the comments).
Which I can do in staged patches, as you suggested.
But obviously I'd like to feel that we are both on the "same page" about the changes
I discussed (above). Before I email in a v3 staged patchset.