This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Plasmoid on JavaScript and autorefresh

Tags: None
(comma "," separated)
Shura0
Registered Member
Posts
3
Karma
0
OS
Hello!

I have faced with a strange problem, IOJob retrieve data only once. My code is:


Code: Select all
inLabel = new Label();
var timer= new QTimer();
var job=0;
var t=0;
var fileContent="";

function onData(job, data){
   if(data.length > 0){
      var content = new String(data.valueOf());
      fileContent += content;
   }
}

function onFinished(job) {
  inLabel.text=fileContent;
}

plasmoid.sizeChanged=function()
{
   plasmoid.update();
}

timer.timeout.connect(getData);
timer.singleShot=false;
getData();
timer.start(10000);

function getData()
{
   fileContent="";
   job = plasmoid.getUrl("http://192.168.0.10/script.cgi");
   job.data.connect(onData);
   job.finished.connect(onFinished);
   print("getData");
}


Evrithing seems OK, I get in console:
getData
getData
getData
and so on..
I suppose timer works well.

But If I run sniffer, then I see the plasmoid get data only once, when it started and then does not try to get data again. Is there some kind of caching? How to disable caching and get data every 10 seconds?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
As this question regards the behaviour of Plasma when running applets, I will recommend sending a email to plasma-devel@kde.org - the mailing list for Plasma development.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]