mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 10:52:49 +00:00
kdecore: check if path is not dir in KDirWatch::addFile()
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
0e0a254223
commit
ea969551e1
1 changed files with 3 additions and 2 deletions
|
@ -96,11 +96,12 @@ void KDirWatch::addDir(const QString& path, WatchModes watchModes)
|
|||
|
||||
void KDirWatch::addFile(const QString& path)
|
||||
{
|
||||
if (path.isEmpty() || path.startsWith(QLatin1String("/dev")))
|
||||
if (path.isEmpty() || path.startsWith(QLatin1String("/dev"))) {
|
||||
return; // Don't even go there.
|
||||
}
|
||||
|
||||
QFileInfo info(path);
|
||||
if (!info.exists()) {
|
||||
if (!info.exists() && !info.isDir()) {
|
||||
// try to watch the parent directory
|
||||
d->watcher->addPath(info.path());
|
||||
return;
|
||||
|
|
Loading…
Add table
Reference in a new issue