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

List:       kde-panel-devel
Subject:    Re: [PATCH] RunnerManager
From:       "Jordi Polo" <mumismo () gmail ! com>
Date:       2008-05-01 8:56:02
Message-ID: a4162420805010156n1b9eef69q63b02386104fa03a () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Done, I've tried to solve the last issues of this mail and already commit
it.
It will be much easier work with it in SVN.

Yes, detach on reset, now I hope it is OK (If I believed in deities will
pray or something)
I also used setIgnoredTypes in some runners, didn't finish with all of them
as I have to go right now. I was very conservative (didn't add it to the
services runner even when I think some IgnoreTypes will apply), I hope not
break things.




2008/5/1 Aaron J. Seigo <aseigo@kde.org>:

> On Tuesday 29 April 2008, Jordi Polo wrote:
> > > ignoredType is wrong. it should be:
> > >
> > > SearchContext::Types ignoredTypes() const
> > >
> > > using the flags (e.g. ignoredTypes & type) would done on the
> consumer's
> > > end
> > > (e.g. in RunnerManager)
> >
> > Done
> >
> > > the Private copy ctor shouldn't copy the matches (it used only on
> detach,
> > > right? so we don't want the matches). this makes the call to
> > > removeAllMatches
> > > unecessary in reset(). that's the whole point of this approach: avoid
> > > copying, deleting, etc.
> >
> > Ok, the ctor should initialize all to empty objects as it is only called
> in
> > reset. I'll change that. See my next commentary.
> >
> > > +    if (this !=d->q) {
> > > +    //FIXME: this line must be uncommented.
> > > +        d.detach();
> > > +    }
> > >
> > > that looks completely backwards to me. it also looks completely
> > > unecessary.
> > > whenever reset is called it should detach. in practice, reset will
> only
> > > be called on the real context object, and that one should detach...
> > > again, this
> > > all about preventing copies and deletions.
> >
> > Detaching always is ok.
>
> not sure exactly what you mean by "always"; what i'm suggesting is to
> always
> detach when reset is called because reset is only called from the query
> source (e.g. the krunner UI). never detach otherwise. voila.
>
> > Detaching will create a new empty object, so we
> > don't need the rest of the method when we have indeed detached (we still
> > need to clean our state if we don't detach).
>
> the semantics of "detach()" are actually to create a copy of the
> underlying
> object. detach is COW, where the 'c' stands for copy. it should not create
> an
> empty object. in our case, we only want to create the following items new:
>
>  * the mutex for locking (can't be copied)
>  * the match list (since in this case, writing applies to the state of the
> SearchContext, making the matches obsolete)
>
> everything else should be copied in detach().
>
> > But detach() will only effectively detach if other object references the
> > data,  as detach() returns void, we can not know if in fact detached.  I
> am
>
> that's because detach always detaches. there is no "couldn't detach".
>
> > > the rest looks ok ... work needed in places still, but close enough
> ...
> > > i'm
> > > tempted to say "commit it, and then i'll polish it up"
> >
> > Puff, at last we got close, after the detach issue is solved I'll
> comment
> > kDebug() and commit.
>
> cool.
>
> --
> Aaron J. Seigo
> humru othro a kohnu se
> GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43
>
> KDE core developer sponsored by Trolltech
>
> _______________________________________________
> Panel-devel mailing list
> Panel-devel@kde.org
> https://mail.kde.org/mailman/listinfo/panel-devel
>
>


-- 
Jordi Polo Carres
NLP laboratory - NAIST
http://www.bahasara.org

[Attachment #5 (text/html)]

<br>Done, I&#39;ve tried to solve the last issues of this mail and already commit it. \
<br>It will be much easier work with it in SVN.<br><br>Yes, detach on reset, now I \
hope it is OK (If I believed in deities will pray or something)<br> I also used \
setIgnoredTypes in some runners, didn&#39;t finish with all of them as I have to go \
right now. I was very conservative (didn&#39;t add it to the services runner even \
when I think some IgnoreTypes will apply), I hope not break things. <br> \
<br><br><br><br><div class="gmail_quote">2008/5/1 Aaron J. Seigo &lt;<a \
href="mailto:aseigo@kde.org">aseigo@kde.org</a>&gt;:<br><blockquote \
class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt \
0pt 0.8ex; padding-left: 1ex;"> <div class="Ih2E3d">On Tuesday 29 April 2008, Jordi \
Polo wrote:<br> </div><div class="Ih2E3d">&gt; &gt; ignoredType is wrong. it should \
be:<br> &gt; &gt;<br>
&gt; &gt; SearchContext::Types ignoredTypes() const<br>
&gt; &gt;<br>
&gt; &gt; using the flags (e.g. ignoredTypes &amp; type) would done on the \
consumer&#39;s<br> &gt; &gt; end<br>
&gt; &gt; (e.g. in RunnerManager)<br>
&gt;<br>
&gt; Done<br>
&gt;<br>
&gt; &gt; the Private copy ctor shouldn&#39;t copy the matches (it used only on \
detach,<br> &gt; &gt; right? so we don&#39;t want the matches). this makes the call \
to<br> &gt; &gt; removeAllMatches<br>
&gt; &gt; unecessary in reset(). that&#39;s the whole point of this approach: \
avoid<br> &gt; &gt; copying, deleting, etc.<br>
&gt;<br>
&gt; Ok, the ctor should initialize all to empty objects as it is only called in<br>
&gt; reset. I&#39;ll change that. See my next commentary.<br>
&gt;<br>
&gt; &gt; + &nbsp; &nbsp;if (this !=d-&gt;q) {<br>
&gt; &gt; + &nbsp; &nbsp;//FIXME: this line must be uncommented.<br>
&gt; &gt; + &nbsp; &nbsp; &nbsp; &nbsp;d.detach();<br>
&gt; &gt; + &nbsp; &nbsp;}<br>
&gt; &gt;<br>
&gt; &gt; that looks completely backwards to me. it also looks completely<br>
&gt; &gt; unecessary.<br>
&gt; &gt; whenever reset is called it should detach. in practice, reset will only<br>
&gt; &gt; be called on the real context object, and that one should detach...<br>
&gt; &gt; again, this<br>
&gt; &gt; all about preventing copies and deletions.<br>
&gt;<br>
&gt; Detaching always is ok.<br>
<br>
</div>not sure exactly what you mean by &quot;always&quot;; what i&#39;m suggesting \
is to always<br> detach when reset is called because reset is only called from the \
query<br> source (e.g. the krunner UI). never detach otherwise. voila.<br>
<div class="Ih2E3d"><br>
&gt; Detaching will create a new empty object, so we<br>
&gt; don&#39;t need the rest of the method when we have indeed detached (we still<br>
&gt; need to clean our state if we don&#39;t detach).<br>
<br>
</div>the semantics of &quot;detach()&quot; are actually to create a copy of the \
underlying<br> object. detach is COW, where the &#39;c&#39; stands for copy. it \
should not create an<br> empty object. in our case, we only want to create the \
following items new:<br> <br>
&nbsp;* the mutex for locking (can&#39;t be copied)<br>
&nbsp;* the match list (since in this case, writing applies to the state of the<br>
SearchContext, making the matches obsolete)<br>
<br>
everything else should be copied in detach().<br>
<div class="Ih2E3d"><br>
&gt; But detach() will only effectively detach if other object references the<br>
&gt; data, &nbsp;as detach() returns void, we can not know if in fact detached. \
&nbsp;I am<br> <br>
</div>that&#39;s because detach always detaches. there is no &quot;couldn&#39;t \
detach&quot;.<br> <div class="Ih2E3d"><br>
&gt; &gt; the rest looks ok ... work needed in places still, but close enough ...<br>
&gt; &gt; i&#39;m<br>
&gt; &gt; tempted to say &quot;commit it, and then i&#39;ll polish it up&quot;<br>
&gt;<br>
&gt; Puff, at last we got close, after the detach issue is solved I&#39;ll \
comment<br> &gt; kDebug() and commit.<br>
<br>
</div>cool.<br>
<div><div></div><div class="Wj3C7c"><br>
--<br>
Aaron J. Seigo<br>
humru othro a kohnu se<br>
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA &nbsp;EE75 D6B7 2EB1 A7F1 DB43<br>
<br>
KDE core developer sponsored by Trolltech<br>
</div></div><br>_______________________________________________<br>
Panel-devel mailing list<br>
<a href="mailto:Panel-devel@kde.org">Panel-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/panel-devel" \
target="_blank">https://mail.kde.org/mailman/listinfo/panel-devel</a><br> \
<br></blockquote></div><br><br clear="all"><br>-- <br>Jordi Polo Carres<br>NLP \
laboratory - NAIST<br><a \
href="http://www.bahasara.org">http://www.bahasara.org</a><br>



_______________________________________________
Panel-devel mailing list
Panel-devel@kde.org
https://mail.kde.org/mailman/listinfo/panel-devel


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

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