From 49c8b74e7f35179075279dd08570ae37aed9e7b6 Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Wed, 15 Oct 2014 15:25:35 +0200 Subject: [PATCH] Remove path from vector on directory watcher item removed event --- src/MediaServer/DirectoryWatcher.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/MediaServer/DirectoryWatcher.h b/src/MediaServer/DirectoryWatcher.h index cb0250a..121ea5c 100644 --- a/src/MediaServer/DirectoryWatcher.h +++ b/src/MediaServer/DirectoryWatcher.h @@ -59,7 +59,14 @@ class DirectoryWatcher { const ofx::IO::DirectoryWatcherManager::DirectoryEvent& evt) { string path = evt.item.path(); - // TODO Remove items from Vector + // Remove path from vector + int i; + for (i = 0; i < filePaths.size(); i++) { + if (path == filePaths[i]) { + filePaths.erase(filePaths.begin() + i); + break; + } + } ofNotifyEvent(onItemRemoved, path, this); }