mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-26 14:15:32 +00:00
tentatively fix http://bugzilla.lyx.org/show_bug.cgi?id=4693
The problem stems I guess from the use of from_local8bit(). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25809 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
89e68f49f6
commit
734e22c4d3
@ -426,6 +426,12 @@ FileName FileName::getcwd()
|
||||
}
|
||||
|
||||
|
||||
FileName FileName::tempPath()
|
||||
{
|
||||
return FileName(fromqstr(QDir::tempPath()));
|
||||
}
|
||||
|
||||
|
||||
time_t FileName::lastModified() const
|
||||
{
|
||||
// QFileInfo caches information about the file. So, in case this file has
|
||||
|
@ -160,6 +160,8 @@ public:
|
||||
/// get the current working directory
|
||||
static FileName getcwd();
|
||||
|
||||
static FileName tempPath();
|
||||
|
||||
/// filename without path
|
||||
std::string onlyFileName() const;
|
||||
/// filename without path and without extension
|
||||
|
@ -95,8 +95,6 @@ FileName const get_locale_dir(FileName const & system_support_dir);
|
||||
FileName const get_system_support_dir(FileName const & abs_binary,
|
||||
string const & command_line_system_support_dir);
|
||||
|
||||
FileName const get_temp_dir();
|
||||
|
||||
FileName const get_default_user_support_dir(FileName const & home_dir);
|
||||
|
||||
bool userSupportDir(FileName const & default_user_support_dir,
|
||||
@ -115,7 +113,9 @@ Package::Package(string const & command_line_arg0,
|
||||
: explicit_user_support_dir_(false)
|
||||
{
|
||||
home_dir_ = get_home_dir();
|
||||
system_temp_dir_ = get_temp_dir();
|
||||
// Specification of temp_dir_ may be reset by LyXRC,
|
||||
// but the default is fixed for a given OS.
|
||||
system_temp_dir_ = FileName::tempPath();
|
||||
temp_dir_ = system_temp_dir_;
|
||||
document_dir_ = get_document_dir(home_dir_);
|
||||
|
||||
@ -367,22 +367,6 @@ FileName const get_locale_dir(FileName const & system_support_dir)
|
||||
}
|
||||
|
||||
|
||||
// Specification of temp_dir_ may be reset by LyXRC,
|
||||
// but the default is fixed for a given OS.
|
||||
FileName const get_temp_dir()
|
||||
{
|
||||
#if defined (USE_WINDOWS_PACKAGING)
|
||||
// Typical example: C:/TEMP/.
|
||||
char path[MAX_PATH];
|
||||
GetTempPath(MAX_PATH, path);
|
||||
// Remove trailing backslash if any.
|
||||
return FileName(rtrim(to_utf8(from_local8bit(path)), "\\"));
|
||||
#else // Posix-like.
|
||||
return FileName("/tmp");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
// Extracts the absolute path from the foo of "-sysdir foo" or "-userdir foo"
|
||||
FileName const abs_path_from_command_line(string const & command_line)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user