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

List:       kde-panel-devel
Subject:    Re: Help regarding the code
From:       sujith h <sujith.h () gmail ! com>
Date:       2010-09-15 2:59:29
Message-ID: AANLkTim3hdHgOrnDdGzGwWY7ZitOb1XzH7LGwss5Oujg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Wed, Sep 15, 2010 at 4:01 AM, Aaron J. Seigo <aseigo@kde.org> wrote:

>  On Tuesday, September 14, 2010, sujith h wrote:
>
> > Hi,
>
> >
>
> > I were trying to modify the frame applet in kdeplasma-addons.
>
> > I am having a small issue with the diff attached with the
> mail(frame.diff).
>
> > The backtrace is also attached with
>
> > the mail(backtrace.txt). My intention is to pass emit the a function in
>
> > slideshow.cppwhen the directory is empty
>
> > to load images and then use the connect in the picture.cpp to write some
>
> > message to the a QString variable.
>
> > In the mean while I am initializing an object of SlideShow class using:
>
> >
>
> > m_slideshow = new SlideShow(this);
>
> >
>
> > Should this cause a problem? Pardon me if am wrong.
>
> you have an infinite loop, and youc an see this in the backtrace how it
> alternates between two lines back and forth:
>
> in your patch in Picture::Picture(), there is this:
>
>  m_slideshow = new SlideShow(this);
>
> so Picture creates a SlideShow. but in SlideShow's constructor, there is
> this:
>
>  m_picture = new Picture(this);
>
> which means Picture creates a Slideshow, which creates a Picture, which
> creates a SlideShow, which creates a ....
>
> you should not create the SlideShow in Picture. instead, right after
> "m_picture = new Picture(this);" in SlideShow, put this line:
>
>  connect(this, SIGNAL(emptyDirMessage()), m_picture,
> SLOT(customizeEmptyMessage()));
>
> that should work much better :)
>
> on a side note, instead of this:
>
>  if( m_picturePaths.size() == 0) {
>
> you can just do:
>
>  if (m_picturePaths.isEmtpy()) {
>
> we find it more readable
>
> also, please be careful to follow the coding style (whitespace, etc) in the
> files you work on.. cheers :)
>

Thanks a lot Aaron. I would try my best to rectify my errors.

 --
>
> 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 Qt Development Frameworks
>
>
> _______________________________________________
> Plasma-devel mailing list
> Plasma-devel@kde.org
> https://mail.kde.org/mailman/listinfo/plasma-devel
>
>


-- 
സുജിത് ഹരിദാസന്
Bangalore
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info

[Attachment #5 (text/html)]

<br><br><div class="gmail_quote">On Wed, Sep 15, 2010 at 4:01 AM, Aaron J. Seigo \
<span dir="ltr">&lt;<a href="mailto:aseigo@kde.org">aseigo@kde.org</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; \
border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


<div style="font-family: &#39;Bitstream Vera Sans&#39;; font-size: 12pt; font-weight: \
400; font-style: normal;"><div class="im"> <p style="margin: 0px; text-indent: \
0px;">On Tuesday, September 14, 2010, sujith h wrote:</p> <p style="margin: 0px; \
text-indent: 0px;">&gt; Hi,</p> <p style="margin: 0px; text-indent: 0px;">&gt; </p>
<p style="margin: 0px; text-indent: 0px;">&gt; I were trying to modify the frame \
applet in kdeplasma-addons.</p> <p style="margin: 0px; text-indent: 0px;">&gt; I am \
having a small issue with the diff attached with the mail(frame.diff).</p> <p \
style="margin: 0px; text-indent: 0px;">&gt; The backtrace is also attached with</p> \
<p style="margin: 0px; text-indent: 0px;">&gt; the mail(backtrace.txt). My intention \
is to pass emit the a function in</p> <p style="margin: 0px; text-indent: 0px;">&gt; \
slideshow.cppwhen the directory is empty</p> <p style="margin: 0px; text-indent: \
0px;">&gt; to load images and then use the connect in the picture.cpp to write \
some</p> <p style="margin: 0px; text-indent: 0px;">&gt; message to the a QString \
variable.</p> <p style="margin: 0px; text-indent: 0px;">&gt; In the mean while I am \
initializing an object of SlideShow class using:</p> <p style="margin: 0px; \
text-indent: 0px;">&gt; </p> <p style="margin: 0px; text-indent: 0px;">&gt; \
m_slideshow = new SlideShow(this);</p> <p style="margin: 0px; text-indent: 0px;">&gt; \
</p> <p style="margin: 0px; text-indent: 0px;">&gt; Should this cause a problem? \
Pardon me if am wrong.</p> <p style="margin: 0px; text-indent: 0px;"></p>
</div><p style="margin: 0px; text-indent: 0px;">you have an infinite loop, and youc \
an see this in the backtrace how it alternates between two lines back and forth:</p> \
<p style="margin: 0px; text-indent: 0px;"></p> <p style="margin: 0px; text-indent: \
0px;">in your patch in Picture::Picture(), there is this:</p><div class="im"> <p \
style="margin: 0px; text-indent: 0px;"></p> <p style="margin: 0px; text-indent: \
0px;">	m_slideshow = new SlideShow(this);</p> <p style="margin: 0px; text-indent: \
0px;"></p> </div><p style="margin: 0px; text-indent: 0px;">so Picture creates a \
SlideShow. but in SlideShow&#39;s constructor, there is this:</p> <p style="margin: \
0px; text-indent: 0px;"></p> <p style="margin: 0px; text-indent: 0px;">	m_picture = \
new Picture(this);</p> <p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">which means Picture creates a Slideshow, \
which creates a Picture, which creates a SlideShow, which creates a ....</p> <p \
style="margin: 0px; text-indent: 0px;"></p> <p style="margin: 0px; text-indent: \
0px;">you should not create the SlideShow in Picture. instead, right after \
&quot;m_picture = new Picture(this);&quot; in SlideShow, put this line:</p> <p \
style="margin: 0px; text-indent: 0px;"></p> <p style="margin: 0px; text-indent: \
0px;">	connect(this, SIGNAL(emptyDirMessage()), m_picture, \
SLOT(customizeEmptyMessage()));</p> <p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">that should work much better :)</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">on a side note, instead of this:</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">   if( m_picturePaths.size() == 0) {</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">you can just do:</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">    if (m_picturePaths.isEmtpy()) {</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">we find it more readable</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">also, please be careful to follow the \
coding style (whitespace, etc) in the files you work on.. cheers \
:)</p></div></blockquote><div><br>Thanks a lot Aaron. I would try my best to rectify \
my errors.<br>

<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; \
border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div \
style="font-family: &#39;Bitstream Vera Sans&#39;; font-size: 12pt; font-weight: 400; \
font-style: normal;">


<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">-- </p>
<p style="margin: 0px; text-indent: 0px;">Aaron J. Seigo</p>
<p style="margin: 0px; text-indent: 0px;">humru othro a kohnu se</p>
<p style="margin: 0px; text-indent: 0px;">GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  \
EE75 D6B7 2EB1 A7F1 DB43</p> <p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">KDE core developer sponsored by Qt \
Development Frameworks</p> <p style="margin: 0px; text-indent: \
0px;"></p></div><br>_______________________________________________<br> Plasma-devel \
mailing list<br> <a href="mailto:Plasma-devel@kde.org">Plasma-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/plasma-devel" \
target="_blank">https://mail.kde.org/mailman/listinfo/plasma-devel</a><br> \
<br></blockquote></div><br><br clear="all"><br>-- <br>സുജിത് \
ഹരിദാസന്<br>Bangalore<br><a \
href="http://fci.wikia.com/wiki/Anti-DRM-Campaign">http://fci.wikia.com/wiki/Anti-DRM-Campaign</a><br>&lt;Blog&gt; \
<a href="http://sujithh.info">http://sujithh.info</a><br>

<br>



_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


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

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