[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: [kdevplatform] project: Don't let the ProjectModel to be accessed from different threads
From:       Andreas Pakulat <apaku () gmx ! de>
Date:       2013-09-11 7:00:06
Message-ID: CAExHGmRdNA6eyS7ND+GmdaV-xt+5RVHyOasQuqk5Om6wHsdVOw () mail ! gmail ! com
[Download RAW message or body]

Hi,

On Wed, Sep 11, 2013 at 1:09 AM, Aleix Pol <aleixpol@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

[Attachment #3 (text/html)]

<div dir="ltr">Hi,<div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep \
11, 2013 at 1:09 AM, Aleix Pol <span dir="ltr">&lt;<a href="mailto:aleixpol@kde.org" \
target="_blank">aleixpol@kde.org</a>&gt;</span> wrote:<br> <blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">Git commit 010d7bbb3f157faacdc65bab114d6e74c99afd08 by Aleix \
Pol.<br> Committed on 10/09/2013 at 22:45.<br>
Pushed by apol into branch &#39;master&#39;.<br>
<br>
Don&#39;t let the ProjectModel to be accessed from different threads<br>
<br>
Experience showed that it didn&#39;t work that well, especially since<br>
there&#39;s no aboutToChangeData().<br>@@ -199,7 +185,7 @@ ProjectBaseItem* \
ProjectBaseItem::takeRow(int row)<br>  Q_ASSERT(row &gt;= 0 &amp;&amp; row &lt; \
d-&gt;children.size());<br> <br>
     if( model() ) {<br>
-        QMetaObject::invokeMethod( model(), &quot;rowsAboutToBeRemoved&quot;, \
getConnectionTypeForSignalDelivery( model() ), Q_ARG(QModelIndex, index()), \
Q_ARG(int, row), Q_ARG(int, row) );<br> +        QMetaObject::invokeMethod( model(), \
&quot;rowsAboutToBeRemoved&quot;, Qt::DirectConnection, Q_ARG(QModelIndex, index()), \
Q_ARG(int, row), Q_ARG(int, row) );<br></blockquote><div><br></div><div>Shouldn&#39;t \
this be changed to a direct function call for easier understanding of the code (and \
all other cases too)?</div> <div> </div><div>Andreas</div></div></div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic