×

Discussion Board

Results 1 to 1 of 1
  1. #1
    Registered User
    Join Date
    Aug 2010
    Posts
    1

    Qmessage of type sms, receiver number returns ring/tel/ring

    I am trying to retrieve infomation on all the sms message on the phone, everything works nice except the part where i am trying the get the receiver number. For some reason it seems to return ring/tel/ring, for every message.

    libqtm-messaging version: 1.0.2


    My code

    Code:
    qWarning("requsting sms log");
        QMessageManager manager;
        QMessageFilter filter(QMessageFilter::byType(QMessage::Sms));
        QMessageIdList allids = manager.queryMessages(filter);
        QByteArray byteArray;
        QXmlStreamWriter xmldoc(&byteArray);
        xmldoc.writeStartDocument();
        //starting the element to contain ALL the messages
        xmldoc.writeStartElement(QString("messages"));
        foreach (QMessageId id, allids){
            //starting the element to contain a single msg
            xmldoc.writeStartElement(QString("msg"));
            QMessage msg = manager.message(id);
            QMessageAddress afsender = msg.from();
            //making the element to contain who the msg is from
            xmldoc.writeStartElement(QString("afsender"));
            xmldoc.writeCharacters(qPrintable(afsender.addressee()));
            xmldoc.writeEndElement();
    
            QMessageAddressList modtagere = msg.to();
            xmldoc.writeStartElement(QString("modtagere"));
            qWarning("afsender:%s",qPrintable(afsender.addressee()));
    
            foreach (QMessageAddress modtager, modtagere){
                xmldoc.writeStartElement(QString("modtager"));
                xmldoc.writeCharacters(qPrintable(modtager.addressee()));
                // ending the element "modtager"
                qWarning("modtager:%s",qPrintable(modtager.addressee()));     //<- Here is i am printing the receiver number, and all it print is: modtager:ring/tel/ring
                //qWarning("cc:%s",qPrintable(msg.cc().first().addressee()));
                //qWarning("bbc:%s",qPrintable(msg.bcc().first().addressee()));
    
                xmldoc.writeEndElement();
            }
            //afslutter modtagere
            QDateTime timestamp = msg.date();
            xmldoc.writeEndElement();
            xmldoc.writeStartElement(QString("time"));
            xmldoc.writeCharacters(timestamp.toString("hh:mm:ss"));
            xmldoc.writeEndElement();
            xmldoc.writeStartElement(QString("dato"));
            xmldoc.writeCharacters(timestamp.toString("dd.MM.yy"));
            xmldoc.writeEndElement();
            QMessageContentContainer bodyid = msg.find(msg.bodyId());
            QString bodystring = bodyid.textContent();
            xmldoc.writeStartElement(QString("body"));
            xmldoc.writeCharacters(bodystring);
            xmldoc.writeEndElement();
            //qWarning("%s:%s:%s",qPrintable(timestamp.toString("dd.MM.yy hh:mm:ss")),qPrintable(afsender.addressee()) ,qPrintable(bodystring));
            //qWarning("%s",qPrintable(QString(byteArray)));
     }
        xmldoc.writeEndElement();
        xmldoc.writeEndDocument();
    }
    program output:
    afsender:+4521******
    modtager:ring/tel/ring
    afsender:+4553******
    modtager:ring/tel/ring
    afsender:+4529******
    modtager:ring/tel/ring....... and so on!


    For me it seems to read the SQlite database wrong.. can someone confirm this?
    Last edited by bassejepsen; 2010-08-11 at 01:37.

Similar Threads

  1. Replies: 2
    Last Post: 2009-12-24, 10:33
  2. Replies: 5
    Last Post: 2009-12-04, 10:43
  3. Replies: 4
    Last Post: 2008-07-30, 10:15
  4. Replies: 0
    Last Post: 2006-10-26, 06:54
  5. Changing ring type
    By WhileTrue in forum Symbian
    Replies: 0
    Last Post: 2005-07-25, 00:57

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×