From dad84e8a46d3bfef42637cab2f18c7fcc14f595a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Tue, 21 Nov 2017 21:42:44 +0100 Subject: [PATCH] Adjust DirectoryWatcher implementation for changed FileChange definition in eventcore. --- source/vibe/core/file.d | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/vibe/core/file.d b/source/vibe/core/file.d index efb74e8..7c641c5 100644 --- a/source/vibe/core/file.d +++ b/source/vibe/core/file.d @@ -587,7 +587,13 @@ struct DirectoryWatcher { // TODO: avoid all those heap allocations! case FileChangeKind.removed: ct = DirectoryChangeType.removed; break; case FileChangeKind.modified: ct = DirectoryChangeType.modified; break; } - this.changes ~= DirectoryChange(ct, NativePath.fromTrustedString(change.directory) ~ NativePath.fromTrustedString(change.name.idup)); + + static if (is(typeof(change.baseDirectory))) { + // eventcore 0.8.23 and up + this.changes ~= DirectoryChange(ct, NativePath.fromTrustedString(change.baseDirectory) ~ NativePath.fromTrustedString(change.directory) ~ NativePath.fromTrustedString(change.name.idup)); + } else { + this.changes ~= DirectoryChange(ct, NativePath.fromTrustedString(change.directory) ~ NativePath.fromTrustedString(change.name.idup)); + } this.changeEvent.emit(); } }