Avoid useless warning from Qt

When cloning InsetExternal, the tempname_ member of InsetExternalParams
has yet to be initialized. So, trying to remove it causes the warning
"QFile::remove: Empty or null file name".

(cherry picked from commit 25e6b5da39)
This commit is contained in:
Enrico Forestieri 2017-01-08 23:11:04 +01:00 committed by Richard Heck
parent 3a1eff90b9
commit a9dd6ea6bc
2 changed files with 5 additions and 1 deletions

View File

@ -98,7 +98,8 @@ TempName::~TempName()
TempName & TempName::operator=(TempName const & other) TempName & TempName::operator=(TempName const & other)
{ {
if (this != &other) { if (this != &other) {
tempname_.removeFile(); if (!tempname_.empty())
tempname_.removeFile();
support::TempFile f("lyxextXXXXXX.tmp"); support::TempFile f("lyxextXXXXXX.tmp");
f.setAutoRemove(false); f.setAutoRemove(false);
tempname_ = f.name(); tempname_ = f.name();

View File

@ -176,6 +176,9 @@ What's new
* INTERNALS * INTERNALS
- Squash annoying warning from Qt when attempting to delete a non-existent
file.
* DOCUMENTATION AND LOCALIZATION * DOCUMENTATION AND LOCALIZATION