Review Request 117407: Add a project name validation in the project creation dialog

Sven Brauch svenbrauch at googlemail.com
Sun May 11 15:51:42 UTC 2014



> On May 11, 2014, 3:34 p.m., Sven Brauch wrote:
> > Looks good; what changes will be required to KAppTemplate? And I guess some of the templates need to be updated as well?
> > Thanks!
> 
> Simon Wächter wrote:
>     At the moment the KAppTemplate application uses the regex '[a-zA-Z0-9_]*' for the validation of a project name. If wished (and needed) I can adapt the changes from this patch to the KAppTemplate application and update all KAppTemplate templates as well. But the question is: Does a template need to support more characters than the default regex ?
>     
>

Yes, that is the question. And I think the answer is no, which is why I was happy with the first proposal as well ;)
Maybe KAppTemplate shouldn't allow empty project names?


- Sven


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/117407/#review57723
-----------------------------------------------------------


On May 11, 2014, 2:35 p.m., Simon Wächter wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/117407/
> -----------------------------------------------------------
> 
> (Updated May 11, 2014, 2:35 p.m.)
> 
> 
> Review request for KDevelop, Aleix Pol Gonzalez and Sven Brauch.
> 
> 
> Repository: kdevplatform
> 
> 
> Description
> -------
> 
> This patch adds a regex validation for the project name in the project creation dialog. The user can break KDevelop with an abnormal project name. The first attempt was to add a general regex, but this would be to static. So the idea and the following implementation is:
> 
> - If the project template file, for example 'cmake_plaincpp.kdevtemplate', provides a 'ValidProjectName' value, this value will be used. This value is a normal regex. For example 'ValidProjectName=^[a-zA-Z][a-zA-Z]+$' is a valid configuration
> - If there is no 'ValidProjectName' value, kdevplatform will use a normal regex, in this case '^[a-zA-Z][a-zA-Z0-9_]+$'. With this fallback mode we can guarantee, that templates without a 'ValidProjectName' also have a validation.
> 
> If this patch gets accepted I will add this configuration to the templates provided by KDevelop. I will also write a (bigger) patch to add these feature in KAppTemplate - if wished.
> 
> 
> Diffs
> -----
> 
>   plugins/appwizard/appwizarddialog.cpp f33b52c 
>   plugins/appwizard/projectselectionpage.h 7aeef58 
>   plugins/appwizard/projectselectionpage.cpp 6270869 
> 
> Diff: https://git.reviewboard.kde.org/r/117407/diff/
> 
> 
> Testing
> -------
> 
> Testing was done under a Debian Testing and a Kubuntu 14.04 x64. The value check and fallback mode are working. More testing from other users is welcomed
> 
> 
> Thanks,
> 
> Simon Wächter
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20140511/fe4b597a/attachment-0001.html>


More information about the KDevelop-devel mailing list