Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 317916

Summary: "Name" field in "Hello World ANSI C Project" default comment does not contain characters past the first space.
Product: [Tools] CDT Reporter: Jared Mathis <dshinka>
Component: cdt-buildAssignee: cdt-build-inbox <cdt-build-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: trivial    
Priority: P3 CC: malaperle, stg.open
Version: 7.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
fix none

Description Jared Mathis CLA 2010-06-25 02:14:24 EDT
Build Identifier: 20100617-1415

After making a "Hello World ANSI C Project" the  Inside the file Test Project > src > Test Project.c, the comment will say "File: Test.c" instead of "File: Test Project.c"

Reproducible: Always

Steps to Reproduce:
1. File > New > C Project.
2. Enter a project name with spaces (i.e. "Test Project").
3. Select "Hello World ANSI C Project."
4. Click Finish.
Comment 1 Stefan Gh CLA 2011-01-29 11:46:17 EST
Created attachment 187908 [details]
fix

The file name is set by ${projectName}, while the default comment's file name value is set by ${baseName}. The comment should use the same parameter as the actual file.

The patch applies this change to the other HelloWorld projects, in addition to the one pointed by the bug.
Comment 2 Andrew Gvozdev CLA 2011-01-29 11:52:09 EST
I don't think we should replace ${baseName} with ${projectName} in this case. Rather, handling of ${baseName} should be fixed to return proper base name of file with spaces.
Comment 3 Stefan Gh CLA 2011-01-29 12:15:42 EST
${baseName} is set from MBSWizardHandler.getBaseName(). It takes the project name and ignores everything after the last "." until the following " ".
so projectName = "test.content" becomes baseName = "content"
and projectName = "test content" becomes baseName = "test".

If we change baseName to return the exact project name, then why not use projectName directly?