]> git.lyx.org Git - lyx.git/commitdiff
Avoid useless warning from Qt
authorEnrico Forestieri <forenr@lyx.org>
Sun, 8 Jan 2017 22:11:04 +0000 (23:11 +0100)
committerEnrico Forestieri <forenr@lyx.org>
Sun, 8 Jan 2017 22:11:04 +0000 (23:11 +0100)
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".

src/insets/InsetExternal.cpp

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