Bug#2971: KDevelop discards references to a class in a source file when the header is edited

Richard Dale Richard_Dale at tipitina.demon.co.uk
Sat Apr 8 16:00:32 UTC 2000


Package: kdevelop
Version: 1.1
Severity: normal

Bugreport ID : 12:16,07.04.00

Originator       : Richard Dale
E-Mail           : Richard_Dale at tipitina.demon.co.uk

Subject : KDevelop discards references to a class in a source file when
the header is edited

Error Class      : software bug
Error Location   : class tree
Priority         : medium
Bug Description ---------------------------

KDevelop garbage collects references to a class when the header is
changed, even if it has a source file (.cpp) which still has references
to the class. Then the 'Go To Definition' menu options for the methods no
longer work.

How to repeat the error -------------------

1) Edit a C++ header (.h), which has a corresponding source file (.cpp) in
a project sub-directory.
2) Select 'File->Save All'.
3) Try to go to the definition of one of the methods for the class


Bugfix or Workaround ----------------------

In ClassStore.cc, the method CClassStore::removeWithReferences should
be changed as follows:
diff -Naur -X /home/duke/bin/patcher.exclude
kdevelop-1.1/kdevelop/classparser/ClassStore.cc
kdevelop-1.1objc/kdevelop/classparser/ClassStore.cc ---
kdevelop-1.1/kdevelop/classparser/ClassStore.cc      Fri Feb 25 05:36:54 2000
+++ kdevelop-1.1objc/kdevelop/classparser/ClassStore.cc  Fri Apr  7 11:53:38
2000 @@ -106,7 +106,8 @@ aClass = globalContainer.classIterator.current();

// Remove the class if any of the files are the supplied one.
-    if( aClass->declaredInFile == aFile)
+    if( aClass->declaredInFile == aFile
+                && (aClass->definedInFile == (const char *) NULL || 
aClass->declaredInFile == aClass->definedInFile) ) removeClass( aClass->name
); }


System Information ------------------------

KDevelop version         : 1.1
KDE version              : 1.1.2
QT version               : 1.44
OS/Distribution          : LinuxPPC
Compiler                 : gcc

misc :
spelt 'Miscellaneous'! 

I've already tried to send this bug report, but it
bounced (possibly because it had 'Loses' in the subject, I'm not sure). 
So apologies if it arrives twice.





More information about the KDevelop-devel mailing list