Patch KDevelop 2.0

Omid Givi omid at
Wed Feb 7 23:06:55 UTC 2001

Dear Sandy
(and all other KDev army members),

Here you get my patch, as I promised. The patch is tarred and
b2zipped.  It contains:

1. a shell script which does the patch. (Please read the
   content before you run it. ;-). To run this you should go to the
   directory top of kdevelop.
2. newfiles/: a direcotry containing the new files which are being
   added to the project.
3. kdev.patch: result of 'diff -r -u Mykdevelop-dir ORGkdevelop-dir',
   which could be used to patch the whole.
4. README.txt: containing the following info and some more.

What is done?

Because it is the job of the project management to decide which
compiler to use and the options of which compiler to deal with, I have
thaught of compiler entities. Class KDevCompiler is a base class for
every compiler which is supported bij KDevelop. The class KDevCompiler
holds the compiler dependant attributes and provides some methods to
deal with these attributes. Every compiler knows now some individual
attributes: name of the compiler, an internal ID, a widget pointer to
the options page of the compiler and the information to make the
widget etc. Every compiler keeps this information along with his life
cycle. So every time somebody needs any info, it can be provided
(needed for some compilers other than c/c++, also needed if you want
to save those individual info's for later use).

KDevCompiler is lodged in ./kdevelop/kdevelop/lib/projectmanagement/KDeCompiler
as it has close realtionship with the projectmanagement.

ProjectSpace is extended with a QList which holds the pointers to the
compilers it uses. Also some methods are provided to use this
QList. ProjectSpace can now register the pre-defined compiler
entities(those that are already defined, extentions of KDevCompiler)
and let even a new compiler be registered (for the plugins and other
component which may want to do that).

In this way, ProjectSpace knows which compilers are related to its
Space. It can let the options of those compilers changed (in the
project options dialog, it can register data within them, etc.)

The 'Project Options Dialog' is reanimated, (using the qt-designer,
*.ui files are included) to keep up with the needs. There is QListView
(Tree) with sub items. One of the level-zero items is indeed the
compiler, under which the compiler entities used by the current
ProjectSpace will be shown (dynamically).

In ./kdevelop/kdevelop/lib/projectmanagement is there a ProjectOptions
directory made which holds the code for the new 'Project Options
Dialog'. In this directory are there subdirectories in which different
options widgets for different compilers are coded. The nice code of
Bernd Gehrmann for the C/C++ flag-boxes I have copied to the
ProjectOptions sections of C and C++. I have integrated it in the
new 'Project Options Dialog' as well.

Finally I have made some changes to's and in to deal with the new code.

The following line I have made as comment in projectspace.cpp:

//TheCore()->changeProjectSpace ();

Somehow this will genrate a crash! I have not looked for the reason
yet. perhaps I do tomorrow.

The method:
void NewProjectDlg::slotProjectSpaceSelected (QListViewItem *item){

in newprojectdlg.cpp has a tiny bug. if the item is null, then you get
a crash. It happens for example if you click on the area arround the
items in the ListView and not exactly on the items. A simple test of:

if (!item) return;  ;-)

will solve the problem.

Which files are added?








Pleas apply the changes, compile and see the result. Please let me
know, all of you, what you think of it. I have some more plans to
extend this.

Sandy, Would you by the way let me know how I can get write access to
the cvs repository? (And also some info please regarding cvs
operations, rules etc.) Will you commit or will I be pleased to commit
my first code?

Tomorrow I'll be working on the rest of the project options and I'll take
a look what I can do on the project management/space.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.tar.bz2
Type: application/x-bzip2
Size: 16982 bytes
URL: <>

More information about the KDevelop-devel mailing list