# include "support/qstring_helpers.h"
# include <QDir>
# include <QDesktopServices>
+# include <QStandardPaths>
#endif
using namespace std;
Package package_;
bool initialised_ = false;
-} // namespace anon
+} // namespace
void init_package(string const & command_line_arg0,
string const fix_dir_name(string const & name);
-} // namespace anon
+} // namespace
Package::Package(string const & command_line_arg0,
FileName Package::messages_file(string const & c) const
{
if (in_build_dir_) {
- FileName res = FileName(lyx_dir().absFileName() + "/../po/" + c + ".gmo");
+ FileName res = FileName(lyx_dir().absFileName() + "/po/" + c + ".gmo");
+ if (!res.isReadableFile())
+ res = FileName(lyx_dir().absFileName() + "../po/" + c + ".gmo");
if (!res.isReadableFile())
res = FileName(top_srcdir().absFileName() + "/po/" + c + ".gmo");
return res;
return program_suffix.empty() ? program_suffix : with_version_suffix;
}
-} // namespace anon
+} // namespace
FileName const & Package::top_srcdir()
return true;
}
// cmake file, no Makefile in lib
- FileName build_boost_dir = FileName(addPath(search_dir + "/3rdparty", "boost"));
- if (!fileSearch(build_boost_dir.absFileName(), "cmake_install.cmake").empty()) {
+ FileName build_src_dir = FileName(addPath(search_dir, "src"));
+ if (!fileSearch(build_src_dir.absFileName(), "cmake_install.cmake").empty()) {
return true;
}
// Note that the name of the lyx binary may be a symbolic link.
// If that is the case, then we follow the links too.
- FileName binary = abs_binary;
+ FileName binary = abs_binary;
while (true) {
// Try and find "lyxrc.defaults".
- if( isBuildDir(binary, "../", build_support_dir) ||
- isBuildDir(binary, "../../", build_support_dir))
- {
+ if ( isBuildDir(binary, "../", build_support_dir)
+ || isBuildDir(binary, "../../", build_support_dir))
+ {
// Try and find "chkconfig.ltx".
system_support_dir =
FileName(addPath(Package::top_srcdir().absFileName(), "lib"));
system_support_dir = FileName();
build_support_dir = FileName();
- return false;
+ return false;
}
bool doesFileExist(FileName & result, string const & search_dir, string const & name)
{
result = fileSearch(search_dir, name);
- if (!result.empty()) {
- return true;
- }
- return false;
+ return !result.empty();
}
} else if (doesFileExist(lyx_binary, search_dir, "lyx" + string(PROGRAM_SUFFIX) + ext)) {
} else if (doesFileExist(lyx_binary, search_dir, "LyX" + string(PROGRAM_SUFFIX) + ext)){
}
- return !lyx_binary.empty() ? true : false;
+ return !lyx_binary.empty();
}
// This will do nothing if *it is already absolute.
string const exe_dir = makeAbsPath(*it).absFileName();
- FileName const exe_path(addName(exe_dir, exe_name));
- if (exe_path.exists())
- return exe_path;
+ FileName const exe_path2(addName(exe_dir, exe_name));
+ if (exe_path2.exists())
+ return exe_path2;
}
// Didn't find anything.
return result;
}
-} // namespace anon
+} // namespace
} // namespace support
} // namespace lyx