-rw-r--r-- | core/obex/obexsend.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/core/obex/obexsend.cpp b/core/obex/obexsend.cpp index f3dd11c..675c5e4 100644 --- a/core/obex/obexsend.cpp +++ b/core/obex/obexsend.cpp | |||
@@ -96,68 +96,64 @@ void SendWidget::send( const QString& file, const QString& desc ) { | |||
96 | m_start++; | 96 | m_start++; |
97 | }else | 97 | }else |
98 | m_btDeSearch = m_devBox->addDevice( tr("Searching for bluetooth Devices."), DeviceBox::Search ); | 98 | m_btDeSearch = m_devBox->addDevice( tr("Searching for bluetooth Devices."), DeviceBox::Search ); |
99 | 99 | ||
100 | if (m_start != 2 ) { | 100 | if (m_start != 2 ) { |
101 | QCopEnvelope e0("QPE/IrDaApplet", "enableIrda()"); | 101 | QCopEnvelope e0("QPE/IrDaApplet", "enableIrda()"); |
102 | QCopEnvelope e1("QPE/Bluetooth", "enableBluetooth()"); | 102 | QCopEnvelope e1("QPE/Bluetooth", "enableBluetooth()"); |
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 | } | 106 | } |
107 | void SendWidget::slotIrDaDevices( const QStringList& list) { | 107 | void SendWidget::slotIrDaDevices( const QStringList& list) { |
108 | owarn << "slot it irda devices " << oendl; | ||
109 | for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) { | 108 | for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) { |
110 | int id = m_devBox->addDevice( (*it), DeviceBox::IrDa, tr("Scheduling for beam.") ); | 109 | int id = m_devBox->addDevice( (*it), DeviceBox::IrDa, tr("Scheduling for beam.") ); |
111 | m_irDa.insert( id, (*it) ); | 110 | m_irDa.insert( id, (*it) ); |
112 | } | 111 | } |
113 | m_devBox->removeDevice( m_irDeSearch ); | 112 | m_devBox->removeDevice( m_irDeSearch ); |
114 | m_irDaIt = m_irDa.begin(); | 113 | m_irDaIt = m_irDa.begin(); |
115 | 114 | ||
116 | slotStartIrda(); | 115 | slotStartIrda(); |
117 | } | 116 | } |
118 | 117 | ||
119 | void SendWidget::slotBTDevices( const QMap<QString, QString>& str ) { | 118 | void SendWidget::slotBTDevices( const QMap<QString, QString>& str ) { |
120 | for(QMap<QString, QString>::ConstIterator it = str.begin(); it != str.end(); ++it ) { | 119 | for(QMap<QString, QString>::ConstIterator it = str.begin(); it != str.end(); ++it ) { |
121 | int id = m_devBox->addDevice( it.key(), DeviceBox::BT, tr("Click to beam") ); | 120 | int id = m_devBox->addDevice( it.key(), DeviceBox::BT, tr("Click to beam") ); |
122 | m_bt.insert( id, Pair( it.key(), it.data() ) ); | 121 | m_bt.insert( id, Pair( it.key(), it.data() ) ); |
123 | } | 122 | } |
124 | m_devBox->removeDevice( m_btDeSearch ); | 123 | m_devBox->removeDevice( m_btDeSearch ); |
125 | } | 124 | } |
126 | void SendWidget::slotSelectedDevice( int name, int dev ) { | 125 | void SendWidget::slotSelectedDevice( int name, int ) { |
127 | owarn << "Start beam? " << name << " " << dev << "" << oendl; | ||
128 | if ( name == m_irDeSearch ) { | 126 | if ( name == m_irDeSearch ) { |
129 | for (QMap<int, QString>::Iterator it= m_irDa.begin(); it != m_irDa.end(); ++it ) | 127 | for (QMap<int, QString>::Iterator it= m_irDa.begin(); it != m_irDa.end(); ++it ) |
130 | m_devBox->removeDevice( it.key() ); | 128 | m_devBox->removeDevice( it.key() ); |
131 | 129 | ||
132 | QCopEnvelope e2("QPE/IrDaApplet", "listDevices()"); | 130 | QCopEnvelope e2("QPE/IrDaApplet", "listDevices()"); |
133 | } | 131 | } |
134 | } | 132 | } |
135 | void SendWidget::dispatchIrda( const QCString& str, const QByteArray& ar ) { | 133 | void SendWidget::dispatchIrda( const QCString& str, const QByteArray& ar ) { |
136 | owarn << "dispatch irda " << str.data() << "" << oendl; | ||
137 | if ( str == "devices(QStringList)" ) { | 134 | if ( str == "devices(QStringList)" ) { |
138 | QDataStream stream( ar, IO_ReadOnly ); | 135 | QDataStream stream( ar, IO_ReadOnly ); |
139 | QStringList list; | 136 | QStringList list; |
140 | stream >> list; | 137 | stream >> list; |
141 | slotIrDaDevices( list ); | 138 | slotIrDaDevices( list ); |
142 | } | 139 | } |
143 | } | 140 | } |
144 | void SendWidget::dispatchBt( const QCString&, const QByteArray& ) { | 141 | void SendWidget::dispatchBt( const QCString&, const QByteArray& ) { |
145 | 142 | ||
146 | } | 143 | } |
147 | void SendWidget::slotIrError( int ) { | 144 | void SendWidget::slotIrError( int ) { |
148 | 145 | ||
149 | } | 146 | } |
150 | void SendWidget::slotIrSent( bool b) { | 147 | void SendWidget::slotIrSent( bool b) { |
151 | owarn << "irda sent!!" << oendl; | ||
152 | QString text = b ? tr("Sent") : tr("Failure"); | 148 | QString text = b ? tr("Sent") : tr("Failure"); |
153 | m_devBox->setStatus( m_irDaIt.key(), text ); | 149 | m_devBox->setStatus( m_irDaIt.key(), text ); |
154 | ++m_irDaIt; | 150 | ++m_irDaIt; |
155 | slotStartIrda(); | 151 | slotStartIrda(); |
156 | } | 152 | } |
157 | void SendWidget::slotIrTry(unsigned int trI) { | 153 | void SendWidget::slotIrTry(unsigned int trI) { |
158 | m_devBox->setStatus( m_irDaIt.key(), tr("Try %1").arg( QString::number( trI ) ) ); | 154 | m_devBox->setStatus( m_irDaIt.key(), tr("Try %1").arg( QString::number( trI ) ) ); |
159 | } | 155 | } |
160 | void SendWidget::slotStartIrda() { | 156 | void SendWidget::slotStartIrda() { |
161 | if (m_irDaIt == m_irDa.end() ) { | 157 | if (m_irDaIt == m_irDa.end() ) { |
162 | m_irDeSearch = m_devBox->addDevice(tr("Search again for IrDa."), DeviceBox::Search ); | 158 | m_irDeSearch = m_devBox->addDevice(tr("Search again for IrDa."), DeviceBox::Search ); |
163 | return; | 159 | return; |
@@ -196,25 +192,24 @@ int DeviceBox::addDevice( const QString& name, int dev, const QString& status ) | |||
196 | void DeviceBox::removeDevice( int id ) { | 192 | void DeviceBox::removeDevice( int id ) { |
197 | if (!m_dev.contains(id) ) return; | 193 | if (!m_dev.contains(id) ) return; |
198 | 194 | ||
199 | m_dev.remove( id ); | 195 | m_dev.remove( id ); |
200 | setText( allText() ); | 196 | setText( allText() ); |
201 | } | 197 | } |
202 | void DeviceBox::setStatus( int id, const QString& status ) { | 198 | void DeviceBox::setStatus( int id, const QString& status ) { |
203 | if ( !m_dev.contains(id) ) return; | 199 | if ( !m_dev.contains(id) ) return; |
204 | m_dev[id].setStatus(status ); | 200 | m_dev[id].setStatus(status ); |
205 | setText( allText() ); | 201 | setText( allText() ); |
206 | } | 202 | } |
207 | void DeviceBox::setSource( const QString& str ) { | 203 | void DeviceBox::setSource( const QString& str ) { |
208 | owarn << "SetSource:" << str.toInt() << "" << oendl; | ||
209 | int id = str.toInt(); | 204 | int id = str.toInt(); |
210 | emit selectedDevice( id, m_dev[id].device() ); | 205 | emit selectedDevice( id, m_dev[id].device() ); |
211 | } | 206 | } |
212 | int DeviceBox::idFor ( int id ) { | 207 | int DeviceBox::idFor ( int id ) { |
213 | static int irId = 1501; | 208 | static int irId = 1501; |
214 | static int irBT = 1001; | 209 | static int irBT = 1001; |
215 | static int irSr = 501; | 210 | static int irSr = 501; |
216 | static int irEr = 0; | 211 | static int irEr = 0; |
217 | 212 | ||
218 | int ret = -1; | 213 | int ret = -1; |
219 | switch(id ) { | 214 | switch(id ) { |
220 | case IrDa: | 215 | case IrDa: |