* 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
This commit is contained in:
Axel Dörfler 2006-05-02 00:14:54 +00:00
parent 927a84f8f6
commit 1826d5c8b2

View File

@ -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;