A new class generation

Alexander Dymo cloudtemple at mksat.net
Wed Apr 30 22:44:11 UTC 2003


On Wednesday 30 April 2003 17:04, Jozef Kosoru wrote:
> I'compiled today's KDevelop CVS and it seems that
> 'Generate a new class' function does not work. It always generates an
> empty file (only default info comment is there).
>
> I'm also a bit confused with the KDevelop template possibilities.
> There is:
>
> * Settings->configure Gideon->C++ New Class Generator
> 	(all templates are empty)
Empty templates indicate installation error. Please remove 
~/.kde/share/apps/kdevcppsupport/newclass/ directory.
If it doesn't help try to remove 
$KDEDIR/share/apps/kdevcppsupport/newclass/
and reinstall gideon.

Ok there two kinds of templates:
1) "new file" templates used when creating a file
2) "new class" templates used when creating a new class in the "New Class"
wizard

1) 
Settings->Configure Gideon->New File Wizard->Global Types
Default templates for any kind of file that can be created by "New File"
action (File->New or "New File" window).
Templates are located in
$KDEDIR/share/apps/kdevfilecreate/file-templates
or in ~/.kde/share/apps/kdevfilecreate/file-templates

Project->Projects Options->New File Wizard->Used Global Types
File types that can be created in a given project using global templates.

Project->Projects Options->New File Wizard->Project Types
File types with specific templates for the project.
Templates are stored in
project_dir/templates

Project->Projects Options->New File Wizard->Project Templates
Any other file templates not listed above. For example they could be
your sample license, readme files, or anything else. This templates are 
also used by "New File" wizard.
This templates are stored in project_dir/templates too.

"New File" templates aren't restricted to be a simple description comments
but they could also contain some ready-to-use code.


2)
Project->Projects Options->C++ specific->File Templates
Templates for .h and .cpp files for the project. They are used by "New class"
and ui-subclassing wizards when they creating .cpp or .h files.
Usually they are simple comments at the begining of the file because new class
and subclassing wizards define the contents of the file by themselves.

Settings->Configure Gideon->C++ New Class Generator
Templates are located in
$KDEDIR/share/apps/kdevcppsupport/newclass/
or in ~/.kde/share/apps/kdevcppsupport/newclass/
They are used by "new class" wizard to set the contents of 
.cpp and .h files.

Project->New Class->Generation Options
Same templates as above but if modified, they aren't stored and used
only once for particular class.


> 	there are templates for cpp/h files, but no file in 'template
> 	location' is set
"Template location" corresponds to the location of the file which will be used
as a template. The file will be copied to the templates directory
(either ~/.kde/share/apps/kdevfilecreate/file-templates or 
project_dir/templates).
So "Template location" should be used only when you have a ready template
and want to use it in KDevelop.

-- 
Alexander Dymo
Ukrainian State Maritime Technical University, IT Department





More information about the KDevelop-devel mailing list