<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://reviewboard.kde.org/r/4585/">http://reviewboard.kde.org/r/4585/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On July 13th, 2010, 8:53 p.m., <b>Aaron Seigo</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="/r/4585/diff/3/?file=30674#file30674line264" style="color: black; font-weight: bold; text-decoration: underline;">/trunk/KDE/kdebase/workspace/libs/taskmanager/taskgroup.cpp</a>
<span style="font-weight: normal;">
(Diff revision 3)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">void TaskGroup::remove(AbstractGroupableItem *item)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">264</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="k">if</span> <span class="p">(</span><span class="n">member</span><span class="o">-></span><span class="n">isLauncherItem</span><span class="p">())</span> <span class="p">{</span></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">265</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="n">LauncherItem</span> <span class="o">*</span><span class="n">item</span> <span class="o">=</span> <span class="n">qobject_cast</span><span class="o"><</span><span class="n">LauncherItem</span><span class="o">*></span><span class="p">(</span><span class="n">member</span><span class="p">);</span></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">266</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">item</span><span class="o">-></span><span class="n">isVisible</span><span class="p">())</span> <span class="p">{</span></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">267</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="n">list</span><span class="p">.</span><span class="n">removeAll</span><span class="p">(</span><span class="n">member</span><span class="p">);</span></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">268</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="p">}</span></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">269</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="p">}</span></pre></td>
</tr>
</tbody>
</table>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">why are launchers with no window instances removed from the member list?</pre>
</blockquote>
<p>On August 22nd, 2010, 10:30 a.m., <b>Anton Kreuzkamp</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;">isVisible() returns true if there's no window instance, so it get removed if there is one.</pre>
</blockquote>
<p>On August 23rd, 2010, 8:08 p.m., <b>Aaron Seigo</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;">ah! ok, that makes sense ... very unfortunate that this needs to be done on each request for members(), however, as that gets called fairly often. it would be a lot nicer if the launcher was only added (pre-pended?) to the list if there were no windows (and so it should be shown). this could be achieved by checking isVisible on the launcher item after calls to addWindowInstance and removeWindowInstance; a separate list/set of all launchers would need to be kept in this case (for the ones that are !isVisibe and therefore no longer in the main list), but this should prevent a lot of iteration, temporary list creation, casting and comparisons whenever members() is called.
(another more complex approach might be to make LauncherItem change its type: when there are no associated windows it is a launcher item; when there is one window, it is a window item; where there is >1 window, it is a group item. this, however, is signficantly more complex and not at all worth it as far as i can see.)
(this also implies that once the app is launched, it doesn't make sense to launch it again (which isn't always the case), but that's probably ignorable.)</pre>
</blockquote>
<p>On August 23rd, 2010, 8:45 p.m., <b>Anton Kreuzkamp</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;">If I didn't missunderstood the code (please correct me if I did) it this only gets called if the item wasn't there before (in addTask(); removeTask() only gets called if the item really should be removed ) because of this is checked before. ("if (!item) {",l.269)</pre>
</blockquote>
</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">yes, that's correct. however, that is enough to know when a LauncherItem should or should not be shown. some possible aproaches:
* LauncherItem could emit a signal when the count drops to zero or becomes non-zero, allowing the TaskGroup to connect to this signal and add/remove it from the list of items only when it changes
* in LauncherItem::addWindowInstance and LauncherItem::removeWindowInstance, something like this:
if (parentGroup() {
parentGroup()->launcherStatusChanged(this);
}
a matter of taste which is more pleasant. personally, i'd go for the latter; the signal would be "cleaner" if it weren't for the fact that managing the connections and disconnections would be required and the current code probably doesn't lend itself to that.</pre>
<br />
<p>- Aaron</p>
<br />
<p>On August 22nd, 2010, 10:39 a.m., Anton Kreuzkamp wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://reviewboard.kde.orgrb/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 Plasma.</div>
<div>By Anton Kreuzkamp.</div>
<p style="color: grey;"><i>Updated 2010-08-22 10:39:29</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;">Adds support for Windows 7 like launchers in libtaskmanager.
(I'm on holliday from 12th July until 1st August so I will not be able to reply during this time.)</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;">Tested with a small test-applett and everything works.</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>/trunk/KDE/kdebase/workspace/libs/taskmanager/CMakeLists.txt <span style="color: grey">(1148442)</span></li>
<li>/trunk/KDE/kdebase/workspace/libs/taskmanager/abstractgroupableitem.h <span style="color: grey">(1148442)</span></li>
<li>/trunk/KDE/kdebase/workspace/libs/taskmanager/abstractgroupableitem.cpp <span style="color: grey">(1148442)</span></li>
<li>/trunk/KDE/kdebase/workspace/libs/taskmanager/abstractgroupingstrategy.h <span style="color: grey">(1148442)</span></li>
<li>/trunk/KDE/kdebase/workspace/libs/taskmanager/abstractgroupingstrategy.cpp <span style="color: grey">(1148442)</span></li>
<li>/trunk/KDE/kdebase/workspace/libs/taskmanager/abstractsortingstrategy.cpp <span style="color: grey">(1148442)</span></li>
<li>/trunk/KDE/kdebase/workspace/libs/taskmanager/groupmanager.h <span style="color: grey">(1148442)</span></li>
<li>/trunk/KDE/kdebase/workspace/libs/taskmanager/groupmanager.cpp <span style="color: grey">(1148442)</span></li>
<li>/trunk/KDE/kdebase/workspace/libs/taskmanager/launcheritem.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>/trunk/KDE/kdebase/workspace/libs/taskmanager/launcheritem.cpp <span style="color: grey">(PRE-CREATION)</span></li>
<li>/trunk/KDE/kdebase/workspace/libs/taskmanager/strategies/alphasortingstrategy.cpp <span style="color: grey">(1148442)</span></li>
<li>/trunk/KDE/kdebase/workspace/libs/taskmanager/strategies/kustodiangroupingstrategy.cpp <span style="color: grey">(1148442)</span></li>
<li>/trunk/KDE/kdebase/workspace/libs/taskmanager/strategies/manualgroupingstrategy.cpp <span style="color: grey">(1148442)</span></li>
<li>/trunk/KDE/kdebase/workspace/libs/taskmanager/strategies/programgroupingstrategy.cpp <span style="color: grey">(1148442)</span></li>
<li>/trunk/KDE/kdebase/workspace/libs/taskmanager/taskactions.cpp <span style="color: grey">(1148442)</span></li>
<li>/trunk/KDE/kdebase/workspace/libs/taskmanager/taskgroup.h <span style="color: grey">(1166310)</span></li>
<li>/trunk/KDE/kdebase/workspace/libs/taskmanager/taskgroup.cpp <span style="color: grey">(1166310)</span></li>
<li>/trunk/KDE/kdebase/workspace/libs/taskmanager/taskitem.h <span style="color: grey">(1166310)</span></li>
<li>/trunk/KDE/kdebase/workspace/libs/taskmanager/taskitem.cpp <span style="color: grey">(1148442)</span></li>
</ul>
<p><a href="http://reviewboard.kde.org/r/4585/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>