<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/103464/">http://git.reviewboard.kde.org/r/103464/</a>
     </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On December 19th, 2011, 1:10 p.m., <b>Arjen Hiemstra</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">"This patch assumes that all objects in d->objects don't have any parents yet."

This is partly correct - all items that are in d->objects do not have parents since they are considered to be top level items. 

They do have children, however, which means the current code breaks any reference lookup in children that should not be done
from the project. The reason it does work for Invaders is because d->project is set to the first top level item encountered when
no explicit project is passed in ObjectTreeBuilder's constructor. Thus, the second code path is triggered which successfully finds
the object. Maybe you can explain the problem in a bit more detail so we can come up with a solution?</pre>
 </blockquote>




 <p>On December 19th, 2011, 2:05 p.m., <b>Felix Rohrbach</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">My achievements are in a separate file (lets say "project/assets/AchievementsAsset"). Let's say there are two Achievements in this file, Achievement1 and Achievement2. Achievement2 has a reference to Achievement1. In ObjectTreeBuilder::visitStart, the path of that reference (ref.path) is "project/assets/AchievementAsset/Achievement1". Achievement1->fullyQualifiedName() is "Achievement1", as it isn't in the project tree yet. Now if you call Achievement1->findGlobalObjectByName( ref.path ) it will return a 0-pointer, as it can't find that path, but it should return a pointer to itself.

Do you have an idea how to solve that?</pre>
 </blockquote>








</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">One solution is to pass a parent to the parsing methods. The reason I did not add this yet is because I wanted to avoid adding yet another parameter to the parser method, but I do not think it can be avoided. The proper solution is to do lazy-loading of references, as I have mentioned before I think, where we do not resolve the reference until it is needed. This requires quite a lot of code though, so the first option is currently the easiest.</pre>
<br />








<p>- Arjen</p>


<br />
<p>On December 18th, 2011, 10:30 p.m., Felix Rohrbach wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Gluon and Arjen Hiemstra.</div>
<div>By Felix Rohrbach.</div>


<p style="color: grey;"><i>Updated Dec. 18, 2011, 10:30 p.m.</i></p>






<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This patch assumes that all objects in d->objects don't have any parents yet. If this is wrong, the patch is wrong. I don't quite understand all that parser stuff, so I didn't check this myself.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">- My problem is solved
- Invaders still loads into creator and can be played.</pre>
  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>core/gdl/objecttreebuilder.cpp <span style="color: grey">(4dcefa8)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/103464/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>