From 85f6ce34ad54ada305cc8e83c88f3ccfa23a3b6d Mon Sep 17 00:00:00 2001 From: "rods%netscape.com" Date: Tue, 6 Apr 1999 23:03:30 +0000 Subject: [PATCH] Chnaged over to new way of getting file urls git-svn-id: svn://10.0.0.236/trunk@26585 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpfe/AppCores/src/nsBrowserAppCore.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/mozilla/xpfe/AppCores/src/nsBrowserAppCore.cpp b/mozilla/xpfe/AppCores/src/nsBrowserAppCore.cpp index 0e0591bb2c3..7d551ede7ae 100644 --- a/mozilla/xpfe/AppCores/src/nsBrowserAppCore.cpp +++ b/mozilla/xpfe/AppCores/src/nsBrowserAppCore.cpp @@ -861,20 +861,29 @@ nsBrowserAppCore::OpenWindow() fileWidget->SetFilterList(5, titles, filters); fileWidget->Create(nsnull, title, eMode_load, nsnull, nsnull); - PRBool result = fileWidget->Show(); +#if 0 // Old way + nsAutoString fileURL; + PRBool result = fileWidget->Show(); if (result) { nsString fileName; nsString dirName; fileWidget->GetFile(fileName); - nsAutoString fileURL; BuildFileURL(nsAutoCString(fileName), fileURL); - printf("If I could open a new window with [%s] I would.\n", (const char *)nsAutoCString(fileURL)); } + printf("If I could open a new window with [%s] I would.\n", (const char *)nsAutoCString(fileURL)); +#else // New Way + nsFileSpec fileSpec; + fileWidget->GetFile(fileSpec); + + nsFileURL fileURL(fileSpec); + printf("If I could open a new window with [%s] I would.\n", (const char *)nsAutoCString(fileURL.GetAsString())); +#endif NS_RELEASE(fileWidget); return NS_OK; + return NS_OK; } //----------------------------------------