<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/127284/">https://git.reviewboard.kde.org/r/127284/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On March 6th, 2016, 9:37 a.m. UTC, <b>Frederik Schwarzer</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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Do you have any reason to move the enum outside of the class?
I am using C++ for some years now but have only started serious reading about it a few months ago. Meaning, my knowledge is pretty limited and I would like to understand, if there is a reason for that.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Same goes for "virtual". I have not advanced to the "virtual" chapter of the book I am reading. So ... well, at least I cannot comment on that change. :D</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Otherwise I would say: "Ship it!", but you may want to wait a few days for others to comment.</p></pre>
</blockquote>
<p>On March 6th, 2016, 8:51 p.m. UTC, <b>Julian Helfferich</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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Before I learned about enum classes, I always put enums in a namespace or inside a class to protect their scope. Thankfully, with enum classes this is no longer necessary.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">If I had left the enum inside the class, it would be necessary to call</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%">KBlocksSound mSnd;
mSnd<span style="color: #666666">-></span>playSound(KBlocksSound<span style="color: #666666">::</span>Sound<span style="color: #666666">::</span>BlockMove);
</pre></div>
</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">which I find redundant. If the enum is outside the class you can call</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%">mSnd<span style="color: #666666">-></span>playSound(Sound<span style="color: #666666">::</span>BlockMove);
</pre></div>
</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">which I find much nicer.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Virtual destructors are necessary if there are child classes. When you have</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%">BaseClass <span style="color: #666666">*</span>pointer <span style="color: #666666">=</span> <span style="color: #008000; font-weight: bold">new</span> ChildClass();
<span style="color: #008000; font-weight: bold">delete</span> pointer;
</pre></div>
</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">will the ChildClass destructor be called? If you have a virtual destructor in BaseClass the answer is yes. If you don't have a virtual destructor then nobody knows.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">In this case, KBlocksSound is not designed to be inherited from. I have seen people declaring all destructors virtual. I do not have a strong opinion on this, but I prefer to omit unnecessary keywords.</p></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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Thanks for the explanation. :)</p></pre>
<br />
<p>- Frederik</p>
<br />
<p>On March 9th, 2016, 3:32 a.m. UTC, Julian Helfferich wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tr>
<td>
<div>Review request for KDE Games.</div>
<div>By Julian Helfferich.</div>
<p style="color: grey;"><i>Updated March 9, 2016, 3:32 a.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
kblocks
</div>
<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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Port sound in KBlocksSound from Phonon to KgSound. Note that neither before nor after this port sounds are played (the KBlocksSound::playSound() function is not called). I have also re-enabled the sound and will post the patch here once the port to KgSound is approved and pushed.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">The new KBlocksSound uses the sounds from the sounds/ directory. Previously it was intended (at least it seams so to me) that the sound is part of the theme. However, there are only two of three sounds in the themes/ directory (default theme). Thus, unless there are any themed sounds, I suggest to simply use the sounds from the sounds/ directory.</p></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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">The testing were done for this patch plus the next patch enabling the sounds.</p>
<ul style="padding: 0;text-rendering: inherit;margin: 0 0 0 1em;line-height: inherit;white-space: normal;">
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">Played single game -> Sounds play correctly.</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">Played Human vs AI -> Sounds play only for human player (as intended).</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">Turned off/on sounds -> Sounds off/on correctly.</li>
</ul></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>CMakeLists.txt <span style="color: grey">(38fdfd3)</span></li>
<li>KBlocksScene.cpp <span style="color: grey">(07cd457)</span></li>
<li>KBlocksSound.h <span style="color: grey">(dc02775)</span></li>
<li>KBlocksSound.cpp <span style="color: grey">(1346bc6)</span></li>
<li>sounds/CMakeLists.txt <span style="color: grey">(PRE-CREATION)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/127284/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>