From b65e0ec04eda1f31059cdac01cf99c9d447bb217 Mon Sep 17 00:00:00 2001 From: stippi Date: Tue, 23 Mar 2010 14:48:58 +0000 Subject: [PATCH] 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 --- src/apps/webpositive/DownloadWindow.cpp | 30 ++++++++++--------------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/src/apps/webpositive/DownloadWindow.cpp b/src/apps/webpositive/DownloadWindow.cpp index 0a4fa8fd58..b9039636cc 100644 --- a/src/apps/webpositive/DownloadWindow.cpp +++ b/src/apps/webpositive/DownloadWindow.cpp @@ -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(&device)) != B_OK || message->FindInt64("to directory", - &toDirectory) != B_OK) { + reinterpret_cast(&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; }