Bug 250166 - [Scanner Discovery] SD Options: changes from "Restore Defaults" in configuration-wide scope isn't saved
Summary: [Scanner Discovery] SD Options: changes from "Restore Defaults" in configurat...
Status: ASSIGNED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build (show other bugs)
Version: 5.0   Edit
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: cdt-build-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-08 15:55 EDT by Miwako Tokugawa CLA
Modified: 2020-09-04 15:17 EDT (History)
5 users (show)

See Also:


Attachments
patch (1.15 KB, patch)
2009-03-18 03:55 EDT, ZhangYi CLA
no flags Details | Diff
new patch (870 bytes, patch)
2009-03-31 03:13 EDT, ZhangYi CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Miwako Tokugawa CLA 2008-10-08 15:55:12 EDT
Build ID: I20080609-1311

Steps To Reproduce:
1. Create a Hello World ANSI C Project with Linux GCC Toolchain.
2. In Property Pages->Discovery Options, (in Debug configuration)
	unselect "Automate discovery of paths and symbols" in both Configuration-wide and Per Language scopes and get out with ok.
3. Close and reopen the project. -> "Automate discovery of paths and symbols"  are off in both scopes correctly.
4. Under "Per Language" scope, select "Restore Defaults", "Configuration-wide" scope, select "Restore Defaults" and get out with OK.
5. Close and reopen the project. 
	You see that under Configuration-wide scope, the change was not saved  and "Automate discovery.." is still off.

Alternatively, select "Restore Defaults" and then "Apply" under both scope in 4. You can still see the same error.


More information:
Comment 1 ZhangYi CLA 2009-01-05 03:29:43 EST
Hi,

  In your step4, under "Per Language", I clicked "Restore Defaults", the "Automate .." is selected. Then I went to the "Configuration-wide" and clicked "Restore Defaults", the "Automate .." is selected as well. But as I turned back to "Per Language" scope again,  the "Automate .." is unselected now.

Yi
Comment 2 ZhangYi CLA 2009-03-18 03:55:32 EDT
Created attachment 129182 [details]
patch

I have made a patch to fix the issue. Please help to review.

My approach is to restore the default setting for "configuration-wide" before restoring and turning to "per-language".

Thanks,
Yi
Comment 3 Elena Laskavaia CLA 2009-03-18 09:48:55 EDT
1) I don't understand how it would help
2) This is wrong behavior (in the patch). If user pick to restore one of them it does not
mean he wants to restore another (unless I am missing something)
Comment 4 ZhangYi CLA 2009-03-18 21:00:11 EDT
(In reply to comment #3)
> 1) I don't understand how it would help
> 2) This is wrong behavior (in the patch). If user pick to restore one of them
> it does not
> mean he wants to restore another (unless I am missing something)


I am not sure if the users want to restore all the settings or only restore the current one. That's due to the user's requirements. My opioin is if the "Restore Default" is clicked, all the settings on this tab should be restored to default settings.

However, no matter to restore all the settings or only to restore the current one, the current behavior has some problem. If you want to restore the default settings for  "Configuration-wide" (the "Automate..." has been already checked off), go to "Configuration-wide" and click "Restore...". The tab will jump to "per-language" and the settings of "per-language" will be restored to default. But when you turn back to "configuration-wide", you will find the settings of "configuration-wide" are not restored at all.
Comment 5 ZhangYi CLA 2009-03-18 21:50:43 EDT
If we only want to restore for the current selected scope, I think we could remove the line below in DiscoveryTab.performDefaults().

cbi.setPerRcTypeDiscovery(true);

This line of code made the scope changed to "per-language" and resored default settings for it, no matter the current scope is "per-language" or "configuration-wide". 
Comment 6 ZhangYi CLA 2009-03-31 03:13:16 EDT
Created attachment 130352 [details]
new patch

The approach of this new patch is to restore the default setting for the current scope (not all the scope).