why is a source file parsed when being closed ? (was: Re: my first post)

Alexander Neundorf neundorf at kde.org
Thu Dec 15 21:51:04 UTC 2005


On Thursday 15 December 2005 00:20, Tommaso Massimi wrote:
> On 12/7/05, Alexander Neundorf <neundorf at kde.org> wrote:
...
> > So this might be the reason too why closing a file is so slow in kdevelop
> > ?
> >
> > void ProblemReporter::closedFile(const KURL &fileName)
> > {
> >    QValueList<Problem> problems =
> > m_cppSupport->backgroundParser()->problems( fileName.path() , true ,
> > true);
> > }
> >
> > It seems this is done in order to remove the problems reported from this
> > file
> > from the problem view if the file is closed.
> > I just tried with the call to problems() commented out, the FIXME from
> > the closed file still disappears from the problem view. So this seems not
> > to be
> > the reason.
>
> Anybody else knows why problems() is called there ?

...
> void BackgroundParser::addFile( const QString& fileName, bool readFromDisk
> ) {
>         QString fn = deepCopy( fileName );
>
>         bool added = false;
>         if ( !m_fileList->contains( fn ) )
>         {
>                 m_fileList->push_back( fn, readFromDisk );
>                 added = true;
>         }
>
>         if ( added )
>                 m_canParse.wakeAll();
> }
>
> It seems it is only checking for duplicate files
> (I hope m_fileList->contains( fn ) doesn't implement strange behavoiur...).
>
> before add a file it could be possible to implement some more checks like:
>
> - file size:
> probably a big file is not a source file:
> my troubles are coming out when I check the .dmp file generated by objdump
> (I'm developing an embedded application,
> so quite often I have to check the assembler code stored in a big file)
> It could be possible to add some limit to the size of the file (1 MByte?).

Hmm, not sure.

> - file type

I think that's the way to go. Can you come up with a patch ?
While this would help for non-source files, closing a file is still very slow.

Bye
Alex
-- 
Work: alexander.neundorf at jenoptik.com - http://www.jenoptik-los.de
Home: neundorf at kde.org                - http://www.kde.org
      alex at neundorf.net               - http://www.neundorf.net




More information about the KDevelop-devel mailing list