QFileSystemWatcher: print out path in case of error.

Before:
QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: No such file or directory

After:
QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch("/home/dfaure/.local/share/user-places.xbel") failed: No such file or directory
(assuming "%{function}:" in $QT_MESSAGE_PATTERN)

Change-Id: I6cc68529516b33683bd69fbb61e04df8a8aa880d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
David Faure 2015-08-02 19:24:33 +02:00 committed by Andreas Hartmetz
parent 746f54c6df
commit 4992ba2a52

View File

@ -37,6 +37,7 @@
#ifndef QT_NO_FILESYSTEMWATCHER
#include "private/qcore_unix_p.h"
#include "private/qsystemerror_p.h"
#include <qdebug.h>
#include <qfile.h>
@ -287,7 +288,7 @@ QStringList QInotifyFileSystemWatcherEngine::addPaths(const QStringList &paths,
| IN_DELETE_SELF
)));
if (wd < 0) {
perror("QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed");
qWarning().nospace() << "inotify_add_watch(" << path << ") failed: " << QSystemError(errno, QSystemError::NativeError).toString();
continue;
}