equal
deleted
inserted
replaced
40 ****************************************************************************/ |
40 ****************************************************************************/ |
41 #include "qmessageaccountid_p.h" |
41 #include "qmessageaccountid_p.h" |
42 #include <QByteArray> |
42 #include <QByteArray> |
43 #include <QDataStream> |
43 #include <QDataStream> |
44 #include <MAPIUtil.h> |
44 #include <MAPIUtil.h> |
|
45 #include <messagingutil_p.h> |
45 |
46 |
46 QTM_BEGIN_NAMESPACE |
47 QTM_BEGIN_NAMESPACE |
47 |
48 |
48 #ifdef _WIN32_WCE |
49 #ifdef _WIN32_WCE |
49 |
50 |
88 } |
89 } |
89 |
90 |
90 QMessageAccountId::QMessageAccountId(const QString& id) |
91 QMessageAccountId::QMessageAccountId(const QString& id) |
91 : d_ptr(new QMessageAccountIdPrivate(this)) |
92 : d_ptr(new QMessageAccountIdPrivate(this)) |
92 { |
93 { |
93 QDataStream idStream(QByteArray::fromBase64(WinHelpers::stripIdPrefix(id).toLatin1())); |
94 QDataStream idStream(QByteArray::fromBase64(MessagingUtil::stripIdPrefix(id).toLatin1())); |
94 idStream >> d_ptr->_storeRecordKey; |
95 idStream >> d_ptr->_storeRecordKey; |
95 } |
96 } |
96 |
97 |
97 QMessageAccountId::~QMessageAccountId() |
98 QMessageAccountId::~QMessageAccountId() |
98 { |
99 { |
126 } |
127 } |
127 |
128 |
128 QString QMessageAccountId::toString() const |
129 QString QMessageAccountId::toString() const |
129 { |
130 { |
130 if (!isValid()) |
131 if (!isValid()) |
131 return QString(); |
132 return MessagingUtil::addIdPrefix(QString()); |
132 |
133 |
133 QByteArray encodedId; |
134 QByteArray encodedId; |
134 QDataStream encodedIdStream(&encodedId, QIODevice::WriteOnly); |
135 QDataStream encodedIdStream(&encodedId, QIODevice::WriteOnly); |
135 encodedIdStream << d_ptr->_storeRecordKey; |
136 encodedIdStream << d_ptr->_storeRecordKey; |
136 |
137 |
137 return WinHelpers::addIdPrefix(encodedId.toBase64()); |
138 return MessagingUtil::addIdPrefix(encodedId.toBase64()); |
138 } |
139 } |
139 |
140 |
140 bool QMessageAccountId::isValid() const |
141 bool QMessageAccountId::isValid() const |
141 { |
142 { |
142 return !d_ptr->_storeRecordKey.isEmpty(); |
143 return !d_ptr->_storeRecordKey.isEmpty(); |