![]() |
2010-09-22
, 07:52
|
Posts: 432 |
Thanked: 645 times |
Joined on Mar 2009
|
#2
|
![]() |
2010-09-22
, 09:57
|
|
Posts: 1,637 |
Thanked: 4,424 times |
Joined on Apr 2009
@ Germany
|
#3
|
TARGET = mobtest SOURCES = mobtest.cpp OBJECTS_DIR = build MOC_DIR = build DESTDIR = build TEMPLATE = app CONFIG += mobility MOBILITY += messaging
#include <iostream> #include <QObject> #include <QDebug> #include <QMessage> #include <QMessageManager> #include <QMessageFilter> #include <QDate> #include <QApplication> QTM_USE_NAMESPACE int main(int argc, char** argv) { QApplication app(argc, argv); qWarning("start"); const QDateTime minimumDate(QDate(2010, 7, 20)); QMessageFilter include_Filter(QMessageFilter::byTimeStamp(minimumDate, QMessageDataComparator::GreaterThanEqual)); include_Filter &= QMessageFilter::byType(QMessage::Sms); QtMobility::QMessageIdList ids = QtMobility::QMessageManager().queryMessages(include_Filter); foreach(const QMessageId& id, ids) { QMessage message = QtMobility::QMessageManager().message(id); QString msg = id.toString(); msg += " : "; msg += message.subject(); qWarning() << msg; } qWarning("done"); return app.exec(); }
mad qmake mad make
run-standalone ./mobtest
![]() |
2010-09-23
, 06:41
|
Posts: 42 |
Thanked: 12 times |
Joined on Dec 2009
@ Kuopio, Finland
|
#4
|
Hi,
are you running the application from QtCreator directly? I've seen some issues reading the contact database, as it does not execute the application as "user" but as "developer". Try to run the application from the device as "user" and see what happens.
Daniel
I am trying to fetch users SMS from the device but it seems like it doesn't function correctly.
I am using following:
const QDateTime minimumDate(QDate(2009,8,20));
QMessageFilter includeFilter(QMessageFilter::byTimeStamp(minimumD ate, QMessageDataComparator::GreaterThanEqual));
includeFilter &= QMessageFilter::byType(QMessage::Sms);
QtMobility::QMessageIdList ids = QtMobility::QMessageManager().queryMessages(includ eFilter);
And ids list returns empty (It works for Email).
Can anyone else confirm this bug when running application in N900? I am using QtCreator on Windows 7 and USB networking connection to n900. QTCreator Emulator doesn't have any SMS messages in it to test against.
My other - very ugly and n900 only - solution would be to use sql to fetch SMS from the rtcom sqlite database, but I wouldn't like to use that option.