From: Guillaume MM Date: Sun, 30 Apr 2017 22:02:10 +0000 (+0200) Subject: Remove spurious error "QFileSystemWatcher::removePath: path is empty" X-Git-Tag: 2.3.0beta1~496 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=974d33ad01098fbb68e4391264b0456769a96b6a;p=features.git Remove spurious error "QFileSystemWatcher::removePath: path is empty" --- diff --git a/src/support/FileMonitor.cpp b/src/support/FileMonitor.cpp index f1446a3aba..30a4170ed5 100644 --- a/src/support/FileMonitor.cpp +++ b/src/support/FileMonitor.cpp @@ -100,6 +100,8 @@ FileMonitorGuard::FileMonitorGuard(string const & filename, QFileSystemWatcher * qwatcher) : filename_(filename), qwatcher_(qwatcher), exists_(true) { + if (filename.empty()) + return; QObject::connect(qwatcher, SIGNAL(fileChanged(QString const &)), this, SLOT(notifyChange(QString const &))); if (qwatcher_->files().contains(toqstr(filename))) @@ -111,12 +113,15 @@ FileMonitorGuard::FileMonitorGuard(string const & filename, FileMonitorGuard::~FileMonitorGuard() { - qwatcher_->removePath(toqstr(filename_)); + if (!filename_.empty()) + qwatcher_->removePath(toqstr(filename_)); } void FileMonitorGuard::refresh() { + if (filename_.empty()) + return; QString const qfilename = toqstr(filename_); if(!qwatcher_->files().contains(qfilename)) { bool exists = QFile(qfilename).exists();