Discussion Board

Results 1 to 12 of 12
  1. #1
    Registered User zuo3diao's Avatar
    Join Date
    Feb 2009
    Posts
    25
    It don't work in my N900 to use your code snippet too.
    I found another problem. code:
    void SMSWindow::messageAdded(const QMessageId& id,
    const QMessageManager::NotificationFilterIdSet& matchingFilterIds)
    {
    qDebug()<< "messageAdded";
    qDebug()<<id.toString();
    // Message added...
    if (matchingFilterIds.contains(m_notifFilterSet)) {
    // ...and it fits into our filters, lets process it
    waitBeforeHandleMessage(id);
    }
    }
    ......................
    void SMSWindow:rocessIncomingSMS(const QMessageId& id)
    {
    qDebug()<< "processIncomingSMS";
    qDebug()<<id.toString();
    // QMaemo5InformationBox::information(this, "processIncomingSMS <b> ok</b>",
    // QMaemo5InformationBox:efaultTimeout);
    QMessage message = m_manager->message(id);

    qDebug()<<message.type();
    qDebug()<<message.status();
    qDebug()<<message.standardFolder();
    qDebug()<<message.textContent();
    if(message.type() == QMessage::Sms &&
    message.status() == QMessage::Incoming &&
    message.standardFolder() == QMessage::InboxFolder)
    {
    // Get message string
    QString messageString = message.textContent();
    qDebug()<< "messageString is SMS :" << messageString;

    // Remove message from inbox
    qDebug() << m_manager->removeMessage(id);
    }

    qDebug()<< "Not SMS";
    }
    prompt print
    ModestEngine::ModestEngine Connected to Qt Mobility Modest Plugin DBus Interface
    ModestEngine::ModestEngine Initialized successfully

    messageAdded
    "107"

    processIncomingSMS
    "107"
    0
    0
    3
    ""
    Not SMS
    I cannot get the message ,only get the id? help me!

  2. #2
    Registered User zuo3diao's Avatar
    Join Date
    Feb 2009
    Posts
    25
    New problem is QMessageManager::message(id) conn't get the message object. code is copy below:
    ...
    m_manager = new QMessageManager(this);

    // Listen new added messages
    QObject::connect(m_manager,
    SIGNAL(messageAdded(const QMessageId&, const QMessageManager::NotificationFilterIdSet&)),
    this,
    SLOT(messageAdded(const QMessageId&, const QMessageManager::NotificationFilterIdSet&)));

    m_notificationFilterId = m_manager->registerNotificationFilter( QMessageFilter());
    .....
    void SMSWindow::messageAdded(const QMessageId& id,
    const QMessageManager::NotificationFilterIdSet& matchingFilterIds)
    {
    qDebug()<< "messageAdded";
    qDebug()<<id.toString();
    QMessage message = m_manager->message(id);

    qDebug()<<message.type();
    qDebug()<<message.status();
    qDebug()<<message.standardFolder();
    qDebug()<<message.textContent();
    // Message added...
    if (matchingFilterIds.contains(m_notifFilterSet)) {
    // ...and it fits into our filters, lets process it
    waitBeforeHandleMessage(id);
    }
    }
    The console print like that:

    ModestEngine::ModestEngine Initialized successfully

    messageAdded
    "108"
    0
    0
    3
    ""
    Did not get the message property! Help!

  3. #3
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    I do not experience any of the problems you mention
    Code:
    #include <QtGui>
    
    #include <QMessage>
    #include <QMessageManager>
    using namespace QtMobility;
    
    int main(int argc, char *argv[])
    {
        QCoreApplication a(argc, argv);
    
        QMessageManager manager;
        QMessageIdList list = manager.queryMessages(QMessageFilter::byType(QMessage::Sms));
        for (int i = 0; i < list.size(); ++i) {
             QMessageId id = list.at(i);
             QMessage message = manager.message(id);
             qDebug() << message.from().addressee() << message.textContent();
        }
    }

  4. #4
    Registered User zuo3diao's Avatar
    Join Date
    Feb 2009
    Posts
    25
    I add your code in my app here.
    QMessageManager manager;
    QMessageIdList list = manager.queryMessages(QMessageFilter::byType(QMessage::Sms));
    qDebug()<< list.count();
    for (int i = 0; i < list.size(); ++i) {
    QMessageId id = list.at(i);
    QMessage message = manager.message(id);
    qDebug() << message.from().addressee() << message.textContent();
    }
    and the console print
    ...........
    ModestEngine::ModestEngine Connecting to Qt Mobility Modest Plugin DBus Interface
    ModestEngine::ModestEngine Connected to Qt Mobility Modest Plugin DBus Interface
    ModestEngine::ModestEngine Initialized successfully

    0
    what 's mean ? As http://discussion.forum.nokia.com/fo...ut-not-in-N900
    mention , the QMessageManager and QMessageFilter are not compatible?
    My N900 has almost 100 sms in the inbox, my qt mobility 's version is latest, the code is simple...

  5. #5
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    How do you compile your application and how do you execute it then?
    P.S. There is no mention that QMessageManager and QMessageFilter are not compatible.

  6. #6
    Registered User zuo3diao's Avatar
    Join Date
    Feb 2009
    Posts
    25
    I use Nokia QT SDK 1.0 Release, that suit include Qt Creator. I create the simple project , modify main.cpp with your content, set N900 and IDE connect and run.

    I can run app in IDE directly ,and std output is show in Qt Creator 's Application Output.

  7. #7
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    Quote Originally Posted by zuo3diao View Post
    I use Nokia QT SDK 1.0 Release, that suit include Qt Creator. I create the simple project , modify main.cpp with your content, set N900 and IDE connect and run.
    Is it Linux, Mac OS or Windows version Nokia Qt SDK?

  8. #8
    Registered User zuo3diao's Avatar
    Join Date
    Feb 2009
    Posts
    25
    Windows 7 ,It should be supported very well. I cannot find any problem.

  9. #9
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    If you cannot find any problem, what this thread is about?

  10. #10
    Registered User zuo3diao's Avatar
    Join Date
    Feb 2009
    Posts
    25
    I think I code app and config the IDE and SDK all right ,but some function of messaging api was not worked at my N900 yet.

    Do you have some other reasons ,env or config problem that cause the code execute abnormal?

    Are you compile in windows ? or madde with Qemu?

    PS : my N900 device rom is not international version ,I flash it in US -002 version, It is suitable for location of sales.

  11. #11
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    There is a thread with problems very similar to yours an Windows version of Nokia Qt SDK is also used.
    http://discussion.forum.nokia.com/fo...ut-not-in-N900

  12. #12
    Registered User zuo3diao's Avatar
    Join Date
    Feb 2009
    Posts
    25
    It looks like happen to my status follow your url link.
    Thank you for your patience, and where it is submit to ? Obviously It is not qt 's bug, it is SDK 's.

Similar Threads

  1. message slot problems--QMessageManager::messageAdded
    By zuo3diao in forum [Archived] Qt Mobility Project
    Replies: 15
    Last Post: 2010-09-16, 22:10
  2. Replies: 2
    Last Post: 2008-07-25, 07:59
  3. Unique message-id
    By michlimkb in forum General Messaging
    Replies: 1
    Last Post: 2003-04-10, 11:37
  4. Message Id and Transaction Id
    By Marconato in forum General Messaging
    Replies: 1
    Last Post: 2003-03-12, 07:35
  5. Transaction Id And Message Id ??
    By crosscourt in forum General Messaging
    Replies: 1
    Last Post: 1970-01-01, 02:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved