I've been getting the following message on recent master:

  QFileSystemWatcher::removePath: path is empty

One way to trigger it is to have two different LyX instances open, write
"hello" in one of them and select it and copy it and paste it in the
other instance.

The attached patch fixes it for me, but it's probably wrong. I can
investigate into why I get an empty path at this point in the code, if
someone thinks it is worth the time.

Scott
From f8fb083a9220e198ebc4fd936de1bb2be0437eac Mon Sep 17 00:00:00 2001
From: Scott Kostyshak <skost...@lyx.org>
Date: Tue, 18 Apr 2017 02:01:10 -0400
Subject: [PATCH] Get rid of a Qt warning in the terminal

Do not try to remove a file with empty path. This gets rid of the
following terminal message:

    QFileSystemWatcher::removePath: path is empty
---
 src/support/FileMonitor.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/support/FileMonitor.cpp b/src/support/FileMonitor.cpp
index f1446a3..7f3813d 100644
--- a/src/support/FileMonitor.cpp
+++ b/src/support/FileMonitor.cpp
@@ -111,7 +111,8 @@ FileMonitorGuard::FileMonitorGuard(string const & filename,
 
 FileMonitorGuard::~FileMonitorGuard()
 {
-       qwatcher_->removePath(toqstr(filename_));
+       if (!filename_.empty())
+               qwatcher_->removePath(toqstr(filename_));
 }
 
 
-- 
2.7.4

Attachment: signature.asc
Description: PGP signature

Reply via email to