Diffstat (limited to 'noncore/net/opietooth/lib/manager.cc') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/lib/manager.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/noncore/net/opietooth/lib/manager.cc b/noncore/net/opietooth/lib/manager.cc index 177c94e..23506b3 100644 --- a/noncore/net/opietooth/lib/manager.cc +++ b/noncore/net/opietooth/lib/manager.cc | |||
@@ -106,11 +106,13 @@ void Manager::searchServices( const QString& remDevice ){ | |||
106 | OProcess *m_sdp =new OProcess(); | 106 | OProcess *m_sdp =new OProcess(); |
107 | *m_sdp << "sdptool" << "browse" << remDevice; | 107 | *m_sdp << "sdptool" << "browse" << remDevice; |
108 | m_sdp->setName( remDevice.latin1() ); | 108 | m_sdp->setName( remDevice.latin1() ); |
109 | qWarning("search Services for %s", remDevice.latin1() ); | ||
109 | connect(m_sdp, SIGNAL(processExited(OProcess*) ), | 110 | connect(m_sdp, SIGNAL(processExited(OProcess*) ), |
110 | this, SLOT(slotSDPExited(OProcess* ) ) ); | 111 | this, SLOT(slotSDPExited(OProcess* ) ) ); |
111 | connect(m_sdp, SIGNAL(receivedStdout(OProcess*, char*, int ) ), | 112 | connect(m_sdp, SIGNAL(receivedStdout(OProcess*, char*, int ) ), |
112 | this, SLOT(slotSDPOut(OProcess*, char*, int) ) ); | 113 | this, SLOT(slotSDPOut(OProcess*, char*, int) ) ); |
113 | if (!m_sdp->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { | 114 | if (!m_sdp->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { |
115 | qWarning("could not start sdptool" ); | ||
114 | delete m_sdp; | 116 | delete m_sdp; |
115 | Services::ValueList list; | 117 | Services::ValueList list; |
116 | emit foundServices( remDevice, list ); | 118 | emit foundServices( remDevice, list ); |
@@ -137,21 +139,25 @@ void Manager::slotProcessExited(OProcess* proc ) { | |||
137 | void Manager::slotSDPOut(OProcess* proc, char* ch, int len) | 139 | void Manager::slotSDPOut(OProcess* proc, char* ch, int len) |
138 | { | 140 | { |
139 | QCString str(ch, len+1 ); | 141 | QCString str(ch, len+1 ); |
142 | qWarning("SDP:%s", str.data() ); | ||
140 | QMap<QString, QString>::Iterator it; | 143 | QMap<QString, QString>::Iterator it; |
141 | it = m_out.find(proc->name() ); | 144 | it = m_out.find(proc->name() ); |
145 | QString string; | ||
142 | if ( it != m_out.end() ) { | 146 | if ( it != m_out.end() ) { |
143 | QString string = it.data(); | 147 | string = it.data(); |
144 | string.append( str ); | ||
145 | m_out.replace( proc->name(), string ); | ||
146 | } | 148 | } |
149 | string.append( str ); | ||
150 | m_out.replace( proc->name(), string ); | ||
147 | 151 | ||
148 | } | 152 | } |
149 | void Manager::slotSDPExited( OProcess* proc) | 153 | void Manager::slotSDPExited( OProcess* proc) |
150 | { | 154 | { |
155 | qWarning("proc name %s", proc->name() ); | ||
151 | Services::ValueList list; | 156 | Services::ValueList list; |
152 | if (proc->normalExit() ) { | 157 | if (proc->normalExit() ) { |
153 | QMap<QString, QString>::Iterator it = m_out.find( proc->name() ); | 158 | QMap<QString, QString>::Iterator it = m_out.find( proc->name() ); |
154 | if ( it != m_out.end() ) { | 159 | if ( it != m_out.end() ) { |
160 | qWarning("found process" ); | ||
155 | list = parseSDPOutput( it.data() ); | 161 | list = parseSDPOutput( it.data() ); |
156 | m_out.remove( it ); | 162 | m_out.remove( it ); |
157 | } | 163 | } |
@@ -161,6 +167,7 @@ void Manager::slotSDPExited( OProcess* proc) | |||
161 | } | 167 | } |
162 | Services::ValueList Manager::parseSDPOutput( const QString& out ) { | 168 | Services::ValueList Manager::parseSDPOutput( const QString& out ) { |
163 | Services::ValueList list; | 169 | Services::ValueList list; |
170 | qWarning("parsing output" ); | ||
164 | Parser parser( out ); | 171 | Parser parser( out ); |
165 | list = parser.services(); | 172 | list = parser.services(); |
166 | return list; | 173 | return list; |