<table><tr><td style="">bevendorff updated this revision to Diff 11552.<br />bevendorff added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D4665" rel="noreferrer">View Revision</a></tr></table><br /><div><div><ul class="remarkup-list">
<li class="remarkup-list-item">Fix more code style issues, and also make the whole thing work when there is only one (unselected) project</li>
</ul>

<p>I updated the code according to your requests. I don't like having assignment operators inside if statements, personally, but <br />
you're the boss. ;-)<br />
I also made sure that it works when there is only one project and it isn't selected. In that case I simply select the entry <br />
automatically and proceed as usual (since this happens before or right after a project is added to the tree view, there is <br />
no difference in behavior from a user perspective).<br />
I also added a projectClosed slot to reset the previous selection explicitly, because it appears that using a QPointer alone <br />
here isn't enough. Some resources are freed mid-air while tearing down everything when KDevelop quits. For it to work <br />
automagically, I would need to make a QPointer of ProjectBaseItem and not only of ProjectBaseItem::project(), but since <br />
ProjectBaseItem is no child of QObject, this isn't possible. If you have a better solution, please speak.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R33 KDevPlatform</div></div></div><br /><div><strong>CHANGES SINCE LAST UPDATE</strong><div><a href="https://phabricator.kde.org/D4665?vs=11542&id=11552" rel="noreferrer">https://phabricator.kde.org/D4665?vs=11542&id=11552</a></div></div><br /><div><strong>BRANCH</strong><div><div>fix/project-tree-save-state</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D4665" rel="noreferrer">https://phabricator.kde.org/D4665</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>plugins/projectmanagerview/projecttreeview.cpp<br />
plugins/projectmanagerview/projecttreeview.h</div></div></div><br /><div><strong>EMAIL PREFERENCES</strong><div><a href="https://phabricator.kde.org/settings/panel/emailpreferences/" rel="noreferrer">https://phabricator.kde.org/settings/panel/emailpreferences/</a></div></div><br /><div><strong>To: </strong>bevendorff, mwolff, apol, kfunk<br /><strong>Cc: </strong>flherne, kfunk, kdevelop-devel<br /></div>