<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/124281/">https://git.reviewboard.kde.org/r/124281/</a>
     </td>
    </tr>
   </table>
   <br />











<div>



<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="https://git.reviewboard.kde.org/r/124281/diff/3/?file=383605#file383605line89" style="color: black; font-weight: bold; text-decoration: underline;">src/knotificationmanager.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; ">KNotificationManager::KNotificationManager()</pre></td>

  </tr>
 </tbody>



 
 

 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">86</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">KService</span><span class="o">::</span><span class="n">List</span> <span class="n">offers</span> <span class="o">=</span> <span class="n">KServiceTypeTrader</span><span class="o">::</span><span class="n">self</span><span class="p">()</span><span class="o">-></span><span class="n">query</span><span class="p">(</span><span class="s">"KNotification/NotifyPlugin"</span><span class="p">);</span></pre></td>
    <th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">87</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">QList</span><span class="o"><</span><span class="n">QObject</span><span class="o">*></span> <span class="n">plugins</span><span class="p">;</span></pre></td>
  </tr>

 </tbody>

</table>

 <div style="margin-left: 2em;">

  <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;">Don't you have a memory leak here?
You have a list of pointers which you own here, but QList doesn't know that. When that list goes out of scope it doesn't delete the pointers as far as i know.
The simplest way i can think of is to make plugins a class member and call qDeleteAll(m_plugins) in the class destructor which then deletes all objects.
Or you could go for smart pointers which you store in the QList, that would also clean it up nicely when going out of scope.</p></pre>
 </div>
</div>
<br />



 <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;">I'm looking at the KNotifications dependency graph here [1] and see that KWindowSystem is only required for KCrash.
So err, can't that one go as well since you removed KService which required KCrash which then required KWindowSystem?</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I could be very wrong if KNotifications is using KWindowSystem somewhere, obviously. But the graph doesn't give me that impression.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">[1] http://api.kde.org/frameworks-api/frameworks5-apidocs/knotifications/html/knotifications-dependencies.html</p></pre>

<p>- Mark Gaiser</p>


<br />
<p>On juli 7th, 2015, 7 p.m. UTC, Martin Klapetek 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 Frameworks and Martin Gräßlin.</div>
<div>By Martin Klapetek.</div>


<p style="color: grey;"><i>Updated jul 7, 2015, 7 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
knotifications
</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;">This patch reduces the dependencies of KNotifications framework and effectively makes it a tier 2 framework.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">KService is used only for locating additional notification plugins and to my knowledge,
there are none such plugins currently existing, at least not in all around KDE plus
the class for the plugins wasn't exported until about two months ago, so this should
be safe without a legacy support.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">KIconThemes is used only to get "KIconLoader::Small" icon pixmap for notifications
using KPassivePopup. After some playing around it turns out that it puts the icon into
the KPassivePopup title and makes it as big as the text. So I've made the icon size to
be the same as the text height. So this keeps things visually the same + still DPI aware,
though I believe the KPassivePopup should receive a complete visual overhaul anyway.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Additionally, KCodecs dependency has again one single usage for decoding html entities
to QChars within QXmlStreamReader parser, so eventually could also be removed/replaced
with QTextDocument::toPlainText() which seems to do the same job as QXmlStreamReader+KCodecs.</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;">Everything still compiles + I added a test for KPassivePopup with an icon.</p></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">(2d5437b)</span></li>

 <li>metainfo.yaml <span style="color: grey">(7fc15f7)</span></li>

 <li>src/CMakeLists.txt <span style="color: grey">(1cebece)</span></li>

 <li>src/knotificationmanager.cpp <span style="color: grey">(8d4f953)</span></li>

 <li>src/knotificationplugin.cpp <span style="color: grey">(7315c17)</span></li>

 <li>src/notifybypopup.cpp <span style="color: grey">(e377051)</span></li>

 <li>tests/kpassivepopuptest.h <span style="color: grey">(bc0dedc)</span></li>

 <li>tests/kpassivepopuptest.cpp <span style="color: grey">(2486fd8)</span></li>

</ul>

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






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







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