gideon alpha 4...

raggi at cli.di.unipi.it raggi at cli.di.unipi.it
Wed Apr 9 16:19:02 UTC 2003


Quoting Alexander Dymo <cloudtemple at mksat.net>: 
 
> 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. 
 
another solution is  
  - if translationUnit returns 0 then // maybe, because the file isn't part of 
project 
     - invoke backgroundParser->addFile( your-file ); 
     - sync, use the AST and then remove the file from backgroundParser 
 
ciao robe 
 

-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/




More information about the KDevelop-devel mailing list