<div dir="ltr">Hi,<br>I've almost finished working on a usable class browser (IMHO).<br><br>I've already implemented everything I had in mind so far:<br> * Displays all available classes in the opened projects.<br>
 * Updates the list dynamically as files in the projects change.<br> * Ability to show base classes for each class<br> * Ability to show derived classes for each class<br> * Filtering ability (using the search box and display the results in a special results node).<br>
 * All of this is done efficiently - if the node is not expanded, it requires no CPU cycles (updates monitoring, etc.).<br><br><br>I still have 2 problems remaining to resolve and I ask for some help on the matters:<br><br>
1. After browsing through the classes in the class browser, when I close KDevelop, I get the following output in the console followed by a crash:<br>SpecialTemplateDeclarationData::m_specializations There were items left on destruction: 14<br>
ClassFunctionDeclarationData::m_defaultParameters There were items left on destruction: 5<br>ClassDeclarationData::baseClasses There were items left on destruction: 5<br>TopDUContextData::m_usedDeclarationIds There were items left on destruction: 189<br>
DUContextData::m_importedContexts There were items left on destruction: 212<br>DUContextData::m_childContexts There were items left on destruction: 212<br>DUContextData::m_importers There were items left on destruction: 212<br>
DUContextData::m_localDeclarations There were items left on destruction: 212<br>DUContextData::m_uses There were items left on destruction: 212<br><br>The crash stack trace (gdb output):<br>--------------------------------------------------<br>
0xb60a40f6 in ~DUChainBase (this=0x9682fb0) at /home/lior/Projects/KDE/kdevplatform/language/duchain/duchainbase.cpp:79<br>79      if(d_func()->m_dynamic)<br>(gdb) bt<br>#0  0xb60a40f6 in ~DUChainBase (this=0x9682fb0) at /home/lior/Projects/KDE/kdevplatform/language/duchain/duchainbase.cpp:79<br>
#1  0xb60b9a7d in ~ParsingEnvironmentFile (this=0x9682fb0) at /home/lior/Projects/KDE/kdevplatform/language/duchain/parsingenvironment.cpp:113<br>#2  0xac52699d in ~EnvironmentFile (this=0x9682fb0) at /home/lior/Projects/KDE/kdevelop/languages/cpp/cppduchain/environmentmanager.cpp:292<br>
#3  0xb7e3c806 in ~KSharedPtr (this=0x9b46cac) at /usr/include/ksharedptr.h:84<br>#4  0xb604d94d in QMap<KDevelop::IndexedString, KSharedPtr<KDevelop::ParsingEnvironmentFile> >::freeData (this=0xb1704734, x=0x93f5e80)<br>
    at /usr/include/qt4/QtCore/qmap.h:587<br>#5  0xb604dd12 in ~QMap (this=0xb1704734) at /usr/include/qt4/QtCore/qmap.h:147<br>#6  0xb604dd35 in ~QMultiMap (this=0xb1704734) at /usr/include/qt4/QtCore/qmap.h:901<br>#7  0xb6057834 in ~DUChainPrivate (this=0xb17046c8) at /home/lior/Projects/KDE/kdevplatform/language/duchain/duchain.cpp:287<br>
#8  0xb603cc4c in destroy () at /home/lior/Projects/KDE/kdevplatform/language/duchain/duchain.cpp:847<br>#9  0xb601612d in ~KCleanUpGlobalStatic (this=0xb61a0284) at /usr/include/kglobal.h:62<br>#10 0xb6410d89 in exit () from /lib/tls/i686/cmov/libc.so.6<br>
#11 0xb63f868d in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6<br>#12 0x0804cf51 in _start ()<br><br>I'm probably using the DUChains wrong but I have no idea why. Do I need to delete myself the declarations that I retrieve from the DUChains? I don't recall seeing any mentioning for this in the documentation (except the usage of a DUChainPointer which I use).<br>
<br><br>2. I'm not sure how to monitor class changes efficiently (to reflect changes in list of functions / variables) - I'm using DUChainObserver retrieved from DUChain::self()->notifier(), I then connect to the branchModified signal.<br>
The problem with that is that I get 2 notifications for each change:<br>  1. The context range for the first call is the entire document (by querying the range() function). <br>  2. The context range for te second call is zero start and end lines.<br>
It doesn't matter what I change in the document, class level, function level, document level - the results are the same.<br><br>Now - I could use this notification and then do the extra work and update all the classes that relate to the document but Isn't it suppose to notify my on a child context changes (for example the class declaration level context)? or am I missing something here?<br>
<br><br>Thanks,<br>Lior<br><br></div>