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
1 changed files with 12 additions and 18 deletions

View File

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