#include "support/Package.h"
#include "support/PathChanger.h"
#include "support/Systemcall.h"
+#include "support/TempFile.h"
#ifdef Q_WS_MACX
#include "support/AppleScript.h"
validateCurrentView();
// FIXME: create a new method shared with LFUN_HELP_OPEN.
string const fname = to_utf8(cmd.argument());
- if (!fname.empty() && !FileName::isAbsolute(fname)) {
- dr.setError(true);
- dr.setMessage(_("Absolute filename expected."));
- break;
- }
- bool const is_open = FileName::isAbsolute(fname)
+ bool const is_open = FileName::isAbsolute(fname)
&& theBufferList().getBuffer(FileName(fname));
if (d->views_.empty()
|| (!lyxrc.open_buffers_in_tabs
if (retval == FormatMismatch) {
LYXERR(Debug::FILES, "Converting ui file to format " << LFUN_FORMAT);
- FileName const tempfile = FileName::tempName("convert_ui");
+ TempFile tmp("convertXXXXXX.ui");
+ FileName const tempfile = tmp.name();
bool const success = prefs2prefs(ui_path, tempfile, true);
if (!success) {
LYXERR0("Unable to convert " << ui_path.absFileName() <<
" to format " << LFUN_FORMAT << ".");
} else {
retval = readUIFile(tempfile);
- tempfile.removeFile();
}
}