[KDevPlatform/1.2] 5774a52: Check that git is installed when loading Git Suppo

Morten Volden mvolden2 at gmail.com
Mon Dec 20 19:59:45 UTC 2010


Hi

The plugin fails due to the two lines below in the constructor of GitPlugin
(and the fact that git is not installed on the host machine) - correct?:

    DVcsJob* versionJob = new DVcsJob(QDir::tempPath(), this,
KDevelop::OutputJob::Silent);
    *versionJob << "git" << "--version";

As far as I can tell the output of the versionJob is only used in the

status(const KUrl::List& localLocations,
KDevelop::IBasicVersionControl::RecursionMode recursion)

function.

Why not wait with creating a versionJob untill the status function is
called? (And then of course only create and parse it the first time).

That should solve the problem described in
https://bugs.kde.org/show_bug.cgi?id=257650

Just my 2 cents:

Regards

Morten


2010/12/20 Aleix Pol <aleixpol at kde.org>

> On Mon, Dec 20, 2010 at 12:51 PM, Dmitry Risenberg <
> dmitry.risenberg at gmail.com> wrote:
>
>> 2010/12/20 Aleix Pol <aleixpol at kde.org>:
>> > Maybe you could try to explore why is this crashing? I don't like to
>> change
>> > the plugin interface to provide errors, we could end up with code
>> checking
>> > if plugins are wrong all over the place.
>> > Aleix
>>
>> The reason is that the plugin object returned from
>> KServiceTypeTrader::createInstanceFromQuery (plugincontroller.cpp:435)
>> is used by some later initialization code, particularly in
>> ProjectPrivate::loadVersionControlPlugin, and this code does not know
>> that the plugin has in fact been unloaded. Unloading via
>> PluginController::unloadPlugin deletes the plugin object, so accessing
>> it later is accessing freed memory.
>> To sum up, the plugin itself cannot know whether it is safe to unload
>> at a given moment, so it is up to PluginController to decide, which,
>> in turn, has to check for errors. In fact it seems strange that there
>> is no error reporting mechanism, and it is just assumed that the
>> plugin always loads correctly.
>>
>> --
>> Dmitry Risenberg
>>
>> --
>> KDevelop-devel mailing list
>> KDevelop-devel at kdevelop.org
>> https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
>>
>
> On the other hand, plugins can be unloaded by the user and we have to be
> prepared for that.
>
> Aleix
>
> --
> KDevelop-devel mailing list
> KDevelop-devel at kdevelop.org
> https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
>
>


-- 
- When the split is pulled, mr. Grenade is no longer our friend
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20101220/68b6abf7/attachment.html>


More information about the KDevelop-devel mailing list