Revision 732794b...

Go back to digest for 18th May 2014

Features in Development Tools

Aleix Pol Gonzalez committed changes in [kdevplatform] /appwizard:

Add a project name validation in the project creation dialog

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.

REVIEW: 117407

File Changes

Modified 2 files
  • /appwizard
  •   plugins/projectselectionpage.cpp
  •   plugins/projectselectionpage.h
2 files changed in total