gideon alpha 4...

Alexander Dymo cloudtemple at mksat.net
Wed Apr 9 15:52:03 UTC 2003


On Monday 07 April 2003 23:00, Alexander Dymo wrote:
> Subclassing feature in cppsupport don't work well. There are some
> problems with "Edit ui-subclass" wizard. I'll look tomorrow or on wednesday
> morning.

I've recently commited my fixes for subclassing into parts/cppsupport.
Instead of the problems with subclassing itself, I've also found an issue
with background parser.
The problem is that if the file "filename" was not parsed before
m_cppSupport->backgroundParser()->translationUnit( filename)
function returns 0.
So if the subclassing wizard was used on the file "test.cpp" or "test.h"
and "test.h" was not opened in the editor, the subclassing wizard could not
obtain TranslationUnitAST object.

I've added a temporary workaround:
TranslationUnitAST* translationUnit( const QString& fileName, 
	bool create = false );

TranslationUnitAST* BackgroundParser::translationUnit( const QString& 
fileName, bool create )
{
    Unit* u = 0;
    if (create)
        u = findOrCreateUnit( fileName, true );
    else
        u = findUnit( fileName );
    return u ? u->translationUnit : 0;
}

So to be sure the TranslationUnitAST will not be 0, I've call 
m_cppSupport->backgroundParser()->translationUnit( filename, true )
thus forcing a parser.

Roberto, please check if I'm correct there.

Caleb, if Roberto confirm that change, could you please update alpha4 tag.
Subclassing wizards should work fine.

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





More information about the KDevelop-devel mailing list