[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: Review Request 114737: KInfocenter/OpenGL: reimplement the ReadPipe() function with QProcess
From: "Rolf Eike Beer" <kde () opensource ! sf-tec ! de>
Date: 2014-01-04 12:55:08
Message-ID: 20140104125508.11858.71511 () probe ! kde ! org
[Download RAW message or body]
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/114737/#review46765
-----------------------------------------------------------
kinfocenter/Modules/opengl/opengl.cpp
<https://git.reviewboard.kde.org/r/114737/#comment33389>
This allocates a new object on the heap that is never freed. Just use "QProcess pipe;"
- Rolf Eike Beer
On Jan. 4, 2014, 9 a.m., Wolfgang Bauer wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/114737/
> -----------------------------------------------------------
>
> (Updated Jan. 4, 2014, 9 a.m.)
>
>
> Review request for kde-workspace and David Stephen Hubner.
>
>
> Repository: kde-workspace
>
>
> Description
> -------
>
> This patch reimplements the ReadPipe() function by using QProcess instead of popen().
> This should make it more portable.
>
> As a positive side-effect, this also removes those "sh: lspci: command not found." messages when run in \
> Konsole and lspci is not in the user's path.
> This was suggested on the kde-core-devel mailinglist in November:
> http://lists.kde.org/?l=kde-core-devel&m=138407113011843&w=2
> http://lists.kde.org/?l=kde-core-devel&m=138409755820003&w=2
>
>
> Diffs
> -----
>
> kinfocenter/Modules/opengl/opengl.cpp 8901957
>
> Diff: https://git.reviewboard.kde.org/r/114737/diff/
>
>
> Testing
> -------
>
> Ran KInfocenter with lspci in /usr/bin/ (i.e. in the user's path) and /sbin/ (not in the user's path). \
> The OpenGL module showed the 3D accelerator info correctly in both cases. With lspci removed completely \
> it showed "unknown" as expected.
>
> Thanks,
>
> Wolfgang Bauer
>
>
[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="https://git.reviewboard.kde.org/r/114737/">https://git.reviewboard.kde.org/r/114737/</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/114737/diff/1/?file=227934#file227934line157" style="color: \
black; font-weight: bold; text-decoration: underline;">kinfocenter/Modules/opengl/opengl.cpp</a> <span \
style="font-weight: normal;">
(Diff revision 1)
</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; ">static struct {</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font \
size="2">156</font></th> <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: \
140%; margin: 0; "> <span class="kt">FILE</span> <span class="o">*</span><span \
class="n">pipe</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">157</font></th> <td \
bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="n">QProcess</span> <span class="o">*</span><span class="n">pipe</span> <span class="o">=</span> \
<span class="k">new</span> <span class="n">QProcess</span><span class="p">();</span></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">158</font></th> <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="n">pipe</span><span \
class="o">-></span><span class="n">start</span><span class="p">(</span><span \
class="n">FileName</span><span class="p">,</span> <span class="n">QIODevice</span><span \
class="o">::</span><span class="n">ReadOnly</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;">This allocates a new object on the heap that is never \
freed. Just use "QProcess pipe;"</pre> </div>
<br />
<p>- Rolf Eike Beer</p>
<br />
<p>On January 4th, 2014, 9 a.m. UTC, Wolfgang Bauer wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: \
url('https://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black solid;"> <tr>
<td>
<div>Review request for kde-workspace and David Stephen Hubner.</div>
<div>By Wolfgang Bauer.</div>
<p style="color: grey;"><i>Updated Jan. 4, 2014, 9 a.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
kde-workspace
</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;">This patch reimplements the ReadPipe() \
function by using QProcess instead of popen(). This should make it more portable.
As a positive side-effect, this also removes those "sh: lspci: command not found." messages \
when run in Konsole and lspci is not in the user's path.
This was suggested on the kde-core-devel mailinglist in November:
http://lists.kde.org/?l=kde-core-devel&m=138407113011843&w=2
http://lists.kde.org/?l=kde-core-devel&m=138409755820003&w=2</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;">Ran KInfocenter with lspci in /usr/bin/ \
(i.e. in the user's path) and /sbin/ (not in the user's path). The OpenGL module showed the 3D \
accelerator info correctly in both cases. With lspci removed completely it showed "unknown" as \
expected.</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>kinfocenter/Modules/opengl/opengl.cpp <span style="color: grey">(8901957)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/114737/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