Update bookmark bar item BMessage on file rename.

The ref stored in the message must be replaced to point to the new file
name. Fixes #10962.
This commit is contained in:
Adrien Destugues 2014-06-25 11:13:02 +02:00
parent 158ae74373
commit 621c9d1243
2 changed files with 14 additions and 9 deletions

View File

@ -79,15 +79,15 @@ BookmarkBar::MessageReceived(BMessage* message)
}
case B_ENTRY_MOVED:
{
entry_ref ref;
const char *name;
message->FindInt32("device", &ref.device);
message->FindInt64("to directory", &ref.directory);
message->FindString("name", &name);
ref.set_name(name);
if (fItemsMap[inode] == NULL) {
entry_ref ref;
const char *name;
message->FindInt32("device", &ref.device);
message->FindInt64("to directory", &ref.directory);
message->FindString("name", &name);
ref.set_name(name);
BEntry entry(&ref);
_AddItem(inode, &entry);
break;
@ -101,6 +101,12 @@ BookmarkBar::MessageReceived(BMessage* message)
const char *name;
if (message->FindString("name", &name) == B_OK)
fItemsMap[inode]->SetLabel(name);
BMessage* itemMessage = new BMessage(
B_REFS_RECEIVED);
itemMessage->AddRef("refs", &ref);
fItemsMap[inode]->SetMessage(itemMessage);
break;
}
}

View File

@ -372,7 +372,6 @@ void
BrowserApp::_RefsReceived(BMessage* message, int32* _pagesCreated,
bool* _fullscreen)
{
puts("refs!");
int32 pagesCreated = 0;
BrowserWindow* window = NULL;