// Let the frontend parse and remove all arguments that it knows
pimpl_->application_.reset(createApplication(argc, argv));
+ // Reestablish our defaults, as Qt overwrites them
+ // after createApplication()
+ locale_init();
+
// Parse and remove all known arguments in the LyX singleton
// Give an error for all remaining ones.
int exit_status = init(argc, argv);
// do any other cleanup procedures now
if (package().temp_dir() != package().system_temp_dir()) {
- LYXERR(Debug::INFO, "Deleting tmp dir "
- << package().temp_dir().absFilename());
-
- if (!package().temp_dir().destroyDirectory()) {
+ string const abs_tmpdir = package().temp_dir().absFilename();
+ if (!contains(package().temp_dir().absFilename(), "lyx_tmpdir")) {
docstring const msg =
- bformat(_("Unable to remove the temporary directory %1$s"),
- from_utf8(package().temp_dir().absFilename()));
- Alert::warning(_("Unable to remove temporary directory"), msg);
+ bformat(_("%1$s does not appear like a LyX created temporary directory."),
+ from_utf8(abs_tmpdir));
+ Alert::warning(_("Cannot remove temporary directory"), msg);
+ } else {
+ LYXERR(Debug::INFO, "Deleting tmp dir "
+ << package().temp_dir().absFilename());
+ if (!package().temp_dir().destroyDirectory()) {
+ docstring const msg =
+ bformat(_("Unable to remove the temporary directory %1$s"),
+ from_utf8(package().temp_dir().absFilename()));
+ Alert::warning(_("Unable to remove temporary directory"), msg);
+ }
}
}
}
-void LyX::addFileToLoad(string const & fname)
-{
- vector<string>::const_iterator cit = find(
- pimpl_->files_to_load_.begin(), pimpl_->files_to_load_.end(),
- fname);
-
- if (cit == pimpl_->files_to_load_.end())
- pimpl_->files_to_load_.push_back(fname);
-}
-
-
bool LyX::loadFiles()
{
LASSERT(!use_gui, /**/);
if (document_path.exists() && document_path.isDirectory())
package().document_dir() = document_path;
- package().temp_dir() = createLyXTmpDir(FileName(lyxrc.tempdir_path));
+ package().set_temp_dir(createLyXTmpDir(FileName(lyxrc.tempdir_path)));
if (package().temp_dir().empty()) {
Alert::error(_("Could not create temporary directory"),
bformat(_("Could not create a temporary directory in\n"
- "%1$s. Make sure that this\n"
- "path exists and is writable and try again."),
+ "\"%1$s\"\n"
+ "Make sure that this path exists and is writable and try again."),
from_utf8(lyxrc.tempdir_path)));
// createLyXTmpDir() tries sufficiently hard to create a
// usable temp dir, so the probability to come here is