Now the systrayicon change it's color when a download is in progress. I simply change...
[kdenetwork.git] / ksirc / ioLAG.cpp
blob50f3f082e5dcc2df0a45d4007bfd7f166b2acde9
1 /**********************************************************************
3 The IO LAG Controller
5 $$Id$$
7 **********************************************************************/
9 #include "ioLAG.h"
10 #include "control_message.h"
11 #include "ksircprocess.h"
13 #include <kdebug.h>
15 KSircIOLAG::KSircIOLAG(KSircProcess *_proc)
16 : QObject(),
17 KSircMessageReceiver(_proc)
19 proc = _proc;
20 setBroadcast(FALSE);
21 startTimer(30000);
22 // startTimer(5000);
23 //(proc->getWindowList())["!all"]->control_message(SET_LAG, "99");
27 KSircIOLAG::~KSircIOLAG()
29 killTimers();
32 void KSircIOLAG::sirc_receive(QCString str, bool)
35 if(str.contains("*L*")){
36 int s1, s2;
37 s1 = str.find("*L* ") + 4;
38 s2 = str.length();
39 if(s1 < 0 || s2 < 0){
40 kdDebug(5008) << "Lag mesage broken: " << str << endl;
41 return;
43 QString lag = str.mid(s1, s2 - s1);
44 // cerr << "Lag: " << str << endl;
45 // cerr << "Setting lag to: " << lag << endl;
46 (proc->getWindowList())["!all"]->control_message(SET_LAG, lag);
51 void KSircIOLAG::control_message(int, QString)
55 void KSircIOLAG::timerEvent ( QTimerEvent * )
57 QCString cmd = "/lag\n";
58 emit outputLine(cmd);
61 #include "ioLAG.moc"