Just follow a moved download file, as Axel suggested.

git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@345 94f232f2-1747-11df-bad5-a5bfde151594
This commit is contained in:
stippi 2010-03-23 14:48:58 +00:00 committed by Alexandre Deckner
parent 61c96f4e5e
commit b65e0ec04e

View File

@ -363,29 +363,23 @@ public:
break;
case B_ENTRY_MOVED:
{
int64 fromDirectory;
int64 toDirectory;
if (message->FindInt64("from directory",
&fromDirectory) != B_OK
// Follow the entry to the new location
dev_t device;
ino_t directory;
const char* name;
if (message->FindInt32("device",
reinterpret_cast<int32*>(&device)) != B_OK
|| message->FindInt64("to directory",
&toDirectory) != B_OK) {
reinterpret_cast<int64*>(&directory)) != B_OK
|| message->FindString("name", &name) != B_OK
|| strlen(name) == 0) {
break;
}
if (fromDirectory == toDirectory) {
// Entry was renamed
const char* name;
if (message->FindString("name", &name) != B_OK
|| strlen(name) == 0) {
break;
}
fPath.GetParent(&fPath);
fPath.Append(name);
entry_ref ref(device, directory, name);
BEntry entry(&ref);
if (entry.GetPath(&fPath) == B_OK) {
fStatusBar->SetText(name);
Window()->PostMessage(SAVE_SETTINGS);
} else {
// Entry was moved elsewhere
fIconView->SetIconDimmed(true);
DownloadCanceled();
}
break;
}