Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Add SMS to the Inbox folder on N950?
Qt 6.11 is out! See what's new in the release blog

Add SMS to the Inbox folder on N950?

Scheduled Pinned Locked Moved Mobile and Embedded
1 Posts 1 Posters 2.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sudanix
    wrote on last edited by
    #1

    Hi,
    I'm trying to add SMS to the Inbox folder (on Harmattan N950) but it goes to the drafts folder instead of the Inbox, here's my code to add the sms:

    @ QMessage sms;
    sms.setType(QMessage::Sms);
    sms.setParentAccountId(QMessageAccount::defaultAccount(QMessage::Sms));
    sms.setFrom(QMessageAddress(QMessageAddress::Phone,"123456"));
    sms.setTo(QMessageAddress(QMessageAddress::Phone,"1111"));
    sms.setBody("WELCOME TO QML");
    sms.setDate(QDateTime::currentDateTime());
    sms.setReceivedDate(QDateTime::currentDateTime());
    sms.setStatus(QMessage::Read);

    if (m_messageManager->addMessage(&sms)) {
        qDebug() << "Message is Added";
    } else {
        qDebug() << "Message is not added";
    }@
    

    Also I've tried to move all the SMS from the Drafts folder to the Inbox but it never work :

    @ foreach (QMessageFolderId folderId, m_messageManager->queryFolders(QMessageFolderFilter::byName("Inbox"))) {
    QMessageIdList messageList = m_messageManager->queryMessages(QMessageFilter::byStandardFolder(QMessage::DraftsFolder));
    if (m_messageService->moveMessages(messageList,folderId)) {
    qDebug() << "Message is moved to inbox" ;
    } else {
    qDebug() << "Message is not moved to inbox";
    }
    }@

    So what's wrong here and how I can add the SMS to the Inbox folder?

    Thanks in advance.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved