[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Review Request: Adding "net usershare" suport for KSambaShare
From:       Aurélien Gâteau <agateau () kde ! org>
Date:       2010-10-01 8:04:17
Message-ID: 20101001080417.20822.18042 () vidsolbach ! de
[Download RAW message or body]

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/4320/#review7916
-----------------------------------------------------------


Regarding my previous comment about how you tested it: I realized KSambaSha=
re is already used by kdenetwork/kfilesharing, so I assume you tested this =
way. Still, a command-line client or even better unit tests would be a nice=
 addition.


/trunk/KDE/kdelibs/kio/kio/ksambashare.cpp
<http://svn.reviewboard.kde.org/r/4320/#comment8166>

    Please output stdErr in the warning until error handling is in place.



/trunk/KDE/kdelibs/kio/kio/ksambashare.cpp
<http://svn.reviewboard.kde.org/r/4320/#comment8167>

    Output stderr as well.



/trunk/KDE/kdelibs/kio/kio/ksambashare.cpp
<http://svn.reviewboard.kde.org/r/4320/#comment8168>

    Outputting the name of the key here could be helpful.



/trunk/KDE/kdelibs/kio/kio/ksambashare.cpp
<http://svn.reviewboard.kde.org/r/4320/#comment8165>

    Nitpick: you can simplify this with:
    delete data.take(name); (avoids going through the hash twice)



/trunk/KDE/kdelibs/kio/kio/ksambashare.h
<http://svn.reviewboard.kde.org/r/4320/#comment8169>

    Should be named getShare*s*ByPath() since it returns a list of shares.



/trunk/KDE/kdelibs/kio/kio/ksambashare.h
<http://svn.reviewboard.kde.org/r/4320/#comment8171>

    See my comment in KSambaShare::instance(). Unless there is a good reaso=
n for this static to be there, it should go away (private static variables =
are of no use to class users anyway).



/trunk/KDE/kdelibs/kio/kio/ksambashare.cpp
<http://svn.reviewboard.kde.org/r/4320/#comment8170>

    K_GLOBAL_STATIC is prefered over instantiating the singleton by hand. I=
s there a good reason for getting rid of it?


- Aur=C3=A9lien


On 2010-09-30 02:01:48, Rodrigo Belem wrote:
> =

> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/4320/
> -----------------------------------------------------------
> =

> (Updated 2010-09-30 02:01:48)
> =

> =

> Review request for kdelibs, Raphael Kubo da Costa, Jonathan Thomas, Aur=
=C3=A9lien G=C3=A2teau, Jonathan Riddell, Adenilson Cavalcanti, and loureir=
o.
> =

> =

> Summary
> -------
> =

> KDE needs to support modern samba tools. With the "net usershare" command=
 line tool the users can manage their shares. The attached patch intends to=
 add support for this tool.
> =

> =

> Diffs
> -----
> =

>   /trunk/KDE/kdelibs/kio/kio/ksambashare_p.h PRE-CREATION =

>   /trunk/KDE/kdelibs/kio/kio/ksambasharedata.h PRE-CREATION =

>   /trunk/KDE/kdelibs/kio/kio/ksambasharedata.cpp PRE-CREATION =

>   /trunk/KDE/kdelibs/kio/kio/ksambasharedata_p.h PRE-CREATION =

>   /trunk/KDE/kdelibs/kio/CMakeLists.txt 1180108 =

>   /trunk/KDE/kdelibs/kio/kio/ksambashare.h 1180108 =

>   /trunk/KDE/kdelibs/kio/kio/ksambashare.cpp 1180108 =

> =

> Diff: http://svn.reviewboard.kde.org/r/4320/diff
> =

> =

> Testing
> -------
> =

> =

> Thanks,
> =

> Rodrigo
> =

>


[Attachment #3 (text/html)]

<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://svn.reviewboard.kde.org/r/4320/">http://svn.reviewboard.kde.org/r/4320/</a>
  </td>
    </tr>
   </table>
   <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;">Regarding my previous \
comment about how you tested it: I realized KSambaShare is already used by \
kdenetwork/kfilesharing, so I assume you tested this way. Still, a command-line \
client or even better unit tests would be a nice addition.</pre>  <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="/r/4320/diff/8-10/?file=31945#file31945line139" style="color: black; \
font-weight: bold; text-decoration: \
underline;">/trunk/KDE/kdelibs/kio/kio/ksambashare.cpp</a>  <span style="font-weight: \
normal;">

     (Diff revisions 8 - 10)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; \
">QString KSambaSharePrivate::testParmParamValue(const QString&amp; parameterName) \
const</pre></td>  <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; \
margin: 0; ">QString KSambaSharePrivate::testparmParamValue(const QString \
&amp;parameterName)</pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">139</font></th>  <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="n">k<span \
class="hl">Debu</span>g</span><span class="p">()</span> <span \
class="o">&lt;&lt;</span> <span class="s">&quot;We got some errors&quot;</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">128</font></th>  <td bgcolor="#fdfebc" width="50%"><pre style="font-size: \
8pt; line-height: 140%; margin: 0; ">        <span class="n">k<span \
class="hl">Warnin</span>g</span><span class="p">()</span> <span \
class="o">&lt;&lt;</span> <span class="s">&quot;We got some errors&quot;</span><span \
class="p">;</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Please \
output stdErr in the warning until error handling is in place.</pre> </div>
<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="/r/4320/diff/8-10/?file=31945#file31945line161" style="color: black; \
font-weight: bold; text-decoration: \
underline;">/trunk/KDE/kdelibs/kio/kio/ksambashare.cpp</a>  <span style="font-weight: \
normal;">

     (Diff revisions 8 - 10)

    </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; \
">QByteArray KSambaSharePrivate::getNetUserShareInfo() const</pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">161</font></th>  <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="n">k<span \
class="hl">Debu</span>g</span><span class="p">()</span> <span \
class="o">&lt;&lt;</span> <span class="s">&quot;We got some errors&quot;</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">150</font></th>  <td bgcolor="#fdfebc" width="50%"><pre style="font-size: \
8pt; line-height: 140%; margin: 0; ">        <span class="n">k<span \
class="hl">Warnin</span>g</span><span class="p">()</span> <span \
class="o">&lt;&lt;</span> <span class="s">&quot;We got some errors&quot;</span><span \
class="p">;</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Output \
stderr as well.</pre> </div>
<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="/r/4320/diff/8-10/?file=31945#file31945line338" style="color: black; \
font-weight: bold; text-decoration: \
underline;">/trunk/KDE/kdelibs/kio/kio/ksambashare.cpp</a>  <span style="font-weight: \
normal;">

     (Diff revisions 8 - 10)

    </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; ">bool \
KSambaSharePrivate::sync()</pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">322</font></th>  <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">                <span \
class="n">k<span class="hl">Debu</span>g</span><span class="p">()</span> <span \
class="o">&lt;&lt;</span> <span class="s">&quot;something wrong!&quot;</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">273</font></th>  <td bgcolor="#fdfebc" width="50%"><pre style="font-size: \
8pt; line-height: 140%; margin: 0; ">                <span class="n">k<span \
class="hl">Warnin</span>g</span><span class="p">()</span> <span \
class="o">&lt;&lt;</span> <span class="s">&quot;something wrong!&quot;</span><span \
class="p">;</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Outputting \
the name of the key here could be helpful.</pre> </div>
<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="/r/4320/diff/8-10/?file=31945#file31945line348" style="color: black; \
font-weight: bold; text-decoration: \
underline;">/trunk/KDE/kdelibs/kio/kio/ksambashare.cpp</a>  <span style="font-weight: \
normal;">

     (Diff revisions 8 - 10)

    </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; ">bool \
KSambaSharePrivate::sync()</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">283</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            \
<span class="k">delete</span> <span class="n">data</span><span \
class="p">.</span><span class="n">value</span><span class="p">(</span><span \
class="n">name</span><span class="p">);</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Nitpick: \
you can simplify this with: delete data.take(name); (avoids going through the hash \
twice)</pre> </div>
<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="/r/4320/diff/10/?file=38730#file38730line79" style="color: black; font-weight: \
bold; text-decoration: underline;">/trunk/KDE/kdelibs/kio/kio/ksambashare.h</a>  \
<span style="font-weight: normal;">

     (Diff revision 10)

    </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; \
"></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">77</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span \
class="n">QList</span><span class="o">&lt;</span><span \
class="n">KSambaShareData</span> <span class="o">*&gt;</span> <span \
class="n">getShareByPath</span><span class="p">(</span><span class="k">const</span> \
<span class="n">QString</span> <span class="o">&amp;</span><span \
class="n">path</span><span class="p">)</span> <span class="k">const</span><span \
class="p">;</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Should be \
named getShare*s*ByPath() since it returns a list of shares.</pre> </div>
<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="/r/4320/diff/10/?file=38730#file38730line103" style="color: black; font-weight: \
bold; text-decoration: underline;">/trunk/KDE/kdelibs/kio/kio/ksambashare.h</a>  \
<span style="font-weight: normal;">

     (Diff revision 10)

    </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; \
"></pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">77</font></th>  <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">  <span \
class="n">KSambaSharePrivate</span> <span class="o">*</span> <span \
class="k">const</span> <span class="n">d</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">101</font></th>  <td bgcolor="#fdfebc" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span \
class="k">static</span> <span class="n">KSambaShare</span> <span \
class="o">*</span><span class="n">_instance</span><span class="p">;</span></pre></td> \
</tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">See my \
comment in KSambaShare::instance(). Unless there is a good reason for this static to \
be there, it should go away (private static variables are of no use to class users \
anyway).</pre> </div>
<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="/r/4320/diff/10/?file=38731#file38731line400" style="color: black; font-weight: \
bold; text-decoration: underline;">/trunk/KDE/kdelibs/kio/kio/ksambashare.cpp</a>  \
<span style="font-weight: normal;">

     (Diff revision 10)

    </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; \
"></pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">250</font></th>  <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">  <span \
class="n">K_GLOBAL_STATIC</span><span class="p">(</span><span \
class="n">KSambaShare</span><span class="p">,</span> <span \
class="n">_instance</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">353</font></th>  <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="k">if</span> \
<span class="p">(</span><span class="n">_instance</span> <span class="o">==</span> \
<span class="mi">0</span><span class="p">)</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">K_GLOBAL_STATIC is prefered over instantiating the singleton by hand. Is \
there a good reason for getting rid of it?</pre> </div>
<br />



<p>- Aurélien</p>


<br />
<p>On September 30th, 2010, 2:01 a.m., Rodrigo Belem wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://svn.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 kdelibs, Raphael Kubo da Costa, Jonathan Thomas, Aurélien \
Gâteau, Jonathan Riddell, Adenilson Cavalcanti, and loureiro.</div> <div>By Rodrigo \
Belem.</div>


<p style="color: grey;"><i>Updated 2010-09-30 02:01:48</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;">KDE needs to support modern samba tools. With the &quot;net \
usershare&quot; command line tool the users can manage their shares. The attached \
patch intends to add support for this tool.</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/kdelibs/kio/kio/ksambashare_p.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdelibs/kio/kio/ksambasharedata.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdelibs/kio/kio/ksambasharedata.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdelibs/kio/kio/ksambasharedata_p.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>/trunk/KDE/kdelibs/kio/CMakeLists.txt <span style="color: \
grey">(1180108)</span></li>

 <li>/trunk/KDE/kdelibs/kio/kio/ksambashare.h <span style="color: \
grey">(1180108)</span></li>

 <li>/trunk/KDE/kdelibs/kio/kio/ksambashare.cpp <span style="color: \
grey">(1180108)</span></li>

</ul>

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




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








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



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic