I have just seen I sent the following mail only to Alexander,<br>so I'm resending it to the list.<br> <br>best regards<br>Tommaso<br><br><div><span class="gmail_quote">On 12/20/05, <b class="gmail_sendername">Tommaso Massimi
</b> <<a href="mailto:tmassimi@gmail.com">tmassimi@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><div>
<div><span class="e" id="q_10845c94422be4fb_1"><span class="gmail_quote">On 12/15/05, <b class="gmail_sendername">Alexander Neundorf</b> <<a href="mailto:neundorf@kde.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
neundorf@kde.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Thursday 15 December 2005 00:20, Tommaso Massimi wrote:<br>> On 12/7/05, Alexander Neundorf <<a href="mailto:neundorf@kde.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">neundorf@kde.org
</a>> wrote:<br>...<br>> > So this might be the reason too why closing a file is so slow in kdevelop
<br>> > ?<br>> ><br>> > void ProblemReporter::closedFile(const KURL &fileName)<br>> > {<br>> >    QValueList<Problem> problems =<br>> > m_cppSupport->backgroundParser()->problems( 
fileName.path() , true ,<br>> > true);<br>> > }<br>> ><br>> > It seems this is done in order to remove the problems reported from this<br>> > file<br>> > from the problem view if the file is closed.
<br>> > I just tried with the call to problems() commented out, the FIXME from<br>> > the closed file still disappears from the problem view. So this seems not<br>> > to be<br>> > the reason.<br>>
<br>> Anybody else knows why problems() is called there ?<br><br>...<br>> void BackgroundParser::addFile( const QString& fileName, bool readFromDisk<br>> ) {<br>>         QString fn = deepCopy( fileName );
<br>><br>>         bool added = false;<br>>         if ( !m_fileList->contains( fn ) )<br>>         {<br>>                 m_fileList->push_back( fn, readFromDisk );<br>>                 added = true;
<br>>         }<br>><br>>         if ( added )<br>>                 m_canParse.wakeAll();<br>> }<br>><br>> It seems it is only checking for duplicate files<br>> (I hope m_fileList->contains( fn ) doesn't implement strange behavoiur...).
</blockquote></span></div><div><br>I have to correct myself:  this function is not involved  at all <br>when a file not included in the project is opened.<br><br></div><span class="q"><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

> before add a file it could be possible to implement some more checks like:<br>><br>> - file size:<br>> probably a big file is not a source file:<br>> my troubles are coming out when I check the .dmp file generated by objdump
<br>> (I'm developing an embedded application,<br>> so quite often I have to check the assembler code stored in a big file)<br>> It could be possible to add some limit to the size of the file (1 MByte?).<br><br>
Hmm, not sure.
<br><br>> - file type<br><br>I think that's the way to go. Can you come up with a patch ?</blockquote></span><div><br>a sort  of patch: <span class="q"><br><br>void ProblemReporter::closedFile(const KURL &fileName)
<br>{<br></span>    KMimeType::Ptr res = KMimeType::findByFileContent( 
fileName.path() );<br>    if (res && res->isValid())<br>    {<br>        QString mimetype = res->name();<br>        if ((mimetype == "text/x-chdr"  ) ||<br>            (mimetype == "text/x-c++hdr") ||
<br>            (mimetype == "text/x-csrc"  ) ||<br>            (mimetype == "text/x-c++src"))<span class="q"><br>        {<br>            QValueList<Problem> problems = m_cppSupport->backgroundParser()->problems( 
fileName.path() , true , true);<br>        }<br>    }<br>}<br><br></span></div>these few lines were enough to solve my problem. <br>Please note that this means that files not included into the current project are not parsed when opened, 
<br>but are parsed when they are going to be closed.<span class="q"><br><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">While this would help for non-source files, closing a file is still very slow.</blockquote>

</span><div><br> yes, I made a test with these line applied; the trouble seems still coming from the same line<span class="q"><br> <br>QValueList<Problem> problems =
m_cppSupport->backgroundParser()->problems( fileName.path() ,
true , true);<br></span></div><br>It seems that if a file is closed before it's background-parsing is ended, <br>the file is parsed during its closure; but I'm not sure about that, <br>I well know kdevelop is a big project and I can't have understood it 
<br>in the few hours I have spent debugging it.<br> <br><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Bye<br>Alex<br>--</blockquote><div>

 <br></div><div>Bye<br>Tommaso<br></div></div>
</blockquote></div><br>