<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" content="1" /><style type="text/css">p, li { white-space: pre-wrap; }</style></head><body style=" font-family:'Arial'; font-size:11pt; font-weight:400; font-style:normal;">ignore the previous message. <br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p><p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p><p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>On Monday 23 February 2009 22:01:06 Toussis Manolis wrote:<br>
&gt; I re-implementing in my applet the configAccepted() to store the<br>
&gt; settings...<br>
&gt;<br>
&gt; The thing is that I came across a strange issue.<br>
&gt; I run the applet if I invoke the config interface, and press ok...<br>
&gt; configAccepted is called once. Then I close the applet , and configAccepted<br>
&gt; is called once more. All the options are saved fine.<br>
&gt;<br>
&gt; If I run the applet and don't invoke the config interface, and the close<br>
&gt; the applet. configAccepted() is called only on applet close, and all the<br>
&gt; settings are reset, and are not saved with the current settings.<br>
&gt;<br>
&gt; Any help?<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Here is the code:<br>
&gt;<br>
&gt; void PlasmaTvGr::configAccepted()<br>
&gt; {<br>
&gt;   kDebug()&lt;&lt;"run";<br>
&gt;   if(m_dialog)<br>
&gt;   {<br>
&gt;   switch(ui.loopBox-&gt;currentIndex()){<br>
&gt;   case 0:<br>
&gt;     m_loop=0;break;<br>
&gt;   case 1:<br>
&gt;     m_loop=15;break;<br>
&gt;   case 2:<br>
&gt;     m_loop=30;break;<br>
&gt;   case 3:<br>
&gt;     m_loop=60;break;<br>
&gt;   case 4:<br>
&gt;     m_loop=600;break;<br>
&gt;   case 5:<br>
&gt;     m_loop=1800;break;<br>
&gt;   default:<br>
&gt;     m_loop=0;<br>
&gt;   };<br>
&gt;   m_fontSize=ui.fontBox-&gt;currentText().toInt();<br>
&gt;   };<br>
&gt;   m_chanList="";<br>
&gt;   QListWidgetItem* item;<br>
&gt;   int w1,w2;<br>
&gt;   int shownOne=0;<br>
&gt;   for(w1=0;w1&lt;ui.list1-&gt;count();w1++)<br>
&gt;   {<br>
&gt;     item=ui.list1-&gt;item(w1);<br>
&gt;     w2=item-&gt;isSelected();<br>
&gt;     if(w2==1) shownOne=1;<br>
&gt;     m_chanList.append(QString::number(w2)+",");<br>
&gt;   };<br>
&gt;   m_chanList.chop(1);<br>
&gt;   if(shownOne==0) m_chanList[0]='1';<br>
&gt;   KConfigGroup cg = config();<br>
&gt;   cg.writeEntry("LoopSeconds", m_loop);<br>
&gt;   cg.writeEntry("SelectedChannel", m_channelID);<br>
&gt;   cg.writeEntry("FontSize",m_fontSize);<br>
&gt;   cg.writeEntry("ChannelList",m_chanList);<br>
&gt;   m_channel=chan[m_channelID];<br>
&gt;   if(m_loop!=0) m_loopTimer-&gt;start(m_loop*1000); else m_loopTimer-&gt;stop();<br>
&gt;   calculateSizes();<br>
&gt;   //updateGeometry();<br>
&gt;   m_pixmapUpdate=1;<br>
&gt;   update();<br>
&gt;   emit configNeedsSaving();<br>
&gt; };<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p><p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p></body></html>