PDA

View Full Version : Save a message in system store with QMessageService



grisson
13th May 2011, 14:05
Hi.
I'm trying to save a message in the system store via QtMobility.

the code is this:


QMessageService *systemMessageService=new QMessageService;
QMessage *sysMsg=new QMessage;
QMessageAddress sysNum;
sysNum.setAddressee(_sendedMsg.getPhoneNumber().to String());
sysMsg->setBody(_sendedMsg.getText());
sysMsg->setDate(QDateTime::currentDateTime());
sysMsg->setParentAccountId(QMessageAccount::defaultAccount (QMessage::Sms));
sysMsg->setTo(sysNum);
sysMsg->setStatus(QMessage::Read);
sysMsg->setType(QMessage::Sms);
systemMessageManager->addMessage(sysMsg);
if (!systemMessageService->exportUpdates(QMessageAccount::defaultAccount(QMes sage::Sms)))
showNoticeDialog(QString::number(systemMessageServ ice->error()));


The problem is that exportUpdates fails everytime with error code 8 ( QMessageManager::RequestIncomplete ).
No problem with addMessage. it never fails.
I can't find any example on google and i think that i'm forgotting something (incomplete data in sysMsg?).

Any suggestions?

Thanks.
Ivan.

grisson
16th May 2011, 10:06
still have the same issue. Google can't help... :(