]> git.lyx.org Git - features.git/commitdiff
Avoid useless warning from Qt
authorEnrico Forestieri <forenr@lyx.org>
Sun, 8 Jan 2017 22:11:04 +0000 (23:11 +0100)
committerRichard Heck <rgheck@lyx.org>
Sun, 8 Jan 2017 23:48:55 +0000 (18:48 -0500)
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 25e6b5da39b2f9d5e1ce7c66baaf0ce968c8dc1a)

src/insets/InsetExternal.cpp
status.22x

index d524cfca993880030eac9233630a9a02fb9f173b..4122cfdb05160a1a37a7d1926eb158b86954e4e9 100644 (file)
@@ -98,7 +98,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(); 
index 261968292ea058e61d5a1c5122f1c5e10f7b66bc..ea3d644c7b8e656f8763be1ffa396874cc0b97d1 100644 (file)
@@ -176,6 +176,9 @@ What's new
 
 * INTERNALS
 
+- Squash annoying warning from Qt when attempting to delete a non-existent
+  file.
+
 
 * DOCUMENTATION AND LOCALIZATION