Fix crash on logout
[kdenetwork.git] / ksirc / dccMgrTest.cpp
blobdc1a81b5d48d8cf145554d47ee617bb1a8d24d0f
1 #include <kapplication.h>
3 #include "dccManager.h"
4 //Added by qt3to4:
5 #include <QTimerEvent>
7 class Timer : public QObject
9 public:
10 Timer( dccManager *view )
11 : m_view( view )
13 m_it = m_view->newSendItem("test", "boren", dccItem::dccOffer, 123523);
14 m_view->newSendItem("test2", "boren", dccItem::dccOffer, 123523);
15 m_view->newSendItem("test3", "boren", dccItem::dccOffer, 123523);
16 m_view->newGetItem("test4", "boren", dccItem::dccOffer, 123523);
17 m_view->newGetItem("test4", "boren", dccItem::dccOffer, 123523);
18 m_view->newGetItem("test4", "boren", dccItem::dccOffer, 123523);
19 bytes = 0;
20 startTimer( 100 );
22 void timerEvent( QTimerEvent * )
24 m_it->changeStatus(dccItem::dccSending);
25 bytes += 1000;
26 m_it->setReceivedBytes(bytes);
29 private:
30 dccManager *m_view;
31 int bytes;
32 dccItem *m_it;
36 int main(int argc, char **argv){
37 KApplication a(argc, argv, "dccMgrTest" );
39 dccManager kst(0, "toplevel");
40 Timer t(&kst);
42 a.setMainWidget(&kst);
43 kst.show();
44 return a.exec();