Summary: | SMS messages list is not update when calling ModemManager::ModemMessaging::createMessage | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-modemmanager-qt | Reporter: | Daniel <danielvaz> |
Component: | general | Assignee: | Jan Grulich <jgrulich> |
Status: | RESOLVED NOT A BUG | ||
Severity: | normal | CC: | jgrulich, lamarque, lukas.tinkl |
Priority: | NOR | ||
Version First Reported In: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Daniel
2016-01-20 15:40:59 UTC
Hi, MMQt API is assynchronous and MMQt needs to receive signals from ModemManager to update the message list. That is probably not happening because you are doing everything in synchronous mode. Try adding the line below after *before* step 7 and check if your example works: // Include QCoreApplication if compiler complains about qApp not defined. qApp->processEvents(); That will make Qt process any pending event (like ModemManager's signal to update the message list). If that works then you need to update your code to work in asynchronous mode. Using processEvent() must be avoided since it is a costly method call. Even using the qApp->processEvents(); as you suggested, the message list was not updated after that. But as you warned me that I am using in a synchronous mode, I changed the way to use, now I am using signal/slots and I connected the signal ModemManager::ModemMessaging::messageAdded in a custom slot and this signal is emitted OK and I can access the recently created message using the messages property (ModemManager::Sms::List messages = messaging->messages()). It means that the list contains the recently added message inside the slot called by the signal. Probably I am misusing the framework MMQt. I based my code in the source code of the example folder. In the truth that example didn't work for me. Running the example the message did not sent. Is the example running for you? If you like I can contribute with the MMQt in order to provide more examples. Thanks in advance. (Sorry for my english, I am from Brazil). Adding qApp->processEvents(); qApp->processEvents(); instead of just one, make the things work. Using signals and slots is the way how to use both MMQT and NMQT properly. Do not pay attention that much to the example, I was lazy to write a proper one and that one you see was created just as a testing code for sending sms. If you want any help with MMQT API just contact us on kde-hardware-devel@kde.org mailing list and we will be more than happy to help you and don't worry about your english, most of us are not native speakers (I'm from Czech Republic and Lamarque is from Brazil too). Thank you for the answers. I sent a message in the kde-hardware-devel list. |