How to chdir?

Evgeniy Ivanov powerfox at kde.ru
Thu Jun 19 13:22:02 UTC 2008


Evgeniy Ivanov wrote:
> Andreas Pakulat wrote:
>   
>> On 18.06.08 22:27:50, Evgeniy Ivanov wrote:
>>   
>>     
>>> I use KJob based class (VcsJob) and have to chdir. Git wants me to go to 
>>> his repo before executing commands. Now I use QDir:setCurrentDir (and 
>>> after I did all things i change back it to the previous value). Any 
>>> suggestions? It will be painful to switch to the QProcess...
>>>     
>>>       
>> a) How are you calling git right now? (Or even better: where can I get
>> your code to have a look?)
>>
>> b) Why is it painful to use QProcess?
>>
>> You can't do this without using QProcess or KProcess (the latter is
>> possibly a bit easier to use). And you also don't need to use it in
>> "Shell" mode.
>>
>> And KJob/VcsJob themselves are just empty containers, they just provide
>> a job-like API on top of whatever you put into your implementation of
>> the start() method.
>>
>> Andreas
>>
>>   
>>     
> a) Plugin returns Jobs, and they're executed with start.
> http://repo.or.cz/w/kdevelopdvcssupport.git?a=tree;f=plugins/git;h=cb668d507f0a4e0b72895af8ec8bb8af1fb6536f;hb=my
> b) I thought I have to rewrite code, and not just to reimplement 
> *Job::start()
>
> By shell mode I mean usage cmdinterface instead of API. mattr asced me 
> to use another words to describe it. I use Job, so it sould be clearer.
> So, I will reimplement start in cvslpugin style. Andreas, thanks.
>
>   
Oops, I have even implemented start(), but used workingdir() instead 
repo dir :)

-- 
Best Regards,
Evgeniy






More information about the KDevelop-devel mailing list