summaryrefslogtreecommitdiff
path: root/core/obex/obexsend.cpp
Unidiff
Diffstat (limited to 'core/obex/obexsend.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/obex/obexsend.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/core/obex/obexsend.cpp b/core/obex/obexsend.cpp
index a2e4c16..d5ebd81 100644
--- a/core/obex/obexsend.cpp
+++ b/core/obex/obexsend.cpp
@@ -32,11 +32,11 @@ void SendWidget::initUI() {
32 32
33 QCopChannel* chan = new QCopChannel("QPE/IrDaAppletBack", this ); 33 QCopChannel* chan = new QCopChannel("QPE/IrDaAppletBack", this );
34 connect(chan, SIGNAL(received(const QCString&, const QByteArray& ) ), 34 connect(chan, SIGNAL(received(const QCString&, const QByteArray& ) ),
35 this, SLOT(dispatchBt(const QCString&, const QByteArray& ) ) ); 35 this, SLOT(dispatchIrda(const QCString&, const QByteArray& ) ) );
36 36
37 chan = new QCopChannel("QPE/BluetoothBack", this ); 37 chan = new QCopChannel("QPE/BluetoothBack", this );
38 connect(chan, SIGNAL(received(const QCString&, const QByteArray& ) ), 38 connect(chan, SIGNAL(received(const QCString&, const QByteArray& ) ),
39 this, SLOT(dispatchIrda(const QCString&, const QByteArray& ) ) ); 39 this, SLOT(dispatchBt(const QCString&, const QByteArray& ) ) );
40 40
41 QVBoxLayout* lay = new QVBoxLayout(this); 41 QVBoxLayout* lay = new QVBoxLayout(this);
42 42
@@ -103,14 +103,15 @@ void SendWidget::send( const QString& file, const QString& desc ) {
103 QCopEnvelope e2("QPE/IrDaApplet", "listDevices()"); 103 QCopEnvelope e2("QPE/IrDaApplet", "listDevices()");
104 QCopEnvelope e3("QPE/Bluetooth", "listDevices()"); 104 QCopEnvelope e3("QPE/Bluetooth", "listDevices()");
105 } 105 }
106 QTimer::singleShot(5000, this, SLOT(testIt() ) );
107} 106}
108void SendWidget::slotIrDaDevices( const QStringList& list) { 107void SendWidget::slotIrDaDevices( const QStringList& list) {
108 qWarning("slot it irda devices ");
109 m_irDa = list; 109 m_irDa = list;
110 m_start = 0; 110 m_start = 0;
111 for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) 111 for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it )
112 m_devBox->addDevice( (*it), DeviceBox::IrDa, tr("Scheduling for beam.") ); 112 m_devBox->addDevice( (*it), DeviceBox::IrDa, tr("Scheduling for beam.") );
113 m_devBox->removeDevice( tr("Search for IrDa Devices.") ); 113
114 m_devBox->removeDevice( tr("Searching for IrDa Devices.") );
114 115
115 slotStartIrda(); 116 slotStartIrda();
116} 117}
@@ -126,12 +127,13 @@ void SendWidget::slotSelectedDevice( const QString& name, int dev ) {
126 if ( name == tr("Search again for IrDa.") ) { 127 if ( name == tr("Search again for IrDa.") ) {
127 for (QStringList::Iterator it= m_irDa.begin(); it != m_irDa.end(); ++it ) 128 for (QStringList::Iterator it= m_irDa.begin(); it != m_irDa.end(); ++it )
128 m_devBox->removeDevice( (*it) ); 129 m_devBox->removeDevice( (*it) );
130
129 QCopEnvelope e2("QPE/IrDaApplet", "listDevices()"); 131 QCopEnvelope e2("QPE/IrDaApplet", "listDevices()");
130 } 132 }
131} 133}
132void SendWidget::dispatchIrda( const QCString& str, const QByteArray& ar ) { 134void SendWidget::dispatchIrda( const QCString& str, const QByteArray& ar ) {
133 qWarning("dispatch irda %s", str.data() ); 135 qWarning("dispatch irda %s", str.data() );
134 if ( str == "listDevices(QStringList)" ) { 136 if ( str == "devices(QStringList)" ) {
135 QDataStream stream( ar, IO_ReadOnly ); 137 QDataStream stream( ar, IO_ReadOnly );
136 QStringList list; 138 QStringList list;
137 stream >> list; 139 stream >> list;
@@ -145,20 +147,21 @@ void SendWidget::slotIrError( int ) {
145 147
146} 148}
147void SendWidget::slotIrSent( bool b) { 149void SendWidget::slotIrSent( bool b) {
150 qWarning("irda sent!!");
148 QString text = b ? tr("Sent") : tr("Failure"); 151 QString text = b ? tr("Sent") : tr("Failure");
149 m_devBox->setStatus( m_irDa[m_start], text ); 152// m_devBox->setStatus( m_irDa[m_start], text );
150 m_start++; 153 m_start++;
151 slotStartIrda(); 154 slotStartIrda();
152} 155}
153void SendWidget::slotIrTry(unsigned int trI) { 156void SendWidget::slotIrTry(unsigned int trI) {
154 m_devBox->setStatus( m_irDa[m_start], tr("Try %1").arg( QString::number( trI ) ) ); 157// m_devBox->setStatus( m_irDa[m_start], tr("Try %1").arg( QString::number( trI ) ) );
155} 158}
156void SendWidget::slotStartIrda() { 159void SendWidget::slotStartIrda() {
157 if (m_start >= m_irDa.count() ) { 160 if (m_start >= m_irDa.count() ) {
158 m_devBox->addDevice(tr("Search again for IrDa."), DeviceBox::Search ); 161 m_devBox->addDevice(tr("Search again for IrDa."), DeviceBox::Search );
159 return; 162 return;
160 } 163 }
161 m_devBox->setStatus( m_irDa[m_start], tr("Start sending") ); 164// m_devBox->setStatus( m_irDa[m_start], tr("Start sending") );
162 m_obex->send( m_file ); 165 m_obex->send( m_file );
163} 166}
164void SendWidget::slotDone() { 167void SendWidget::slotDone() {