equal
deleted
inserted
replaced
41 #include "qmessageid_p.h" |
41 #include "qmessageid_p.h" |
42 #include <QByteArray> |
42 #include <QByteArray> |
43 #include <QDataStream> |
43 #include <QDataStream> |
44 #include <MAPIUtil.h> |
44 #include <MAPIUtil.h> |
45 #include <QDebug> |
45 #include <QDebug> |
46 |
46 #include <messagingutil_p.h> |
47 |
47 |
48 QTM_BEGIN_NAMESPACE |
48 QTM_BEGIN_NAMESPACE |
49 |
49 |
50 #ifdef _WIN32_WCE |
50 #ifdef _WIN32_WCE |
51 |
51 |
178 } |
178 } |
179 |
179 |
180 QMessageId::QMessageId(const QString& id) |
180 QMessageId::QMessageId(const QString& id) |
181 : d_ptr(new QMessageIdPrivate(this)) |
181 : d_ptr(new QMessageIdPrivate(this)) |
182 { |
182 { |
183 QDataStream idStream(QByteArray::fromBase64(WinHelpers::stripIdPrefix(id).toLatin1())); |
183 QDataStream idStream(QByteArray::fromBase64(MessagingUtil::stripIdPrefix(id).toLatin1())); |
184 |
184 |
185 #ifdef _WIN32_WCE |
185 #ifdef _WIN32_WCE |
186 idStream >> d_ptr->_entryId; |
186 idStream >> d_ptr->_entryId; |
187 #else |
187 #else |
188 idStream >> d_ptr->_messageRecordKey; |
188 idStream >> d_ptr->_messageRecordKey; |
268 } |
268 } |
269 |
269 |
270 QString QMessageId::toString() const |
270 QString QMessageId::toString() const |
271 { |
271 { |
272 if (!isValid()) |
272 if (!isValid()) |
273 return QString(); |
273 return MessagingUtil::addIdPrefix(QString()); |
274 |
274 |
275 #ifndef _WIN32_WCE |
275 #ifndef _WIN32_WCE |
276 if (d_ptr->_messageRecordKey.isEmpty()) |
276 if (d_ptr->_messageRecordKey.isEmpty()) |
277 d_ptr->_messageRecordKey = QMessageIdPrivate::messageRecordKey(*this); |
277 d_ptr->_messageRecordKey = QMessageIdPrivate::messageRecordKey(*this); |
278 #endif |
278 #endif |
288 encodedIdStream << d_ptr->_messageRecordKey; |
288 encodedIdStream << d_ptr->_messageRecordKey; |
289 #endif |
289 #endif |
290 encodedIdStream << d_ptr->_folderRecordKey; |
290 encodedIdStream << d_ptr->_folderRecordKey; |
291 encodedIdStream << d_ptr->_storeRecordKey; |
291 encodedIdStream << d_ptr->_storeRecordKey; |
292 |
292 |
293 return WinHelpers::addIdPrefix(encodedId.toBase64()); |
293 return MessagingUtil::addIdPrefix(encodedId.toBase64()); |
294 } |
294 } |
295 |
295 |
296 bool QMessageId::isValid() const |
296 bool QMessageId::isValid() const |
297 { |
297 { |
298 return (d_ptr && !d_ptr->_storeRecordKey.isEmpty() && !d_ptr->_entryId.isEmpty()); |
298 return (d_ptr && !d_ptr->_storeRecordKey.isEmpty() && !d_ptr->_entryId.isEmpty()); |