KIO from inside a parsejob?

Milian Wolff mail at milianw.de
Wed Jul 15 14:52:04 UTC 2009


Andreas Pakulat wrote:
> On 15.07.09 07:39:49, Niko Sams wrote:
>> On Wed, Jul 15, 2009 at 01:48, Milian Wolff<mail at milianw.de> wrote:
>>> Am Dienstag, 14. Juli 2009 22:43:19 schrieb Milian Wolff:
>>>> Hey guys,
>>>>
>>>> could it be that KIO must not be accessed from a parsejob? Look at that, I
>>>> can't explain it:
>>>>
>>>> http://mwolff.pastebin.com/f4e26ba49
>>>>
>>>> I try to fix the includebuilder for PHP and remote projects. My code now:
>>>>
>>>> http://mwolff.pastebin.com/f6b676fc0
>>>>
>>>> Here's the debug output on the console:
>>>> http://mwolff.pastebin.com/f130f444b
>>>>
>>>> What's that about QPair's?! Is my build fubar? Help!
>>> It's definitly the KIO::NetAccess::exists(). If I comment that out everything
>>> seems to work fine.
>>>
>>> Niko: Have you ever tested that? Or did it work for you back then?
>> I never tested with non-local files.
>>
>> I think we can't use KIO in a background thread (?).
> 
> I suggest asking on kde-core-devel (unless you've examined kio's code ;)

Just asked in #kde-devel and pinotree said KIO is not threadsafe. So 
yeah, I think I'll have to remove that code...

Niko, I'd say we change the whole logic to the following:

Remote includes: (require 'http://...')
- always assume they are found in the includebuilder

includes in remote project:
- if include is relative: create url relative to current file and 
CHECK_INCLUDE (see below)
- if include is absolute: create url with password, username, protocol 
etc. from the current file and set path+filename from the include, 
CHECK_INCLUDE

CHECK_INCLUDE: basically just do something like 
projectController()->findProjectForUrl(). If we find a project, the url 
exists ;-)

includes in local project:
- just check if the file exists via QFile or similar. When include is 
relative, set working dir for Qfile to the dir containing the current file.


I think I'll just write some code and you tell me if it is ok.
-- 
Milian Wolff
http://milianw.de




More information about the KDevelop-devel mailing list