summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/gsmtool/gsmtool.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/noncore/unsupported/gsmtool/gsmtool.cpp b/noncore/unsupported/gsmtool/gsmtool.cpp
index 6fea596..e6122ad 100644
--- a/noncore/unsupported/gsmtool/gsmtool.cpp
+++ b/noncore/unsupported/gsmtool/gsmtool.cpp
@@ -258,71 +258,67 @@ void GSMTool::doNewSMSClearButton()
258{ 258{
259 NewSMSText->setText(""); 259 NewSMSText->setText("");
260} 260}
261 261
262void GSMTool::doNewSMSSaveButton() 262void GSMTool::doNewSMSSaveButton()
263{ 263{
264 qDebug("NewSMSSaveButton"); 264 qDebug("NewSMSSaveButton");
265 const char *msgtext = strdup(NewSMSText->text().local8Bit()); 265 const char *msgtext = strdup(NewSMSText->text().local8Bit());
266 const char *dest = NewSMSToBox->currentText().ascii(); 266 const char *dest = NewSMSToBox->currentText().ascii();
267 267
268 NewSMSStatusLabel->setText("Sending..."); 268 NewSMSStatusLabel->setText("Sending...");
269 me->setMessageService(1); 269 me->setMessageService(1);
270 270
271 qDebug("NewSMSSendButton: '%s' to '%s'", msgtext, dest); 271 qDebug("NewSMSSendButton: '%s' to '%s'", msgtext, dest);
272 272
273 SMSMessageRef m = new SMSSubmitMessage (msgtext, dest); 273 SMSMessageRef m = new SMSSubmitMessage (msgtext, dest);
274 sms_store->insert(m); 274 sms_store->insert(m);
275 free((void *)msgtext); 275 free((void *)msgtext);
276 276
277} 277}
278void GSMTool::doNewSMSSendButton() 278void GSMTool::doNewSMSSendButton()
279{ 279{
280 const char *msgtext = strdup(NewSMSText->text().local8Bit()); 280 const char *msgtext = strdup(NewSMSText->text().local8Bit());
281 const char *dest = NewSMSToBox->currentText().ascii(); 281 const char *dest = NewSMSToBox->currentText().ascii();
282 282
283 NewSMSStatusLabel->setText("Sending..."); 283 NewSMSStatusLabel->setText("Sending...");
284 me->setMessageService(1); 284 me->setMessageService(1);
285 285
286 qDebug("NewSMSSendButton: '%s' to '%s'", msgtext, dest); 286 qDebug("NewSMSSendButton: '%s' to '%s'", msgtext, dest);
287 287
288 SMSSubmitMessage m(msgtext, dest); 288 SMSSubmitMessage m(msgtext, dest);
289 try { 289 try {
290 Ref<SMSMessage> ackPDU;
291 m.setAt(new GsmAt(*me)); 290 m.setAt(new GsmAt(*me));
292 m.send(ackPDU); 291 m.send();
293 292
294 // print acknowledgement if available
295 if (! ackPDU.isnull())
296 cout << ackPDU->toString();
297 NewSMSStatusLabel->setText("Message sent."); 293 NewSMSStatusLabel->setText("Message sent.");
298 } catch (GsmException &ge) { 294 } catch (GsmException &ge) {
299 NewSMSStatusLabel->setText("Failed."); 295 NewSMSStatusLabel->setText("Failed.");
300 qDebug(ge.what()); 296 qDebug(ge.what());
301 } 297 }
302 free((void *)msgtext); 298 free((void *)msgtext);
303 299
304 300
305} 301}
306 302
307 303
308void GSMTool::doSMSDeleteButton() 304void GSMTool::doSMSDeleteButton()
309{ 305{
310 QListViewItem *item = SMSList->currentItem(); 306 QListViewItem *item = SMSList->currentItem();
311 if (!item) 307 if (!item)
312 return; 308 return;
313 309
314 int index = atoi(item->text(2).ascii()); 310 int index = atoi(item->text(2).ascii());
315 qDebug("delete SMS with index %d\n", index); 311 qDebug("delete SMS with index %d\n", index);
316 312
317 313
318 314
319 SortedSMSStore::iterator e = sms_store->find(index); 315 SortedSMSStore::iterator e = sms_store->find(index);
320 316
321 if (e != sms_store->end()) { 317 if (e != sms_store->end()) {
322 qDebug("message is %s\n", e->message()->userData().c_str()); 318 qDebug("message is %s\n", e->message()->userData().c_str());
323 sms_store->erase(e); 319 sms_store->erase(e);
324 320
325 } 321 }
326 doSMSTypeChanged(); 322 doSMSTypeChanged();
327} 323}
328 324