[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: Review Request 113205: Make KJob::result public for the new signal/slot syntax.
From: "David Faure" <faure () kde ! org>
Date: 2013-10-12 16:50:12
Message-ID: 20131012165012.6534.13423 () vidsolbach ! de
[Download RAW message or body]
On Oct. 11, 2013, 9:51 p.m., Mark Gaiser wrote:
> > We are here making a 'hole' for people to do 'bad things' that wasn't possible \
> > in the past. I'm not sure we want that.
>
> Mark Gaiser wrote:
> Interesting.
> So that mean we simply can't use the new signal/slot syntax because of it? That \
> would seem rather strange to me..
> If you do a stat call, or listEntry or <any of the others>...
> Then you are supposed to connect to the result slot. For listEntry you are supposed \
> to connect to the finished signal. Both of those are defined as: signals:
> private:
>
> AKA. Private signals.
> I really don't see how you can work around this besides perhaps QSignalMapper, but \
> that would be very odd as well. I'm really curious to see how that "bit of magic" \
> is supposed to work. Do you have some links for me there?
> Sune Vuorela wrote:
> I'm not saying we can't use the new syntax because of it. I'm saying it needs a bit \
> more work, and before a 'stable' version is needed.
> There is a solution out there. It's applied to QAIM and others.
>
> Mark Gaiser wrote:
> Oke, i followed the hints and now know what you mean. The question now becomes: do \
> we want this? Preventing this hole and supporting the new signal/slot syntax is \
> possible.
> This does change the header and all places where this signal is currently being \
> called. The header would look like (with the signal moved to the public part): void \
> result(KJob *job #if !defined(qdoc)
> , QPrivateSignal
> #endif
> );
>
> To source files where this signal is emitted would change to:
> result(job, QPrivateSignal());
>
> Do we want this?
Yes. I quote: "This is a private signal, it can't be emitted directly by subclasses \
of KJob, use emitResult() instead."
So only kjob.cpp will have to be updated.
The #if should be
#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
though.
- David
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/113205/#review41570
-----------------------------------------------------------
On Oct. 12, 2013, 2:08 p.m., Mark Gaiser wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/113205/
> -----------------------------------------------------------
>
> (Updated Oct. 12, 2013, 2:08 p.m.)
>
>
> Review request for KDE Frameworks, kdelibs, David Faure, and Kevin Ottens.
>
>
> Repository: kdelibs
>
>
> Description
> -------
>
> The new signal/slot connection:
> connect(job, &KJob::result,...
>
> does't like result to be private and throws an compile error:
> error: 'void KJob::result(KJob*)' is private
>
> Making it public resolves the issue and makes this slot usable in the new syntax. \
> In my case i wanted to use the new syntax and directly use a lambda as slot. Which \
> isn't possible on this signal if it isn't public.
>
> Diffs
> -----
>
> tier1/kcoreaddons/src/lib/jobs/kjob.h d663530
>
> Diff: http://git.reviewboard.kde.org/r/113205/diff/
>
>
> Testing
> -------
>
> Works just fine.
>
>
> Thanks,
>
> Mark Gaiser
>
>
[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://git.reviewboard.kde.org/r/113205/">http://git.reviewboard.kde.org/r/113205/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <p style="margin-top: 0;">On October 11th, 2013, 9:51 p.m. UTC, <b>Sune \
Vuorela</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;">We are here making a 'hole' for people to do 'bad \
things' that wasn't possible in the past. I'm not sure we want \
that.</pre> </blockquote>
<p>On October 11th, 2013, 10:06 p.m. UTC, <b>Mark Gaiser</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;">Interesting. So that \
mean we simply can't use the new signal/slot syntax because of it? That would \
seem rather strange to me..
If you do a stat call, or listEntry or <any of the others>...
Then you are supposed to connect to the result slot. For listEntry you are supposed \
to connect to the finished signal. Both of those are defined as: signals:
private:
AKA. Private signals.
I really don't see how you can work around this besides perhaps QSignalMapper, \
but that would be very odd as well. I'm really curious to see how that "bit \
of magic" is supposed to work. Do you have some links for me there?</pre> \
</blockquote>
<p>On October 11th, 2013, 10:23 p.m. UTC, <b>Sune Vuorela</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;">I'm not saying we \
can't use the new syntax because of it. I'm saying it needs a bit more work, \
and before a 'stable' version is needed.
There is a solution out there. It's applied to QAIM and others.</pre>
</blockquote>
<p>On October 12th, 2013, 2:08 p.m. UTC, <b>Mark Gaiser</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;">Oke, i followed the \
hints and now know what you mean. The question now becomes: do we want this? \
Preventing this hole and supporting the new signal/slot syntax is possible.
This does change the header and all places where this signal is currently being \
called. The header would look like (with the signal moved to the public part): void \
result(KJob *job #if !defined(qdoc)
, QPrivateSignal
#endif
);
To source files where this signal is emitted would change to:
result(job, QPrivateSignal());
Do we want this?</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;">Yes. I quote: "This \
is a private signal, it can't be emitted directly by subclasses of KJob, use \
emitResult() instead."
So only kjob.cpp will have to be updated.
The #if should be
#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
though.</pre>
<br />
<p>- David</p>
<br />
<p>On October 12th, 2013, 2:08 p.m. UTC, Mark Gaiser wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://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 Frameworks, kdelibs, David Faure, and Kevin Ottens.</div>
<div>By Mark Gaiser.</div>
<p style="color: grey;"><i>Updated Oct. 12, 2013, 2:08 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
kdelibs
</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;">The new signal/slot connection: connect(job, &KJob::result,...
does't like result to be private and throws an compile error:
error: 'void KJob::result(KJob*)' is private
Making it public resolves the issue and makes this slot usable in the new syntax. In \
my case i wanted to use the new syntax and directly use a lambda as slot. Which \
isn't possible on this signal if it isn't public.</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;">Works just fine.</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>tier1/kcoreaddons/src/lib/jobs/kjob.h <span style="color: \
grey">(d663530)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/113205/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