[kdevplatform] project: Don't let the ProjectModel to be accessed from different threads

Aleix Pol aleixpol at kde.org
Thu Sep 12 00:21:51 UTC 2013


On Wed, Sep 11, 2013 at 9:00 AM, Andreas Pakulat <apaku at gmx.de> wrote:

> Hi,
>
> On Wed, Sep 11, 2013 at 1:09 AM, Aleix Pol <aleixpol at kde.org> wrote:
>
>> Git commit 010d7bbb3f157faacdc65bab114d6e74c99afd08 by Aleix Pol.
>> Committed on 10/09/2013 at 22:45.
>> Pushed by apol into branch 'master'.
>>
>> Don't let the ProjectModel to be accessed from different threads
>>
>> Experience showed that it didn't work that well, especially since
>> there's no aboutToChangeData().
>> @@ -199,7 +185,7 @@ ProjectBaseItem* ProjectBaseItem::takeRow(int row)
>>      Q_ASSERT(row >= 0 && row < d->children.size());
>>
>>      if( model() ) {
>> -        QMetaObject::invokeMethod( model(), "rowsAboutToBeRemoved",
>> getConnectionTypeForSignalDelivery( model() ), Q_ARG(QModelIndex, index()),
>> Q_ARG(int, row), Q_ARG(int, row) );
>> +        QMetaObject::invokeMethod( model(), "rowsAboutToBeRemoved",
>> Qt::DirectConnection, Q_ARG(QModelIndex, index()), Q_ARG(int, row),
>> Q_ARG(int, row) );
>>
>
> Shouldn't this be changed to a direct function call for easier
> understanding of the code (and all other cases too)?
>
> Andreas
>

Yes, but it's not trivial since most of the calls are performed from the
ProjectBaseItem, so friendships are in order. Also I preferred to reduce
the changes for the moment, so that we can better identify where the
possible problems come from.

I'll do it eventually, but if you want to do it now, please feel free :).

Aleix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20130912/5a78071f/attachment.html>


More information about the KDevelop-devel mailing list