From 586bb61136121aa4226e1032fbbf499c3addc95e Mon Sep 17 00:00:00 2001 From: "ccarlen%netscape.com" Date: Thu, 29 Nov 2001 15:48:58 +0000 Subject: [PATCH] Bug 97239 - On Mac, can't delete profile whose files on disk have been removed. r=brade/sr=sfraser --- profile/resources/content/profileManager.js | 36 +++++++++++++-------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/profile/resources/content/profileManager.js b/profile/resources/content/profileManager.js index c1990255160..76c384146dd 100644 --- a/profile/resources/content/profileManager.js +++ b/profile/resources/content/profileManager.js @@ -153,19 +153,29 @@ function ConfirmDelete() return; } else { - var path = profile.getProfilePath(name); - dialogText = gProfileManagerBundle.getFormattedString("deleteprofile", [path]); - dialogText = dialogText.replace(/\s*/g,"\n"); - var buttonPressed = {value:0} - promptService.confirmEx(window, dialogTitle, dialogText, - (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0) + - (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_1) + - (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_2), - gProfileManagerBundle.getString("dontDeleteFiles"), - gProfileManagerBundle.getString("deleteFiles"), - null, null, {value:0}, buttonPressed); - if (buttonPressed.value != 2) - DeleteProfile(buttonPressed.value == 1); + var pathExists = true; + try { + var path = profile.getProfilePath(name); + } + catch (ex) { + pathExists = false; + } + if (pathExists) { + dialogText = gProfileManagerBundle.getFormattedString("deleteprofile", [path]); + dialogText = dialogText.replace(/\s*/g,"\n"); + var buttonPressed = {value:0} + promptService.confirmEx(window, dialogTitle, dialogText, + (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0) + + (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_1) + + (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_2), + gProfileManagerBundle.getString("dontDeleteFiles"), + gProfileManagerBundle.getString("deleteFiles"), + null, null, {value:0}, buttonPressed); + if (buttonPressed.value != 2) + DeleteProfile(buttonPressed.value == 1); + } + else + DeleteProfile(false); } }