Closed Bug 182642 Opened 22 years ago Closed 20 years ago

'available profiles' label can be 'deleted' by user

Categories

(SeaMonkey :: Startup & Profiles, defect)

x86
All
defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mc_legolas, Assigned: Stefan.Borggraefe)

References

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2b) Gecko/20021016
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2b) Gecko/20021016

On Mozilla 1.2 and 1.2b, if I delete all available profiles, then click the
delete button again, the 'available profiles' label above the list box disappears.

Reproducible: Always

Steps to Reproduce:
1.  start profile manager.
2.  delete all profiles (removing files for that profile or not)
3.  click the delete button again.

Actual Results:  
the 'available profiles' label disappears.

Expected Results:  
It shouldn't have removed a part of the interface, when clicking the delete button.
Severity: normal → minor
confirming with mozilla 1.2b and 1202 trunk build
Status: UNCONFIRMED → NEW
Ever confirmed: true
confirming with 1.3 release.
Well this is still present in 1.7b.
*** Bug 241711 has been marked as a duplicate of this bug. ***
Also happens on Linux with a 1.8a build from yesterday.

The following JavaScript exception is thrown when the Listbox header disappears: 

JavaScript error: , line 0: uncaught exception: [Exception... "Component
returned failure code: 0x80004005 (NS_ERROR_FAILURE)
[nsIListBoxObject.getIndexOfItem]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)" 
location: "JS frame :: chrome://global/content/bindings/listbox.xml ::
ensureElementIsVisible :: line 476"  data: no]
OS: Windows 2000 → All
Attached patch Fixes the bugSplinter Review
This happens because DeleteProfile uses
  selected.previousSibling;
instead of
  profileList.getPreviousItem(selected, 1);
to get the listitem to select after the profile deletion.

selected.previousSibling returns the listbox header when the last profile is
deleted, while getProviousItem() return null when there are no more listitems.

The patch also moves the selection of the previous listitem inside the
try-block so this only happens when the profile deletion was actually
successful.
Assignee: jag → Stefan.Borggraefe
Status: NEW → ASSIGNED
Attachment #147116 - Flags: review?(jag)
Comment on attachment 147116 [details] [diff] [review]
Fixes the bug

The fix itself looks good.

Someone might object to the change in white space style though. Seeing how this
file is a rather ugly mix of two styles, I'm more than happy to say yes to
these whitespace changes, though the majority style seems to be the one you're
actually moving away from. Hmmm... Who owns this stuff anyway? I'd say run it
by them, but you have my blessing. r=jag
Attachment #147116 - Flags: review?(jag) → review+
Conrad: Seems like you are the only Profile Manager peer currently available.
Are you ok with my whitespace changes or should I revert them? I could also fix
the whole file to use one style before checkin.
Comment on attachment 147116 [details] [diff] [review]
Fixes the bug

Lets ask a super-reviewer before I forget about this patch. ;-)

Alec: Are you ok with the whitespace usage in my patch? Should I perhaps change
the whitespace usage in the whole file to be consistent before checkin?
Attachment #147116 - Flags: superreview?(alecf)
Comment on attachment 147116 [details] [diff] [review]
Fixes the bug

sr=alecf
Attachment #147116 - Flags: superreview?(alecf) → superreview+
fixed
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: