using namespace std;
using namespace lyx::support;
-// OK, this is ugly, but it is the only workaround I found to compile
-// with gcc (any version) on a system which uses a non-GNU toolchain.
-// The problem is that gcc uses a weak symbol for a particular
-// instantiation and that the system linker usually does not
-// understand those weak symbols (seen on HP-UX, tru64, AIX and
-// others). Thus we force an explicit instanciation of this particular
-// template (JMarc)
-template struct boost::detail::crc_table_t<32, 0x04C11DB7, true>;
-
namespace lyx {
namespace support {
static
string const handleTildeName(string const & name)
{
- return name == "~" ? Package::get_home_dir().absFileName() :
- prefixIs(name, "~/") ? Package::get_home_dir().absFileName() + name.substr(1) :
- name;
+ string resname;
+ if ( name == "~" )
+ resname = Package::get_home_dir().absFileName();
+ else if ( prefixIs(name, "~/"))
+ resname = Package::get_home_dir().absFileName() + name.substr(1);
+ else if ( prefixIs(name, "~:s/"))
+ resname = package().system_support().absFileName() + name.substr(3);
+ else
+ resname = name;
+ return resname;
}
/// The absolute file name in UTF-8 encoding.
return true;
}
+bool FileName::clonePermissions(FileName const & source)
+{
+ QFile fin(toqstr(source.absFileName()));
+ QFile f(toqstr(absFileName()));
+
+ return f.setPermissions(fin.permissions());
+}
string FileName::toFilesystemEncoding() const
{