Kornel Benko wrote:
> Am Mittwoch 14 Juli 2010 schrieb Joost Verburg:
>> On 7/13/2010 6:12 PM, Joost Verburg wrote:
>>> I think this should definitely be fixed for 1.6.8 but maybe we can go
>>> ahead now with 1.6.7.
>> Just discovered another issue. The user directory suffix for the 1.6
>> series has always been "16" (directory called lyx16), while CMake sets
>> it to "1.6" (directory called LyX1.6). There should be an option to
>> change this otherwise user preferences will not be preserved.
>>
>> Joost
>
> Don't understand. The _user_ directory is "~/.lyx" without setting
> environmate variables.
On Linux. He talks about the user dir on Windows, were it gets the PACKAGE name
which is
LyX1.6 and not LyX16, therefore my patch which doesn't touch Linux code.
// $HOME/.lyx on POSIX but on Win32 it will be something like
// "C:/Documents and Settings/USERNAME/Application Data/LyX"
FileName const get_default_user_support_dir(FileName const & home_dir)
{
#if defined (USE_WINDOWS_PACKAGING)
(void)home_dir; // Silence warning about unused variable.
os::GetFolderPath win32_folder_path;
return FileName(addPath(win32_folder_path(os::GetFolderPath::APPDATA),
PACKAGE));
#elif defined (USE_MACOSX_PACKAGING)
(void)home_dir; // Silence warning about unused variable.
FSRef fsref;
OSErr const error_code =
FSFindFolder(kUserDomain, kApplicationSupportFolderType,
kDontCreateFolder, &fsref);
if (error_code != 0)
return FileName();
// FSRefMakePath returns the result in utf8
char store[PATH_MAX + 1];
OSStatus const status_code =
FSRefMakePath(&fsref,
reinterpret_cast<UInt8*>(store), PATH_MAX);
if (status_code != 0)
return FileName();
return FileName(addPath(reinterpret_cast<char const *>(store),
PACKAGE));
#else // USE_POSIX_PACKAGING
return FileName(addPath(home_dir.absFileName(), string(".") + PACKAGE));
#endif
}