Bug 248341 - Empty line appears in configuration list after removing of configuration in project properties
Summary: Empty line appears in configuration list after removing of configuration in p...
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 5.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 6.0   Edit
Assignee: Markus Schorn CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks: 293029
  Show dependency tree
 
Reported: 2008-09-23 16:38 EDT by Andrew Gvozdev CLA
Modified: 2009-10-22 08:42 EDT (History)
2 users (show)

See Also:


Attachments
the illustration (1.06 MB, application/octet-stream)
2008-09-23 16:41 EDT, Andrew Gvozdev CLA
no flags Details
suggested patch (8.65 KB, patch)
2008-10-01 09:55 EDT, Andrew Gvozdev CLA
mschorn.eclipse: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Gvozdev CLA 2008-09-23 16:38:20 EDT
See attachment for illustration. How to get there:

1. Create Makefile/No-Toolchain project. You get "Default" configuration by default.
2. Create configuration "Andrew". Go to Project Properties C/C++ Build. Enter Manage Configurations and add configuration "Andrew". Use my name, not yours - it is important that it would appear *before* the "Default" one in the list. Press OK to create configuration and OK to save and quit properties.
3. Reenter properties. You should see "Default" as settings configuration.
  3a. Keep it that way and enter straight to Manage Configurations again. The cursor is on "Andrew".
  3b. Delete it pressing Delete button.  Confirm "Yes".
  3c. Press OK. Configuration disappears.

This is not a big deal at the moment but this bug bites with IllegalStateException when I try to get rid of bug 242955.
Comment 1 Andrew Gvozdev CLA 2008-09-23 16:41:34 EDT
Created attachment 113300 [details]
the illustration
Comment 2 Andrew Gvozdev CLA 2008-10-01 09:55:21 EDT
Created attachment 113991 [details]
suggested patch

Markus, you were involved to changes in AbstractPage and it even provides your name in the header. May I ask you to take a look at this insignificant but relatively simple patch?

It seems that AbstractPage relies much on the index of previously selected line - cfgIndex. When configurations are removed (or rearranged) this index gets out of sync which causes a few things. Actually, you can get the IllegalStateException in the example above pressing Apply as a step 4. The suggested patch replaces cfgIndex with lastSelectedCfg and tries to keep an internal state of associated variables consistent. As a bonus, the active configuration is being marked as [Active] in the drop-down list.
Comment 3 Markus Schorn CLA 2008-10-01 11:16:57 EDT
(In reply to comment #2)
> Markus, you were involved to changes in AbstractPage and it even provides your
> name in the header. May I ask you to take a look at this insignificant but
> relatively simple patch?
I should not have put my name in there :-). In general I am not taking care of the project/build stuff, needed to fix a bug related to the scroll bars.

Anyways, the patch looks good to me, I'll apply it.
Comment 4 Markus Schorn CLA 2008-10-01 11:23:56 EDT
Thanks Andrew, fixed in 5.1 > 20081001.
Comment 5 Andrew Gvozdev CLA 2008-10-01 14:24:03 EDT
Thanks for giving me a favor, I'll remember that.