From 1826d5c8b27b175aca34be90bdfe0e32bc11cd2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 2 May 2006 00:14:54 +0000 Subject: [PATCH] * Node monitoring didn't work correctly, as the directories were not remembered accidently. * Additionally, B_ENTRY_MOVED worked not correctly, as the entry_ref for the new entry was built upon the wrong node_ref. * The default translator now also makes sure that the default system paths exist. This helps node monitoring as well. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17291 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/translation/TranslatorRoster.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/kits/translation/TranslatorRoster.cpp b/src/kits/translation/TranslatorRoster.cpp index 2ceab5cb59..6f43046831 100644 --- a/src/kits/translation/TranslatorRoster.cpp +++ b/src/kits/translation/TranslatorRoster.cpp @@ -221,7 +221,7 @@ BTranslatorRoster::Private::MessageReceived(BMessage* message) if (item == NULL) { // it's a new one! if (_IsKnownDirectory(toNodeRef)) - _EntryAdded(nodeRef, name); + _EntryAdded(toNodeRef, name); break; } @@ -283,8 +283,11 @@ BTranslatorRoster::Private::AddDefaultPaths() for (uint32 i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) { BPath path; status_t status = find_directory(paths[i], &path, true); - if (status == B_OK && path.Append("Translators") == B_OK) + if (status == B_OK && path.Append("Translators") == B_OK) { + mkdir(path.Path(), 0755); + // make sure the directory exists before we add it AddPath(path.Path()); + } } } @@ -361,6 +364,7 @@ BTranslatorRoster::Private::AddPath(const char* path, int32* _added) if (Looper() != NULL) { // watch that directory watch_node(&nodeRef, B_WATCH_DIRECTORY, this); + fDirectories.push_back(nodeRef); } int32 count = 0;