summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex <qt-info@nokia.com>2011-04-14 13:47:26 +1000
committerAlex <qt-info@nokia.com>2011-04-14 13:47:26 +1000
commit67339ec33b9c628a31f425b659210051db3593b0 (patch)
tree0e68b317a8868b09a0d611616285413c4868c81e
parent5b6899b53afbd0dff51d5f3de16e3acd5b9d8886 (diff)
parent30a7d01c8edbb0ba261054a5b4bc4fcf6a127b00 (diff)
Merge branch '1.1' of ../qtmobility into master-from-1.1
Conflicts: doc/config/qt-html-templates-online.qdocconf doc/config/qtmobility-project.qdocconf doc/doc.pri plugins/multimedia/qt7/qt7serviceplugin.h plugins/multimedia/qt7/qt7serviceplugin.mm src/organizer/qorganizermanager.cpp src/organizer/qorganizermanager_p.cpp src/organizer/qorganizermanager_p.h src/systeminfo/qsysteminfo_simulator_p.h tests/auto/qorganizermanager/tst_qorganizermanager.cpp
-rw-r--r--examples/slideshow/slideshow.cpp3
-rw-r--r--features/qtservice.prf4
-rw-r--r--plugins/contacts/symbian/contactsmodel/groupsql/cntmodel.iby7
-rw-r--r--plugins/contacts/symbian/contactsmodel/groupsql/cntsrv.mmp2
-rw-r--r--plugins/contacts/symbian/plugin/deploy.pri3
-rw-r--r--plugins/contacts/symbian/plugin/plugin.pro6
-rw-r--r--plugins/declarative/contacts/qdeclarativecontactimageprovider.cpp12
-rw-r--r--plugins/multimedia/qt7/mediaplayer/qt7playercontrol.mm7
-rw-r--r--plugins/multimedia/qt7/mediaplayer/qt7playersession.h1
-rw-r--r--plugins/multimedia/qt7/mediaplayer/qt7playersession.mm48
-rw-r--r--plugins/multimedia/qt7/qt7serviceplugin.h14
-rw-r--r--plugins/multimedia/qt7/qt7serviceplugin.mm38
-rw-r--r--src/contacts/qcontactmanager.cpp195
-rw-r--r--src/contacts/qcontactmanager_p.cpp10
-rw-r--r--src/contacts/qcontactmanager_p.h37
-rw-r--r--src/messaging/win32wce/qmailaddress.cpp62
-rw-r--r--src/messaging/win32wce/qmailcodec.cpp108
-rw-r--r--src/messaging/win32wce/qmailid.cpp60
-rw-r--r--src/messaging/win32wce/qmailmessage.cpp736
-rw-r--r--src/messaging/win32wce/qmailmessagefwd.cpp55
-rw-r--r--src/messaging/win32wce/qmailtimestamp.cpp15
-rw-r--r--src/multimedia/qcameraflashcontrol.cpp2
-rw-r--r--src/multimedia/qmediarecorder.cpp3
-rw-r--r--src/multimedia/qtmedianamespace.qdoc3
-rw-r--r--src/multimedia/qvideowidget.cpp2
-rw-r--r--src/organizer/qorganizermanager.cpp141
-rw-r--r--src/organizer/qorganizermanager_p.cpp10
-rw-r--r--src/organizer/qorganizermanager_p.h37
-rw-r--r--src/organizer/requests/qorganizercollectionremoverequest.cpp2
-rw-r--r--src/organizer/requests/qorganizercollectionsaverequest.cpp2
-rw-r--r--src/versit/qversitcontactpluginloader_p.cpp1
-rw-r--r--tests/auto/qcontactmanager/tst_qcontactmanager.cpp55
-rw-r--r--tests/auto/qorganizermanager/tst_qorganizermanager.cpp66
-rw-r--r--tests/auto/qremoteserviceregister/tst_qremoteserviceregister.cpp54
34 files changed, 1032 insertions, 769 deletions
diff --git a/examples/slideshow/slideshow.cpp b/examples/slideshow/slideshow.cpp
index e7f1529c8d..5c877de664 100644
--- a/examples/slideshow/slideshow.cpp
+++ b/examples/slideshow/slideshow.cpp
@@ -69,9 +69,6 @@ SlideShow::SlideShow(QWidget *parent)
connect(playlist, SIGNAL(loaded()), this, SLOT(playlistLoaded()));
connect(playlist, SIGNAL(loadFailed()), this, SLOT(playlistLoadFailed()));
- connect(playlist, SIGNAL(loaded()), this, SLOT(playlistLoaded()));
- connect(playlist, SIGNAL(loadFailed()), this, SLOT(playlistLoadFailed()));
-
QVideoWidget *videoWidget = new QVideoWidget;
imageViewer->setVideoOutput(videoWidget);
diff --git a/features/qtservice.prf b/features/qtservice.prf
index 6ae05a619c..ed7f522440 100644
--- a/features/qtservice.prf
+++ b/features/qtservice.prf
@@ -18,8 +18,8 @@ symbian {
qtservice_descriptors = $$QTSERVICE.DESCRIPTOR
for(descriptor, qtservice_descriptors) {
BASENAME = $$basename(descriptor)
- BLD_INF_RULES.prj_exports += "$$descriptor $${EPOCROOT}epoc32/winscw/c/private/2002AC7F/des/$$BASENAME"
- BLD_INF_RULES.prj_exports += "$$descriptor $${EPOCROOT}epoc32/data/z/private/2002AC7F/des/$$BASENAME"
+ BLD_INF_RULES.prj_exports += "$$descriptor /epoc32/winscw/c/private/2002AC7F/des/$$BASENAME"
+ BLD_INF_RULES.prj_exports += "$$descriptor /epoc32/data/z/private/2002AC7F/des/$$BASENAME"
}
symbian-sbsv2{
diff --git a/plugins/contacts/symbian/contactsmodel/groupsql/cntmodel.iby b/plugins/contacts/symbian/contactsmodel/groupsql/cntmodel.iby
index 21bd0f29c6..5c3dc6e849 100644
--- a/plugins/contacts/symbian/contactsmodel/groupsql/cntmodel.iby
+++ b/plugins/contacts/symbian/contactsmodel/groupsql/cntmodel.iby
@@ -28,13 +28,8 @@ REM Contact Model
REM Log Engine contact matching plug-in implementation
#include <cntmatchlog.iby>
-REM Configurable heap size for contact server.
-#ifndef CONTACT_SERVER_MAX_HEAPSIZE
-#define CONTACT_SERVER_MAX_HEAPSIZE 0x200000
-#endif
-
#ifndef FF_QT_IN_UDA
-file=ABI_DIR/BUILD_DIR/cntsrv.exe System/Programs/cntsrv.exe heapmax=CONTACT_SERVER_MAX_HEAPSIZE
+file=ABI_DIR/BUILD_DIR/cntsrv.exe System/Programs/cntsrv.exe
file=ABI_DIR/BUILD_DIR/cntmodel.dll System/Libs/cntmodel.dll
file=ABI_DIR/BUILD_DIR/cntview.dll System/Libs/cntview.dll
diff --git a/plugins/contacts/symbian/contactsmodel/groupsql/cntsrv.mmp b/plugins/contacts/symbian/contactsmodel/groupsql/cntsrv.mmp
index 31753732a8..91fbee6221 100644
--- a/plugins/contacts/symbian/contactsmodel/groupsql/cntsrv.mmp
+++ b/plugins/contacts/symbian/contactsmodel/groupsql/cntsrv.mmp
@@ -19,7 +19,7 @@
#include "cntmodel.mmh"
-EPOCHEAPSIZE 0x1000 0x200000
+EPOCHEAPSIZE 0x1000 0x800000
#include "../group/cntsrv.mmp"
diff --git a/plugins/contacts/symbian/plugin/deploy.pri b/plugins/contacts/symbian/plugin/deploy.pri
new file mode 100644
index 0000000000..365979cd3a
--- /dev/null
+++ b/plugins/contacts/symbian/plugin/deploy.pri
@@ -0,0 +1,3 @@
+PUBLIC_HEADERS += inc/cntbackendsdefs.h
+CONFIG += middleware
+include(../../../../features/deploy.pri) \ No newline at end of file
diff --git a/plugins/contacts/symbian/plugin/plugin.pro b/plugins/contacts/symbian/plugin/plugin.pro
index 53e3c0ae51..5425cf2c01 100644
--- a/plugins/contacts/symbian/plugin/plugin.pro
+++ b/plugins/contacts/symbian/plugin/plugin.pro
@@ -3,8 +3,8 @@ CONFIG += plugin
TARGET = $$qtLibraryTarget(qtcontacts_symbian)
PLUGIN_TYPE=contacts
-include(../../../../common.pri)
include(symbian_defines.pri)
+include(deploy.pri)
symbian: {
load(data_caging_paths)
@@ -144,8 +144,4 @@ symbian: {
symbianplugin.sources = $${TARGET}.dll
symbianplugin.path = $${QT_PLUGINS_BASE_DIR}/$${PLUGIN_TYPE}
DEPLOYMENT += symbianplugin
-
- # Public header
- headers.sources = inc/cntbackendsdefs.h
- for(header, headers.sources):BLD_INF_RULES.prj_exports += "$$header $$basename(header)"
}
diff --git a/plugins/declarative/contacts/qdeclarativecontactimageprovider.cpp b/plugins/declarative/contacts/qdeclarativecontactimageprovider.cpp
index e429e1243b..a319be60e0 100644
--- a/plugins/declarative/contacts/qdeclarativecontactimageprovider.cpp
+++ b/plugins/declarative/contacts/qdeclarativecontactimageprovider.cpp
@@ -61,18 +61,18 @@ QImage ContactThumbnailImageProvider::requestImage(const QString &id, QSize *siz
}
/* url format:
- image://thumbnail/{manager.contactid}
+ image://thumbnail/{managerUri.contactid}
*/
- QString managerName = id.split('.').first();
+ QString managerUri = id.split('.').first();
QString localId = id.split('.').last();
QContactManager* manager = 0;
- if (m_managers.contains(managerName)) {
- manager = m_managers.value(managerName);
+ if (m_managers.contains(managerUri)) {
+ manager = m_managers.value(managerUri);
} else {
- manager = new QContactManager(managerName);
- m_managers.insert(managerName, manager);
+ manager = QContactManager::fromUri(managerUri);
+ m_managers.insert(managerUri, manager);
}
QContact c = manager->contact(localId.toInt());
diff --git a/plugins/multimedia/qt7/mediaplayer/qt7playercontrol.mm b/plugins/multimedia/qt7/mediaplayer/qt7playercontrol.mm
index c4734d1a5d..ddfcc35700 100644
--- a/plugins/multimedia/qt7/mediaplayer/qt7playercontrol.mm
+++ b/plugins/multimedia/qt7/mediaplayer/qt7playercontrol.mm
@@ -117,12 +117,7 @@ bool QT7PlayerControl::isSeekable() const
QMediaTimeRange QT7PlayerControl::availablePlaybackRanges() const
{
- QMediaTimeRange result;
-
- if (isSeekable())
- result.addInterval(0, duration());
-
- return result;
+ return m_session->availablePlaybackRanges();
}
qreal QT7PlayerControl::playbackRate() const
diff --git a/plugins/multimedia/qt7/mediaplayer/qt7playersession.h b/plugins/multimedia/qt7/mediaplayer/qt7playersession.h
index de758bc831..5aaa1e3504 100644
--- a/plugins/multimedia/qt7/mediaplayer/qt7playersession.h
+++ b/plugins/multimedia/qt7/mediaplayer/qt7playersession.h
@@ -95,6 +95,7 @@ public:
bool isVideoAvailable() const;
bool isSeekable() const;
+ QMediaTimeRange availablePlaybackRanges() const;
qreal playbackRate() const;
diff --git a/plugins/multimedia/qt7/mediaplayer/qt7playersession.mm b/plugins/multimedia/qt7/mediaplayer/qt7playersession.mm
index 45b207fb11..61ccba3e49 100644
--- a/plugins/multimedia/qt7/mediaplayer/qt7playersession.mm
+++ b/plugins/multimedia/qt7/mediaplayer/qt7playersession.mm
@@ -263,6 +263,44 @@ bool QT7PlayerSession::isSeekable() const
return true;
}
+#ifndef QUICKTIME_C_API_AVAILABLE
+@interface QTMovie(QtExtensions)
+- (NSArray*)loadedRanges;
+- (QTTime)maxTimeLoaded;
+@end
+#endif
+
+QMediaTimeRange QT7PlayerSession::availablePlaybackRanges() const
+{
+ QTMovie *movie = (QTMovie*)m_QTMovie;
+#ifndef QUICKTIME_C_API_AVAILABLE
+ AutoReleasePool pool;
+ if ([movie respondsToSelector:@selector(loadedRanges)]) {
+ QMediaTimeRange rc;
+ NSArray *r = [movie loadedRanges];
+ for (NSValue *tr in r) {
+ QTTimeRange timeRange = [tr QTTimeRangeValue];
+ qint64 startTime = qint64(float(timeRange.time.timeValue) / timeRange.time.timeScale * 1000.0);
+ rc.addInterval(startTime, startTime + qint64(float(timeRange.duration.timeValue) / timeRange.duration.timeScale * 1000.0));
+ }
+ return rc;
+ }
+ else if ([movie respondsToSelector:@selector(maxTimeLoaded)]) {
+ QTTime loadedTime = [movie maxTimeLoaded];
+ return QMediaTimeRange(0, qint64(float(loadedTime.timeValue) / loadedTime.timeScale * 1000.0));
+ }
+#else
+ TimeValue loadedTime;
+ TimeScale scale;
+ Movie m = [movie quickTimeMovie];
+ if (GetMaxLoadedTimeInMovie(m, &loadedTime) == noErr) {
+ scale = GetMovieTimeScale(m);
+ return QMediaTimeRange(0, qint64(float(loadedTime) / scale * 1000.0f));
+ }
+#endif
+ return QMediaTimeRange(0, duration());
+}
+
qreal QT7PlayerSession::playbackRate() const
{
return m_rate;
@@ -635,8 +673,14 @@ void QT7PlayerSession::processLoadStateChange()
newStatus = isPlaying ? QMediaPlayer::BufferedMedia : QMediaPlayer::LoadedMedia;
} else if (state >= kMovieLoadStatePlayable)
newStatus = isPlaying ? QMediaPlayer::BufferingMedia : QMediaPlayer::LoadingMedia;
- else if (state >= kMovieLoadStateLoading)
- newStatus = isPlaying ? QMediaPlayer::StalledMedia : QMediaPlayer::LoadingMedia;
+ else if (state >= kMovieLoadStateLoading) {
+ if (!isPlaying)
+ newStatus = QMediaPlayer::LoadingMedia;
+ else if (m_mediaStatus >= QMediaPlayer::LoadedMedia)
+ newStatus = QMediaPlayer::StalledMedia;
+ else
+ newStatus = QMediaPlayer::LoadingMedia;
+ }
if (state >= kMovieLoadStatePlayable &&
m_state == QMediaPlayer::PlayingState &&
diff --git a/plugins/multimedia/qt7/qt7serviceplugin.h b/plugins/multimedia/qt7/qt7serviceplugin.h
index 4772ddaf9f..fb0a546b33 100644
--- a/plugins/multimedia/qt7/qt7serviceplugin.h
+++ b/plugins/multimedia/qt7/qt7serviceplugin.h
@@ -47,15 +47,27 @@
QT_BEGIN_NAMESPACE
-class QT7ServicePlugin : public QMediaServiceProviderPlugin, public QMediaServiceFeaturesInterface
+class QT7ServicePlugin
+ : public QMediaServiceProviderPlugin
+ , public QMediaServiceSupportedFormatsInterface
+ , public QMediaServiceFeaturesInterface
{
Q_INTERFACES(QMediaServiceFeaturesInterface)
public:
+ QT7ServicePlugin();
+
QStringList keys() const;
QMediaService* create(QString const& key);
void release(QMediaService *service);
QMediaServiceProviderHint::Features supportedFeatures(const QByteArray &service) const;
+ QtMultimediaKit::SupportEstimate hasSupport(const QString &mimeType, const QStringList& codecs) const;
+ QStringList supportedMimeTypes() const;
+
+private:
+ void buildSupportedTypes();
+
+ QStringList m_supportedMimeTypes;
};
QT_END_NAMESPACE
diff --git a/plugins/multimedia/qt7/qt7serviceplugin.mm b/plugins/multimedia/qt7/qt7serviceplugin.mm
index 114604e546..a692e190fb 100644
--- a/plugins/multimedia/qt7/qt7serviceplugin.mm
+++ b/plugins/multimedia/qt7/qt7serviceplugin.mm
@@ -39,9 +39,13 @@
**
****************************************************************************/
+#import <Foundation/Foundation.h>
+#import <QTKit/QTKit.h>
+
#include <QtCore/qstring.h>
#include <QtCore/qdebug.h>
+#include "qt7backend.h"
#include "qt7serviceplugin.h"
#include "qt7playerservice.h"
@@ -49,6 +53,12 @@
QT_BEGIN_NAMESPACE
+
+QT7ServicePlugin::QT7ServicePlugin()
+{
+ buildSupportedTypes();
+}
+
QStringList QT7ServicePlugin::keys() const
{
return QStringList()
@@ -86,6 +96,34 @@ QMediaServiceProviderHint::Features QT7ServicePlugin::supportedFeatures(
return QMediaServiceProviderHint::Features();
}
+QtMultimediaKit::SupportEstimate QT7ServicePlugin::hasSupport(const QString &mimeType, const QStringList& codecs) const
+{
+ Q_UNUSED(codecs);
+
+ if (m_supportedMimeTypes.contains(mimeType))
+ return QtMultimediaKit::ProbablySupported;
+
+ return QtMultimediaKit::MaybeSupported;
+}
+
+QStringList QT7ServicePlugin::supportedMimeTypes() const
+{
+ return m_supportedMimeTypes;
+}
+
+void QT7ServicePlugin::buildSupportedTypes()
+{
+ AutoReleasePool pool;
+ NSArray *utis = [QTMovie movieTypesWithOptions:QTIncludeCommonTypes];
+ for (NSString *uti in utis) {
+ NSString* mimeType = (NSString*)UTTypeCopyPreferredTagWithClass((CFStringRef)uti, kUTTagClassMIMEType);
+ if (mimeType != 0) {
+ m_supportedMimeTypes.append(QString::fromUtf8([mimeType UTF8String]));
+ [mimeType release];
+ }
+ }
+}
+
Q_EXPORT_PLUGIN2(qtmedia_qt7engine, QT7ServicePlugin);
QT_END_NAMESPACE
diff --git a/src/contacts/qcontactmanager.cpp b/src/contacts/qcontactmanager.cpp
index dde55ed953..88a338db8d 100644
--- a/src/contacts/qcontactmanager.cpp
+++ b/src/contacts/qcontactmanager.cpp
@@ -425,7 +425,7 @@ Q_DEFINE_LATIN1_CONSTANT(QContactManager::ParameterValueOnlyOtherProcesses, "Onl
*/
QContactManager::Error QContactManager::error() const
{
- return d->m_error;
+ return d->m_lastError;
}
/*!
@@ -439,7 +439,7 @@ QContactManager::Error QContactManager::error() const
*/
QMap<int, QContactManager::Error> QContactManager::errorMap() const
{
- return d->m_errorMap;
+ return d->m_lastErrorMap;
}
/*!
@@ -447,9 +447,8 @@ QMap<int, QContactManager::Error> QContactManager::errorMap() const
*/
QList<QContactLocalId> QContactManager::contactIds(const QList<QContactSortOrder>& sortOrders) const
{
- d->m_error = QContactManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->contactIds(QContactFilter(), sortOrders, &d->m_error);
+ QContactManagerSyncOpErrorHolder h(this);
+ return d->m_engine->contactIds(QContactFilter(), sortOrders, &h.error);
}
/*!
@@ -458,9 +457,8 @@ QList<QContactLocalId> QContactManager::contactIds(const QList<QContactSortOrder
*/
QList<QContactLocalId> QContactManager::contactIds(const QContactFilter& filter, const QList<QContactSortOrder>& sortOrders) const
{
- d->m_error = QContactManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->contactIds(filter, sortOrders, &d->m_error);
+ QContactManagerSyncOpErrorHolder h(this);
+ return d->m_engine->contactIds(filter, sortOrders, &h.error);
}
/*!
@@ -476,9 +474,8 @@ QList<QContactLocalId> QContactManager::contactIds(const QContactFilter& filter,
*/
QList<QContact> QContactManager::contacts(const QList<QContactSortOrder>& sortOrders, const QContactFetchHint& fetchHint) const
{
- d->m_error = QContactManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->contacts(QContactFilter(), sortOrders, fetchHint, &d->m_error);
+ QContactManagerSyncOpErrorHolder h(this);
+ return d->m_engine->contacts(QContactFilter(), sortOrders, fetchHint, &h.error);
}
/*!
@@ -497,9 +494,8 @@ QList<QContact> QContactManager::contacts(const QList<QContactSortOrder>& sortOr
*/
QList<QContact> QContactManager::contacts(const QContactFilter& filter, const QList<QContactSortOrder>& sortOrders, const QContactFetchHint& fetchHint) const
{
- d->m_error = QContactManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->contacts(filter, sortOrders, fetchHint, &d->m_error);
+ QContactManagerSyncOpErrorHolder h(this);
+ return d->m_engine->contacts(filter, sortOrders, fetchHint, &h.error);
}
/*!
@@ -519,9 +515,8 @@ QList<QContact> QContactManager::contacts(const QContactFilter& filter, const QL
*/
QContact QContactManager::contact(const QContactLocalId& contactId, const QContactFetchHint& fetchHint) const
{
- d->m_error = QContactManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->contact(contactId, fetchHint, &d->m_error);
+ QContactManagerSyncOpErrorHolder h(this);
+ return d->m_engine->contact(contactId, fetchHint, &h.error);
}
/*!
@@ -544,15 +539,9 @@ QContact QContactManager::contact(const QContactLocalId& contactId, const QConta
*/
QList<QContact> QContactManager::contacts(const QList<QContactLocalId>& localIds, const QContactFetchHint &fetchHint, QMap<int, QContactManager::Error> *errorMap) const
{
- d->m_error = QContactManager::NoError;
- d->m_errorMap.clear();
+ QContactManagerSyncOpErrorHolder h(this, errorMap);
- QList<QContact> retn = d->m_engine->contacts(localIds, fetchHint, &d->m_errorMap, &d->m_error);
-
- if (errorMap)
- *errorMap = d->m_errorMap;
-
- return retn;
+ return d->m_engine->contacts(localIds, fetchHint, &h.errorMap, &h.error);
}
/*!
@@ -593,12 +582,12 @@ QList<QContact> QContactManager::contacts(const QList<QContactLocalId>& localIds
*/
bool QContactManager::saveContact(QContact* contact)
{
- d->m_errorMap.clear();
+ QContactManagerSyncOpErrorHolder h(this);
+
if (contact) {
- d->m_error = QContactManager::NoError;
- return d->m_engine->saveContact(contact, &d->m_error);
+ return d->m_engine->saveContact(contact, &h.error);
} else {
- d->m_error = QContactManager::BadArgumentError;
+ h.error = QContactManager::BadArgumentError;
return false;
}
}
@@ -611,9 +600,8 @@ bool QContactManager::saveContact(QContact* contact)
*/
bool QContactManager::removeContact(const QContactLocalId& contactId)
{
- d->m_error = QContactManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->removeContact(contactId, &d->m_error);
+ QContactManagerSyncOpErrorHolder h(this);
+ return d->m_engine->removeContact(contactId, &h.error);
}
/*!
@@ -632,20 +620,14 @@ bool QContactManager::removeContact(const QContactLocalId& contactId)
*/
bool QContactManager::saveContacts(QList<QContact>* contacts, QMap<int, QContactManager::Error>* errorMap)
{
- bool retn = false;
- d->m_errorMap.clear();
+ QContactManagerSyncOpErrorHolder h(this, errorMap);
if (contacts) {
- d->m_error = QContactManager::NoError;
- retn = d->m_engine->saveContacts(contacts, &d->m_errorMap, &d->m_error);
+ return d->m_engine->saveContacts(contacts, &h.errorMap, &h.error);
} else {
- d->m_error =QContactManager::BadArgumentError;
+ h.error = QContactManager::BadArgumentError;
+ return false;
}
-
- if (errorMap)
- *errorMap = d->m_errorMap;
-
- return retn;
}
/*!
@@ -668,20 +650,14 @@ bool QContactManager::saveContacts(QList<QContact>* contacts, QMap<int, QContact
*/
bool QContactManager::saveContacts(QList<QContact>* contacts, const QStringList& definitionMask, QMap<int, QContactManager::Error>* errorMap)
{
- bool retn = false;
- d->m_errorMap.clear();
+ QContactManagerSyncOpErrorHolder h(this, errorMap);
if (contacts) {
- d->m_error = QContactManager::NoError;
- retn = d->m_engine->saveContacts(contacts, definitionMask, &d->m_errorMap, &d->m_error);
+ return d->m_engine->saveContacts(contacts, definitionMask, &h.errorMap, &h.error);
} else {
- d->m_error =QContactManager::BadArgumentError;
+ h.error = QContactManager::BadArgumentError;
+ return false;
}
-
- if (errorMap)
- *errorMap = d->m_errorMap;
-
- return retn;
}
/*!
@@ -710,20 +686,14 @@ bool QContactManager::saveContacts(QList<QContact>* contacts, const QStringList&
*/
bool QContactManager::removeContacts(const QList<QContactLocalId>& contactIds, QMap<int, QContactManager::Error>* errorMap)
{
- bool retn = false;
- d->m_errorMap.clear();
+ QContactManagerSyncOpErrorHolder h(this, errorMap);
if (!contactIds.isEmpty()) {
- d->m_error = QContactManager::NoError;
- retn = d->m_engine->removeContacts(contactIds, &d->m_errorMap, &d->m_error);
+ return d->m_engine->removeContacts(contactIds, &h.errorMap, &h.error);
} else {
- d->m_error = QContactManager::BadArgumentError;
+ h.error = QContactManager::BadArgumentError;
+ return false;
}
-
- if (errorMap)
- *errorMap = d->m_errorMap;
-
- return retn;
}
/*!
@@ -734,9 +704,8 @@ bool QContactManager::removeContacts(const QList<QContactLocalId>& contactIds, Q
*/
QContact QContactManager::compatibleContact(const QContact& original)
{
- d->m_error = QContactManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->compatibleContact(original, &d->m_error);
+ QContactManagerSyncOpErrorHolder h(this);
+ return d->m_engine->compatibleContact(original, &h.error);
}
/*!
@@ -750,9 +719,8 @@ QContact QContactManager::compatibleContact(const QContact& original)
*/
QString QContactManager::synthesizedContactDisplayLabel(const QContact& contact) const
{
- d->m_error = QContactManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->synthesizedDisplayLabel(contact, &d->m_error);
+ QContactManagerSyncOpErrorHolder h(this);
+ return d->m_engine->synthesizedDisplayLabel(contact, &h.error);
}
/*!
@@ -775,12 +743,11 @@ QString QContactManager::synthesizedContactDisplayLabel(const QContact& contact)
*/
void QContactManager::synthesizeContactDisplayLabel(QContact *contact) const
{
- d->m_errorMap.clear();
+ QContactManagerSyncOpErrorHolder h(this);
if (contact) {
- d->m_error = QContactManager::NoError;
- QContactManagerEngine::setContactDisplayLabel(contact, d->m_engine->synthesizedDisplayLabel(*contact, &d->m_error));
+ QContactManagerEngine::setContactDisplayLabel(contact, d->m_engine->synthesizedDisplayLabel(*contact, &h.error));
} else {
- d->m_error = QContactManager::BadArgumentError;
+ h.error = QContactManager::BadArgumentError;
}
}
@@ -797,9 +764,8 @@ void QContactManager::synthesizeContactDisplayLabel(QContact *contact) const
*/
bool QContactManager::setSelfContactId(const QContactLocalId& contactId)
{
- d->m_error = QContactManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->setSelfContactId(contactId, &d->m_error);
+ QContactManagerSyncOpErrorHolder h(this);
+ return d->m_engine->setSelfContactId(contactId, &h.error);
}
/*!
@@ -811,9 +777,8 @@ bool QContactManager::setSelfContactId(const QContactLocalId& contactId)
*/
QContactLocalId QContactManager::selfContactId() const
{
- d->m_error = QContactManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->selfContactId(&d->m_error);
+ QContactManagerSyncOpErrorHolder h(this);
+ return d->m_engine->selfContactId(&h.error);
}
/*!
@@ -822,9 +787,8 @@ QContactLocalId QContactManager::selfContactId() const
*/
QList<QContactRelationship> QContactManager::relationships(const QContactId& participantId, QContactRelationship::Role role) const
{
- d->m_error = QContactManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->relationships(QString(), participantId, role, &d->m_error);
+ QContactManagerSyncOpErrorHolder h(this);
+ return d->m_engine->relationships(QString(), participantId, role, &h.error);
}
/*!
@@ -834,9 +798,8 @@ QList<QContactRelationship> QContactManager::relationships(const QContactId& par
*/
QList<QContactRelationship> QContactManager::relationships(const QString& relationshipType, const QContactId& participantId, QContactRelationship::Role role) const
{
- d->m_error = QContactManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->relationships(relationshipType, participantId, role, &d->m_error);
+ QContactManagerSyncOpErrorHolder h(this);
+ return d->m_engine->relationships(relationshipType, participantId, role, &h.error);
}
/*!
@@ -854,12 +817,11 @@ QList<QContactRelationship> QContactManager::relationships(const QString& relati
*/
bool QContactManager::saveRelationship(QContactRelationship* relationship)
{
- d->m_errorMap.clear();
+ QContactManagerSyncOpErrorHolder h(this);
if (relationship) {
- d->m_error = QContactManager::NoError;
- return d->m_engine->saveRelationship(relationship, &d->m_error);
+ return d->m_engine->saveRelationship(relationship, &h.error);
} else {
- d->m_error =QContactManager::BadArgumentError;
+ h.error = QContactManager::BadArgumentError;
return false;
}
}
@@ -871,20 +833,14 @@ bool QContactManager::saveRelationship(QContactRelationship* relationship)
*/
bool QContactManager::saveRelationships(QList<QContactRelationship>* relationships, QMap<int, QContactManager::Error>* errorMap)
{
- bool retn = false;
- d->m_errorMap.clear();
+ QContactManagerSyncOpErrorHolder h(this, errorMap);
if (relationships) {
- d->m_error = QContactManager::NoError;
- retn = d->m_engine->saveRelationships(relationships, &d->m_errorMap, &d->m_error);
+ return d->m_engine->saveRelationships(relationships, &h.errorMap, &h.error);
} else {
- d->m_error =QContactManager::BadArgumentError;
+ h.error = QContactManager::BadArgumentError;
+ return false;
}
-
- if (errorMap)
- *errorMap = d->m_errorMap;
-
- return retn;
}
/*!
@@ -895,9 +851,8 @@ bool QContactManager::saveRelationships(QList<QContactRelationship>* relationshi
*/
bool QContactManager::removeRelationship(const QContactRelationship& relationship)
{
- d->m_error = QContactManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->removeRelationship(relationship, &d->m_error);
+ QContactManagerSyncOpErrorHolder h(this);
+ return d->m_engine->removeRelationship(relationship, &h.error);
}
@@ -908,14 +863,8 @@ bool QContactManager::removeRelationship(const QContactRelationship& relationshi
*/
bool QContactManager::removeRelationships(const QList<QContactRelationship>& relationships, QMap<int, QContactManager::Error>* errorMap)
{
- d->m_error = QContactManager::NoError;
- d->m_errorMap.clear();
- bool retn = d->m_engine->removeRelationships(relationships, &d->m_errorMap, &d->m_error);
-
- if (errorMap)
- *errorMap = d->m_errorMap;
-
- return retn;
+ QContactManagerSyncOpErrorHolder h(this, errorMap);
+ return d->m_engine->removeRelationships(relationships, &h.errorMap, &h.error);
}
/*!
@@ -924,53 +873,49 @@ bool QContactManager::removeRelationships(const QList<QContactRelationship>& rel
*/
QMap<QString, QContactDetailDefinition> QContactManager::detailDefinitions(const QString& contactType) const
{
- d->m_errorMap.clear();
+ QContactManagerSyncOpErrorHolder h(this);
if (!supportedContactTypes().contains(contactType)) {
- d->m_error =QContactManager::InvalidContactTypeError;
+ h.error = QContactManager::InvalidContactTypeError;
return QMap<QString, QContactDetailDefinition>();
}
- d->m_error = QContactManager::NoError;
- return d->m_engine->detailDefinitions(contactType, &d->m_error);
+ return d->m_engine->detailDefinitions(contactType, &h.error);
}
/*! Returns the definition identified by the given \a definitionName that is valid for the contacts whose type is the given \a contactType in this store, or a default-constructed QContactDetailDefinition if no such definition exists */
QContactDetailDefinition QContactManager::detailDefinition(const QString& definitionName, const QString& contactType) const
{
- d->m_errorMap.clear();
+ QContactManagerSyncOpErrorHolder h(this);
if (!supportedContactTypes().contains(contactType)) {
- d->m_error =QContactManager::InvalidContactTypeError;
+ h.error = QContactManager::InvalidContactTypeError;
return QContactDetailDefinition();
}
- d->m_error = QContactManager::NoError;
- return d->m_engine->detailDefinition(definitionName, contactType, &d->m_error);
+ return d->m_engine->detailDefinition(definitionName, contactType, &h.error);
}
/*! Persists the given definition \a def in the database, which is valid for contacts whose type is the given \a contactType. Returns true if the definition was saved successfully, otherwise returns false */
bool QContactManager::saveDetailDefinition(const QContactDetailDefinition& def, const QString& contactType)
{
- d->m_errorMap.clear();
+ QContactManagerSyncOpErrorHolder h(this);
if (!supportedContactTypes().contains(contactType)) {
- d->m_error =QContactManager::InvalidContactTypeError;
+ h.error = QContactManager::InvalidContactTypeError;
return false;
}
- d->m_error = QContactManager::NoError;
- return d->m_engine->saveDetailDefinition(def, contactType, &d->m_error);
+ return d->m_engine->saveDetailDefinition(def, contactType, &h.error);
}
/*! Removes the detail definition identified by \a definitionName from the database, which is valid for contacts whose type is the given \a contactType. Returns true if the definition was removed successfully, otherwise returns false */
bool QContactManager::removeDetailDefinition(const QString& definitionName, const QString& contactType)
{
- d->m_errorMap.clear();
+ QContactManagerSyncOpErrorHolder h(this);
if (!supportedContactTypes().contains(contactType)) {
- d->m_error =QContactManager::InvalidContactTypeError;
+ h.error = QContactManager::InvalidContactTypeError;
return false;
}
- d->m_error = QContactManager::NoError;
- return d->m_engine->removeDetailDefinition(definitionName, contactType, &d->m_error);
+ return d->m_engine->removeDetailDefinition(definitionName, contactType, &h.error);
}
/*!
diff --git a/src/contacts/qcontactmanager_p.cpp b/src/contacts/qcontactmanager_p.cpp
index 49e5ce4447..abbdefb188 100644
--- a/src/contacts/qcontactmanager_p.cpp
+++ b/src/contacts/qcontactmanager_p.cpp
@@ -137,7 +137,7 @@ void QContactManagerData::createEngine(const QString& managerName, const QMap<QS
/* See if we got a fast hit */
QList<QContactManagerEngineFactory*> factories = m_engines.values(builtManagerName);
- m_error = QContactManager::NoError;
+ m_lastError = QContactManager::NoError;
while(!found) {
foreach (QContactManagerEngineFactory* f, factories) {
@@ -145,7 +145,7 @@ void QContactManagerData::createEngine(const QString& managerName, const QMap<QS
if (implementationVersion == -1 ||//no given implementation version required
versions.isEmpty() || //the manager engine factory does not report any version
versions.contains(implementationVersion)) {
- QContactManagerEngine* engine = f->engine(parameters, &m_error);
+ QContactManagerEngine* engine = f->engine(parameters, &m_lastError);
// if it's a V2, use it
m_engine = qobject_cast<QContactManagerEngineV2*>(engine);
if (!m_engine && engine) {
@@ -170,13 +170,13 @@ void QContactManagerData::createEngine(const QString& managerName, const QMap<QS
// XXX remove this
// the engine factory could lie to us, so check the real implementation version
if (m_engine && (implementationVersion != -1 && m_engine->managerVersion() != implementationVersion)) {
- m_error = QContactManager::VersionMismatchError;
+ m_lastError = QContactManager::VersionMismatchError;
m_engine = 0;
}
if (!m_engine) {
- if (m_error == QContactManager::NoError)
- m_error = QContactManager::DoesNotExistError;
+ if (m_lastError == QContactManager::NoError)
+ m_lastError = QContactManager::DoesNotExistError;
m_engine = new QContactInvalidEngine();
}
}
diff --git a/src/contacts/qcontactmanager_p.h b/src/contacts/qcontactmanager_p.h
index 729e8d553f..3b346db86d 100644
--- a/src/contacts/qcontactmanager_p.h
+++ b/src/contacts/qcontactmanager_p.h
@@ -75,7 +75,7 @@ class QContactManagerData
public:
QContactManagerData()
: m_engine(0),
- m_error(QContactManager::NoError)
+ m_lastError(QContactManager::NoError)
{
}
@@ -90,13 +90,14 @@ public:
static QContactManagerEngineV2* engine(const QContactManager* manager);
QContactManagerEngineV2* m_engine;
- QContactManager::Error m_error;
- QMap<int, QContactManager::Error> m_errorMap;
+ QContactManager::Error m_lastError;
+ QMap<int, QContactManager::Error> m_lastErrorMap;
/* Manager plugins */
static QHash<QString, QContactManagerEngineFactory*> m_engines;
static QSet<QContactManager*> m_aliveEngines;
static QContactManagerData* managerData(QContactManager* manager) {return manager->d;}
+ static QContactManagerData* managerData(const QContactManager* manager) {return manager->d;} // laziness to avoid const_cast
static QList<QContactActionManagerPlugin*> m_actionManagers;
static bool m_discoveredStatic;
static QStringList m_pluginPaths;
@@ -115,6 +116,36 @@ private:
Q_DISABLE_COPY(QContactManagerData)
};
+/*
+ Helper to hold the error state of a synchronous operation - when destructed, updates the
+ manager's last error variables to the result of this operation. This means that during
+ callbacks the error state can't be modified behind the engines back. and it's more conceptually
+ correct.
+ */
+class QContactManagerSyncOpErrorHolder
+{
+public:
+ QContactManagerSyncOpErrorHolder(const QContactManager* m, QMap<int, QContactManager::Error> *pUserError = 0)
+ : error(QContactManager::NoError),
+ data(QContactManagerData::managerData(m)),
+ userError(pUserError)
+ {
+ }
+
+ ~QContactManagerSyncOpErrorHolder()
+ {
+ data->m_lastError = error;
+ data->m_lastErrorMap = errorMap;
+ if (userError)
+ *userError = errorMap;
+ }
+
+ QContactManager::Error error;
+ QContactManagerData* data;
+ QMap<int, QContactManager::Error> errorMap;
+ QMap<int, QContactManager::Error> *userError;
+};
+
QTM_END_NAMESPACE
#endif
diff --git a/src/messaging/win32wce/qmailaddress.cpp b/src/messaging/win32wce/qmailaddress.cpp
index b4ae930f9a..a49ee08259 100644
--- a/src/messaging/win32wce/qmailaddress.cpp
+++ b/src/messaging/win32wce/qmailaddress.cpp
@@ -176,10 +176,10 @@ void AddressSeparator::process(QChar character, bool quoted, bool escaped, int c
}
// RFC 2822 requires comma as the separator, but we'll allow the semi-colon as well.
- if ( ( character == ',' || character == ';' || character.isSpace()) &&
+ if ( ( character == ',' || character == ';' || character.isSpace()) &&
!_inGroup && !quoted && !escaped && commentDepth == 0 ) {
if (character.isSpace()) {
- // We'll also attempt to separate on whitespace, but we need to append it to
+ // We'll also attempt to separate on whitespace, but we need to append it to
// the token to preserve the input data
accept(character);
_tokenCompleted = true;
@@ -281,7 +281,7 @@ void AddressListGenerator::complete(TokenType type, bool hardSeparator)
QRegExp suffixPattern("\\s*/TYPE=.*");
if (suffixPattern.exactMatch(_partial)) {
type = Suffix;
- }
+ }
else {
// See if the token is a bare email address; otherwise it must be a name element
QRegExp emailPattern(QMailAddress::emailAddressPattern());
@@ -350,7 +350,7 @@ void AddressListGenerator::processPending()
if ((_pending.value(i - 1).first == Name) && ((type == Name) || (type == Group))) {
_pending.replace(i - 1, qMakePair(type, _pending.value(i - 1).second + _pending.value(i).second));
_pending.removeAt(i);
- }
+ }
else {
++i;
}
@@ -514,7 +514,7 @@ void parseMailbox(QString& input, QString& name, QString& address, QString& suff
{
name = address = input.trimmed();
}
- else
+ else
{
if (delimiters.first == -1)
{
@@ -531,9 +531,9 @@ void parseMailbox(QString& input, QString& name, QString& address, QString& suff
address = input.mid(delimiters.first + 1, (delimiters.second - delimiters.first - 1)).trimmed();
}
- if ( name.isEmpty() )
+ if ( name.isEmpty() )
name = address;
- }
+ }
}
}
@@ -587,7 +587,7 @@ QMailAddressPrivate::QMailAddressPrivate()
{
}
-QMailAddressPrivate::QMailAddressPrivate(const QString& addressText)
+QMailAddressPrivate::QMailAddressPrivate(const QString& addressText)
: _group(false),
_searchCompleted(false)
{
@@ -614,7 +614,7 @@ QMailAddressPrivate::QMailAddressPrivate(const QString& addressText)
}
}
-QMailAddressPrivate::QMailAddressPrivate(const QString& name, const QString& address)
+QMailAddressPrivate::QMailAddressPrivate(const QString& name, const QString& address)
: _group(false),
_searchCompleted(false)
{
@@ -648,7 +648,7 @@ void QMailAddressPrivate::setComponents(const QString& nameText, const QString&
_address.remove( charIndex, 1 );
}
-QMailAddressPrivate::QMailAddressPrivate(const QMailAddressPrivate& other)
+QMailAddressPrivate::QMailAddressPrivate(const QMailAddressPrivate& other)
: QSharedData(other),
_searchCompleted(false)
{
@@ -783,13 +783,13 @@ QString QMailAddressPrivate::toString(bool forceDelimited) const
return result;
}
-template <typename Stream>
+template <typename Stream>
void QMailAddressPrivate::serialize(Stream &stream) const
{
stream << _name << _address << _suffix << _group;
}
-template <typename Stream>
+template <typename Stream>
void QMailAddressPrivate::deserialize(Stream &stream)
{
_searchCompleted = false;
@@ -805,12 +805,12 @@ void QMailAddressPrivate::deserialize(Stream &stream)
QMailAddress provides functions for splitting the address strings of messages into name and
address components, and for combining the individual components into correctly formatted
- address strings. QMailAddress can be used to manipulate the address elements exposed by the
+ address strings. QMailAddress can be used to manipulate the address elements exposed by the
QMailMessage class.
- Address strings are expected to use the format "name_part '<'address_part'>'", where
- \i name_part describes a message sender or recipient and \i address_part defines the address
- at which they can be contacted. The address component is not validated, so it can contain an
+ Address strings are expected to use the format "name_part '<'address_part'>'", where
+ \i name_part describes a message sender or recipient and \i address_part defines the address
+ at which they can be contacted. The address component is not validated, so it can contain an
email address, phone number, or any other type of textual address representation.
\sa QMailMessage
@@ -827,7 +827,7 @@ QMailAddress::QMailAddress()
/*!
Constructs a QMailAddress object, extracting the name and address components from \a addressText.
- If \a addressText cannot be separated into name and address components, both name() and address()
+ If \a addressText cannot be separated into name and address components, both name() and address()
will return the entirety of \a addressText.
\sa name(), address()
@@ -910,7 +910,7 @@ bool QMailAddress::isGroup() const
}
/*!
- Returns a list containing the individual addresses that comprise the address group.
+ Returns a list containing the individual addresses that comprise the address group.
If the address is not a group address, an empty list is returned.
\sa isGroup()
@@ -972,7 +972,7 @@ QStringList QMailAddress::toStringList(const QList<QMailAddress>& list, bool for
}
/*!
- Returns a list containing a QMailAddress object constructed from each
+ Returns a list containing a QMailAddress object constructed from each
comma-separated address in \a list.
*/
QList<QMailAddress> QMailAddress::fromStringList(const QString& list)
@@ -981,7 +981,7 @@ QList<QMailAddress> QMailAddress::fromStringList(const QString& list)
}
/*!
- Returns a list containing a QMailAddress object constructed from each
+ Returns a list containing a QMailAddress object constructed from each
address string in \a list.
*/
QList<QMailAddress> QMailAddress::fromStringList(const QStringList& list)
@@ -1018,7 +1018,7 @@ QString QMailAddress::phoneNumberPattern()
static const QString pattern("\"?" // zero-or-one:'"'
"(" // start capture
"(?:\\+ ?)?" // zero-or-one:('+', zero-or-one:space)
- "(?:\\(\\d+\\)[ -]?)?" // zero-or-one:'(', one-or-more:digits, ')', zero-or-one:separator
+ "(?:\\(\\d+\\)[ -]?)?" // zero-or-one:'(', one-or-more:digits, ')', zero-or-one:separator
"(?:\\d{1,14})" // one:(one-to-fourteen):digits
"(?:[ -]?[\\d#\\*]{1,10}){0,4}" // zero-to-four:(zero-or-one:separator), one-to-ten:(digits | '#' | '*')
"(?:" // zero-or-one:
@@ -1036,12 +1036,12 @@ QString QMailAddress::phoneNumberPattern()
/*! \internal */
QString QMailAddress::emailAddressPattern()
{
- // Taken from: http://www.regular-expressions.info/email.html, but
+ // Taken from: http://www.regular-expressions.info/email.html, but
// modified to accept uppercase characters as well as lower-case
// Also - RFC 1034 seems to prohibit domain name elements beginning
// with digits, but they exist in practise...
static const QString pattern("[A-Za-z\\d!#$%&'*+/=?^_`{|}~-]+" // one-or-more: legal chars (some punctuation permissible)
- "(?:" // zero-or-more:
+ "(?:" // zero-or-more:
"\\." // '.',
"[A-Za-z\\d!#$%&'*+/=?^_`{|}~-]+" // one-or-more: legal chars
")*" // end of optional group
@@ -1049,8 +1049,8 @@ QString QMailAddress::emailAddressPattern()
"(?:" // either:
"localhost" // 'localhost'
"|" // or:
- "(?:" // one-or-more:
- "[A-Za-z\\d]" // one: legal char,
+ "(?:" // one-or-more:
+ "[A-Za-z\\d]" // one: legal char,
"(?:" // zero-or-one:
"[A-Za-z\\d-]*[A-Za-z\\d]" // (zero-or-more: (legal char or '-'), one: legal char)
")?" // end of optional group
@@ -1065,21 +1065,21 @@ QString QMailAddress::emailAddressPattern()
return pattern;
}
-/*!
+/*!
\fn QMailAddress::serialize(Stream&) const
- \internal
+ \internal
*/
-template <typename Stream>
+template <typename Stream>
void QMailAddress::serialize(Stream &stream) const
{
d->serialize(stream);
}
-/*!
+/*!
\fn QMailAddress::deserialize(Stream&)
- \internal
+ \internal
*/
-template <typename Stream>
+template <typename Stream>
void QMailAddress::deserialize(Stream &stream)
{
d->deserialize(stream);
diff --git a/src/messaging/win32wce/qmailcodec.cpp b/src/messaging/win32wce/qmailcodec.cpp
index 4d1df48d61..a213f65bbd 100644
--- a/src/messaging/win32wce/qmailcodec.cpp
+++ b/src/messaging/win32wce/qmailcodec.cpp
@@ -71,15 +71,15 @@ int QTOPIAMAIL_EXPORT QuotedPrintableMaxLineLength = 74;
must be used that provides a policy for mapping 8-bit data to and from 7-bit ASCII characters.
This policy is implemented by overriding the encodeChunk() and decodeChunk() virtual functions.
- Using the QMailCodec interface, data can be encoded or decoded from an input QDataStream to an
+ Using the QMailCodec interface, data can be encoded or decoded from an input QDataStream to an
output QDataStream, or for convenience, from an input QByteArray to an output QByteArray.
If the data to be encoded is in unicode form, then the QMailCodec interface can be used to
convert the data to ASCII via an intermediate QTextCodec, which converts the incoming text
to a sequence of octets. The QTextCodec used is specified by the name of the encoding
- produced, or that decoded when decoding an ASCII input sequence. QMailCodec provides functions
+ produced, or that decoded when decoding an ASCII input sequence. QMailCodec provides functions
to encode from a QTextStream to a QDataStream, and to decode from a QDataStream to a QTextStream.
- For convenience, it is also possible to encode a QString to a QByteArray, and to decode a
+ For convenience, it is also possible to encode a QString to a QByteArray, and to decode a
QByteArray to a QString.
\sa QDataStream, QTextStream, QTextCodec
@@ -89,7 +89,7 @@ int QTOPIAMAIL_EXPORT QuotedPrintableMaxLineLength = 74;
\fn void QMailCodec::encodeChunk(QDataStream& out, const unsigned char* input, int length, bool finalChunk)
Overridden by derived classes to perform an encoding operation. The implementation function
- must encode \a length 8-bit octets at the location \a input, writing the resulting ASCII characters
+ must encode \a length 8-bit octets at the location \a input, writing the resulting ASCII characters
to the stream \a out. If \a finalChunk is false, further calls will be made to encodeChunk()
with continued input data. Otherwise, the encoding operation is complete.
*/
@@ -138,7 +138,7 @@ static QTextCodec* codecForName(const QByteArray& charset, bool translateAscii =
{
int index;
- if (translateAscii && encoding.contains("ascii"))
+ if (translateAscii && encoding.contains("ascii"))
{
// We'll assume the text is plain ASCII, to be extracted to Latin-1
encoding = "ISO-8859-1";
@@ -163,8 +163,8 @@ static QTextCodec* codecForName(const QByteArray& charset, bool translateAscii =
}
/*!
- Writes the data read from the stream \a in to the stream \a out, as a sequence
- of 7-bit ASCII characters. The unicode characters read from \a in are first
+ Writes the data read from the stream \a in to the stream \a out, as a sequence
+ of 7-bit ASCII characters. The unicode characters read from \a in are first
encoded to the text encoding \a charset.
\sa QTextCodec::codecForName()
@@ -178,8 +178,8 @@ void QMailCodec::encode(QDataStream& out, QTextStream& in, const QString& charse
QString chunk = in.read(MaxCharacters);
QByteArray charsetEncoded = codec->fromUnicode(chunk);
- encodeChunk(out,
- reinterpret_cast<const unsigned char*>(charsetEncoded.constData()),
+ encodeChunk(out,
+ reinterpret_cast<const unsigned char*>(charsetEncoded.constData()),
charsetEncoded.length(),
in.atEnd());
}
@@ -187,8 +187,8 @@ void QMailCodec::encode(QDataStream& out, QTextStream& in, const QString& charse
}
/*!
- Writes the data read from the stream \a in to the stream \a out, converting from
- a sequence of 7-bit ASCII characters. The characters read from \a in are
+ Writes the data read from the stream \a in to the stream \a out, converting from
+ a sequence of 7-bit ASCII characters. The characters read from \a in are
decoded from the text encoding \a charset to unicode.
\sa QTextCodec::codecForName()
@@ -200,7 +200,7 @@ void QMailCodec::decode(QTextStream& out, QDataStream& in, const QString& charse
QByteArray decoded;
{
QDataStream decodedStream(&decoded, QIODevice::WriteOnly);
-
+
char* buffer = new char[MaxCharacters];
while (!in.atEnd())
{
@@ -223,7 +223,7 @@ void QMailCodec::decode(QTextStream& out, QDataStream& in, const QString& charse
}
/*!
- Writes the data read from the stream \a in to the stream \a out, as a sequence
+ Writes the data read from the stream \a in to the stream \a out, as a sequence
of 7-bit ASCII characters.
*/
void QMailCodec::encode(QDataStream& out, QDataStream& in)
@@ -239,7 +239,7 @@ void QMailCodec::encode(QDataStream& out, QDataStream& in)
}
/*!
- Writes the data read from the stream \a in to the stream \a out, converting from
+ Writes the data read from the stream \a in to the stream \a out, converting from
a sequence of 7-bit ASCII characters.
*/
void QMailCodec::decode(QDataStream& out, QDataStream& in)
@@ -281,7 +281,7 @@ void QMailCodec::copy(QTextStream& out, QTextStream& in)
}
/*!
- Returns a QByteArray containing the string \a input, encoded to the text encoding \a charset
+ Returns a QByteArray containing the string \a input, encoded to the text encoding \a charset
and then to a sequence of 7-bit ASCII characters.
\sa QTextCodec::codecForName()
@@ -303,8 +303,8 @@ QByteArray QMailCodec::encode(const QString& input, const QString& charset)
}
/*!
- Returns a QString containing characters decoded from the text encoding \a charset, which
- are decoded from the sequence of 7-bit ASCII characters read from \a input.
+ Returns a QString containing characters decoded from the text encoding \a charset, which
+ are decoded from the sequence of 7-bit ASCII characters read from \a input.
\sa QTextCodec::codecForName()
*/
@@ -321,7 +321,7 @@ QString QMailCodec::decode(const QByteArray& input, const QString& charset)
}
/*!
- Returns a QByteArray containing the octets from \a input, encoded to a sequence of
+ Returns a QByteArray containing the octets from \a input, encoded to a sequence of
7-bit ASCII characters.
*/
QByteArray QMailCodec::encode(const QByteArray& input)
@@ -402,15 +402,15 @@ static inline unsigned char base64Index(const char ascii)
\ingroup messaginglibrary
- The Base64 character mapping scheme maps arbitrary 8-bit values into a range of 64 printable
- characters from the 7-bit ASCII set. The mapping scheme used is defined in
- \l{http://www.ietf.org/rfc/rfc2045.txt} {RFC 2045} (Multipurpose Internet Mail Extensions Part One).
+ The Base64 character mapping scheme maps arbitrary 8-bit values into a range of 64 printable
+ characters from the 7-bit ASCII set. The mapping scheme used is defined in
+ \l{http://www.ietf.org/rfc/rfc2045.txt} {RFC 2045} (Multipurpose Internet Mail Extensions Part One).
This encoding is also defined as the '"B" encoding' for 'encoded words' in
- \l{http://www.ietf.org/rfc/rfc2047.txt} {RFC 2047} (Multipurpose Internet Mail Extensions Part Three).
+ \l{http://www.ietf.org/rfc/rfc2047.txt} {RFC 2047} (Multipurpose Internet Mail Extensions Part Three).
- The Base64 scheme encodes every incoming octet regardless of its original value, and thus
+ The Base64 scheme encodes every incoming octet regardless of its original value, and thus
produces the same ratio of output length to input length for any input data sequence. Since
- Base64 encodes four output characters for every three input octets, it produces a 33%
+ Base64 encodes four output characters for every three input octets, it produces a 33%
increase in stream size when encoding.
An instance of QMailBase64Codec contains state information about the encoding or decoding
@@ -430,7 +430,7 @@ static inline unsigned char base64Index(const char ascii)
/*!
\enum QMailBase64Codec::ContentType
- This enumerated type is used to specify whether content is textual data or binary data.
+ This enumerated type is used to specify whether content is textual data or binary data.
\value Text The data is textual data; newline sequences within the data will be converted during coding.
\value Binary The data is not textual, and does not contain newline sequences.
@@ -443,7 +443,7 @@ static inline unsigned char base64Index(const char ascii)
between the local representation (for example, 0x0A on Unix) and the transmission standard
representation (0x0D 0x0A). Otherwise, the data will be coded without modification.
- The maximum number of encoded characters per output line can be specified as \a maximumLineLength.
+ The maximum number of encoded characters per output line can be specified as \a maximumLineLength.
If not specified, or specified to a non-positive value, a default value will be used.
*/
QMailBase64Codec::QMailBase64Codec(ContentType content, int maximumLineLength)
@@ -493,7 +493,7 @@ void QMailBase64Codec::encodeChunk(QDataStream& out, const unsigned char* it, in
// We can accept one more input character than accounted for
lineEnd += 1;
}
- else
+ else
{
// We must replace this character with ASCII CRLF
*_encodeBufferOut++ = CarriageReturn;
@@ -501,11 +501,11 @@ void QMailBase64Codec::encodeChunk(QDataStream& out, const unsigned char* it, in
{
*_encodeBufferOut++ = LineFeed;
}
- else
+ else
{
trailingLF = true;
}
-
+
// We can accept one fewer input character than expected, now
lineEnd -= 1;
}
@@ -641,7 +641,7 @@ static const unsigned char* QuotedPrintableValues = reinterpret_cast<const unsig
static bool requiresEscape(unsigned char input, QMailQuotedPrintableCodec::ConformanceType conformance, int charsRemaining)
{
// For both, we need to escape '=' and anything unprintable
- bool escape = ((input > MaxPrintableRange) ||
+ bool escape = ((input > MaxPrintableRange) ||
((input < MinPrintableRange) && (input != HorizontalTab) && (input != FormFeed)) ||
(input == Equals));
@@ -651,7 +651,7 @@ static bool requiresEscape(unsigned char input, QMailQuotedPrintableCodec::Confo
if (!escape && (conformance == QMailQuotedPrintableCodec::Rfc2047))
{
// We can also ignore space, since it will become an underscore
- if ((input != ExclamationMark) && (input != Asterisk) && (input != Plus) &&
+ if ((input != ExclamationMark) && (input != Asterisk) && (input != Plus) &&
(input != Minus) && (input != Slash) && (input != Underscore) && (input != Space))
{
escape = !isalnum(input);
@@ -701,23 +701,23 @@ static inline unsigned char decodeCharacter(unsigned char value)
/*!
\class QMailQuotedPrintableCodec
- \brief The QMailQuotedPrintableCodec class encodes or decodes between 8-bit data and 7-bit ASCII,
+ \brief The QMailQuotedPrintableCodec class encodes or decodes between 8-bit data and 7-bit ASCII,
using the 'quoted printable' character mapping scheme.
\ingroup messaginglibrary
The 'quoted printable' character mapping scheme maps arbitrary 8-bit values into 7-bit ASCII
characters, by replacing values that cannot be directly represented with an escape sequence.
- The mapping scheme used is defined in
- \l{http://www.ietf.org/rfc/rfc2045.txt} {RFC 2045} (Multipurpose Internet Mail Extensions Part One).
+ The mapping scheme used is defined in
+ \l{http://www.ietf.org/rfc/rfc2045.txt} {RFC 2045} (Multipurpose Internet Mail Extensions Part One).
A minor variation on the scheme is defined as the '"Q" encoding' for 'encoded words' in
- \l{http://www.ietf.org/rfc/rfc2047.txt} {RFC 2047} (Multipurpose Internet Mail Extensions Part Three).
+ \l{http://www.ietf.org/rfc/rfc2047.txt} {RFC 2047} (Multipurpose Internet Mail Extensions Part Three).
The 'quoted printable' scheme encodes only those incoming octet values that cannot be directly
- represented in ASCII, by replacing the input octet with a three-character sequence that encodes
- the numeric value of the original octet. Therefore, the ratio of input length to output length
- for any input data sequence depends on the percentage of the input that corresponds to ASCII
- values, with ASCII-like encodings producing only small increases. With an input data encoding
+ represented in ASCII, by replacing the input octet with a three-character sequence that encodes
+ the numeric value of the original octet. Therefore, the ratio of input length to output length
+ for any input data sequence depends on the percentage of the input that corresponds to ASCII
+ values, with ASCII-like encodings producing only small increases. With an input data encoding
such as Latin-1 (ISO-8859-1), the output maintains a reasonable degree of human-readability.
An instance of QMailQuotedPrintableCodec contains state information about the encoding or decoding
@@ -726,7 +726,7 @@ static inline unsigned char decodeCharacter(unsigned char value)
\code
QByteArray asciiData = acquireInput();
- // We know the data is text in Latin-1 encoding, so decode the data from
+ // We know the data is text in Latin-1 encoding, so decode the data from
// quoted printable ASCII encoding, and then decode from Latin-1 to unicode
QMailQuotedPrintableCodec decoder(QMailQuotedPrintableCodec::Text, QMailQuotedPrintableCodec::Rfc2045);
QString textData = decoder.decode(asciiData, "ISO-8859-1");
@@ -738,7 +738,7 @@ static inline unsigned char decodeCharacter(unsigned char value)
/*!
\enum QMailQuotedPrintableCodec::ContentType
- This enumerated type is used to specify whether content is textual data or binary data.
+ This enumerated type is used to specify whether content is textual data or binary data.
\value Text The data is textual data; newline sequences within the data will be converted during coding.
\value Binary The data is not textual, and does not contain newline sequences.
@@ -762,11 +762,11 @@ static inline unsigned char decodeCharacter(unsigned char value)
representation (0x0D 0x0A). Otherwise, the data will be coded without modification.
If \a conformance is QMailQuotedPrintableCodec::Rfc2047, then coding will use the mapping
- scheme of the
- \l{http://www.ietf.org/rfc/rfc2047.txt} {RFC 2047} '"Q" encoding'; otherwise the scheme defined in
+ scheme of the
+ \l{http://www.ietf.org/rfc/rfc2047.txt} {RFC 2047} '"Q" encoding'; otherwise the scheme defined in
\l{http://www.ietf.org/rfc/rfc2045.txt} {RFC 2045} will be used.
- The maximum number of encoded output characters per line can be specified as \a maximumLineLength.
+ The maximum number of encoded output characters per line can be specified as \a maximumLineLength.
If not specified, or specified to a non-positive value, a default value will be used.
*/
QMailQuotedPrintableCodec::QMailQuotedPrintableCodec(ContentType content, ConformanceType conformance, int maximumLineLength)
@@ -774,7 +774,7 @@ QMailQuotedPrintableCodec::QMailQuotedPrintableCodec(ContentType content, Confor
_conformance(conformance),
_maximumLineLength(maximumLineLength)
{
- // We're allowed up to 76 chars per output line, but the RFC isn't really clear on
+ // We're allowed up to 76 chars per output line, but the RFC isn't really clear on
// whether this includes the '=' and '\n' of a soft line break, so we'll assume they're counted
if (_maximumLineLength <= 0)
_maximumLineLength = QuotedPrintableMaxLineLength;
@@ -808,7 +808,7 @@ void QMailQuotedPrintableCodec::encodeChunk(QDataStream& out, const unsigned cha
{
// We have already encoded this character-sequence
}
- else
+ else
{
// We must replace this character with ascii CRLF
out << CarriageReturn << LineFeed;
@@ -825,7 +825,7 @@ void QMailQuotedPrintableCodec::encodeChunk(QDataStream& out, const unsigned cha
// If we can't fit this character on the line, insert a line break
if (charsRequired > _encodeLineCharsRemaining)
{
- lineBreak(out, &_encodeLineCharsRemaining, _maximumLineLength);
+ lineBreak(out, &_encodeLineCharsRemaining, _maximumLineLength);
// We may no longer need the encoding after the line break
if (input == Space || (input == HorizontalTab && _conformance != Rfc2047))
@@ -845,7 +845,7 @@ void QMailQuotedPrintableCodec::encodeChunk(QDataStream& out, const unsigned cha
_encodeLineCharsRemaining -= charsRequired;
if ((_encodeLineCharsRemaining == 0) && !(finalChunk && (it == end)))
- lineBreak(out, &_encodeLineCharsRemaining, _maximumLineLength);
+ lineBreak(out, &_encodeLineCharsRemaining, _maximumLineLength);
_encodeLastChar = input;
}
@@ -924,7 +924,7 @@ void QMailQuotedPrintableCodec::decodeChunk(QDataStream& out, const char* it, in
}
}
}
- else
+ else
{
if ((input == CarriageReturn || input == LineFeed) && (_content == Text))
{
@@ -981,7 +981,7 @@ static void writeStream(QDataStream& out, const char* it, int length)
The pass-through codec is primarily useful when communicating with SMTP servers supporting the
\l{http://www.ietf.org/rfc/rfc1652.txt} {RFC 1652} (8BITMIME) extension, which permits the exchange
- of data without coding via 7-bit ASCII.
+ of data without coding via 7-bit ASCII.
A QMailPassThroughCodec can be instantiated directly, but is more likely to be used polymorphically:
@@ -989,7 +989,7 @@ static void writeStream(QDataStream& out, const char* it, int length)
// Get an object to perform the encoding required for the current server
QMailCodec* encoder = getCodecForServer(currentServer());
- // If the codec returned is a QMailPassThroughCodec, the input data will
+ // If the codec returned is a QMailPassThroughCodec, the input data will
// be written to the output stream without encoding to 7-bit ASCII
encoder->encode(outputStream, inputStream);
\endcode
@@ -1028,8 +1028,8 @@ void QMailPassThroughCodec::decodeChunk(QDataStream& out, const char* it, int le
\ingroup messaginglibrary
The QMailLineEndingCodec allows client code to use the QMailCodec interface to encode textual data
- from the local line-ending convention to the CR/LF convention required for SMTP transmission. The
- codec will convert from single carriage return or single line feed line-endings to CR/LF pairs, or
+ from the local line-ending convention to the CR/LF convention required for SMTP transmission. The
+ codec will convert from single carriage return or single line feed line-endings to CR/LF pairs, or
will preserve data already using the correct encoding.
Decoded data will have CR/LF pairs converted to \c \n.
@@ -1071,7 +1071,7 @@ void QMailLineEndingCodec::encodeChunk(QDataStream& out, const unsigned char* it
// We have already encoded this character-sequence; skip the input
begin = (it + 1);
}
- else
+ else
{
// Write the preceding characters
if (it > begin)
diff --git a/src/messaging/win32wce/qmailid.cpp b/src/messaging/win32wce/qmailid.cpp
index 48d1cff280..94c34bc940 100644
--- a/src/messaging/win32wce/qmailid.cpp
+++ b/src/messaging/win32wce/qmailid.cpp
@@ -60,7 +60,7 @@ MailId::MailId()
MailId::MailId(quint64 value)
{
d = new MailIdPrivate();
- d->id = value;
+ d->id = value;
}
MailId::MailId(const MailId& other)
@@ -72,7 +72,7 @@ MailId::~MailId()
{
}
-MailId& MailId::operator=(const MailId& other)
+MailId& MailId::operator=(const MailId& other)
{
d = other.d;
return *this;
@@ -134,9 +134,9 @@ QTextStream& operator<< (QTextStream& s, const MailId &id)
by their unique numeric internal indentifer.
A QMailAccountId instance can be tested for validity, and compared to other instances
- for equality. The numeric value of the identifier is not intrinsically meaningful
+ for equality. The numeric value of the identifier is not intrinsically meaningful
and cannot be modified.
-
+
\sa QMailAccount, QMailStore::account()
*/
@@ -147,7 +147,7 @@ QTextStream& operator<< (QTextStream& s, const MailId &id)
Q_IMPLEMENT_USER_METATYPE(QMailAccountId);
-/*!
+/*!
Construct an uninitialized QMailAccountId, for which isValid() returns false.
*/
QMailAccountId::QMailAccountId()
@@ -155,7 +155,7 @@ QMailAccountId::QMailAccountId()
{
}
-/*!
+/*!
Construct a QMailAccountId with the supplied numeric identifier \a value.
*/
QMailAccountId::QMailAccountId(quint64 value)
@@ -175,7 +175,7 @@ QMailAccountId::~QMailAccountId()
}
/*! \internal */
-QMailAccountId& QMailAccountId::operator=(const QMailAccountId& other)
+QMailAccountId& QMailAccountId::operator=(const QMailAccountId& other)
{
MailId::operator=(other);
return *this;
@@ -228,18 +228,18 @@ bool QMailAccountId::operator< (const QMailAccountId& other) const
return MailId::operator<(other);
}
-/*!
+/*!
\fn QMailAccountId::serialize(Stream&) const
- \internal
+ \internal
*/
template <typename Stream> void QMailAccountId::serialize(Stream &stream) const
{
MailId::serialize(stream);
}
-/*!
+/*!
\fn QMailAccountId::deserialize(Stream&)
- \internal
+ \internal
*/
template <typename Stream> void QMailAccountId::deserialize(Stream &stream)
{
@@ -271,9 +271,9 @@ Q_IMPLEMENT_USER_METATYPE_TYPEDEF(QMailAccountIdList, QMailAccountIdList)
by their unique numeric internal indentifer.
A QMailFolderId instance can be tested for validity, and compared to other instances
- for equality. The numeric value of the identifier is not intrinsically meaningful
+ for equality. The numeric value of the identifier is not intrinsically meaningful
and cannot be modified.
-
+
\sa QMailFolder, QMailStore::folder()
*/
@@ -284,7 +284,7 @@ Q_IMPLEMENT_USER_METATYPE_TYPEDEF(QMailAccountIdList, QMailAccountIdList)
Q_IMPLEMENT_USER_METATYPE(QMailFolderId);
-/*!
+/*!
Construct an uninitialized QMailFolderId, for which isValid() returns false.
*/
QMailFolderId::QMailFolderId()
@@ -292,7 +292,7 @@ QMailFolderId::QMailFolderId()
{
}
-/*!
+/*!
Construct a QMailFolderId corresponding to the predefined folder identifier \a id.
*/
QMailFolderId::QMailFolderId(QMailFolderFwd::PredefinedFolderId id)
@@ -300,7 +300,7 @@ QMailFolderId::QMailFolderId(QMailFolderFwd::PredefinedFolderId id)
{
}
-/*!
+/*!
Construct a QMailFolderId with the supplied numeric identifier \a value.
*/
QMailFolderId::QMailFolderId(quint64 value)
@@ -320,7 +320,7 @@ QMailFolderId::~QMailFolderId()
}
/*! \internal */
-QMailFolderId& QMailFolderId::operator=(const QMailFolderId& other)
+QMailFolderId& QMailFolderId::operator=(const QMailFolderId& other)
{
MailId::operator=(other);
return *this;
@@ -373,18 +373,18 @@ bool QMailFolderId::operator< (const QMailFolderId& other) const
return MailId::operator<(other);
}
-/*!
+/*!
\fn QMailFolderId::serialize(Stream&) const
- \internal
+ \internal
*/
template <typename Stream> void QMailFolderId::serialize(Stream &stream) const
{
MailId::serialize(stream);
}
-/*!
+/*!
\fn QMailFolderId::deserialize(Stream&)
- \internal
+ \internal
*/
template <typename Stream> void QMailFolderId::deserialize(Stream &stream)
{
@@ -416,9 +416,9 @@ Q_IMPLEMENT_USER_METATYPE_TYPEDEF(QMailFolderIdList, QMailFolderIdList)
by their unique numeric internal indentifer.
A QMailMessageId instance can be tested for validity, and compared to other instances
- for equality. The numeric value of the identifier is not intrinsically meaningful
+ for equality. The numeric value of the identifier is not intrinsically meaningful
and cannot be modified.
-
+
\sa QMailMessage, QMailStore::message()
*/
@@ -429,7 +429,7 @@ Q_IMPLEMENT_USER_METATYPE_TYPEDEF(QMailFolderIdList, QMailFolderIdList)
Q_IMPLEMENT_USER_METATYPE(QMailMessageId);
-/*!
+/*!
Construct an uninitialized QMailMessageId, for which isValid() returns false.
*/
QMailMessageId::QMailMessageId()
@@ -437,7 +437,7 @@ QMailMessageId::QMailMessageId()
{
}
-/*!
+/*!
Construct a QMailMessageId with the supplied numeric identifier \a value.
*/
QMailMessageId::QMailMessageId(quint64 value)
@@ -457,7 +457,7 @@ QMailMessageId::~QMailMessageId()
}
/*! \internal */
-QMailMessageId& QMailMessageId::operator=(const QMailMessageId& other)
+QMailMessageId& QMailMessageId::operator=(const QMailMessageId& other)
{
MailId::operator=(other);
return *this;
@@ -510,18 +510,18 @@ bool QMailMessageId::operator< (const QMailMessageId& other) const
return MailId::operator<(other);
}
-/*!
+/*!
\fn QMailMessageId::serialize(Stream&) const
- \internal
+ \internal
*/
template <typename Stream> void QMailMessageId::serialize(Stream &stream) const
{
MailId::serialize(stream);
}
-/*!
+/*!
\fn QMailMessageId::deserialize(Stream&)
- \internal
+ \internal
*/
template <typename Stream> void QMailMessageId::deserialize(Stream &stream)
{
diff --git a/src/messaging/win32wce/qmailmessage.cpp b/src/messaging/win32wce/qmailmessage.cpp
index 5cce53bacd..9f9890c2d3 100644
--- a/src/messaging/win32wce/qmailmessage.cpp
+++ b/src/messaging/win32wce/qmailmessage.cpp
@@ -138,7 +138,7 @@ static int insensitiveIndexOf(const QByteArray& content, const QByteArray& conta
const char* searchIt = it;
const char* matchIt = matchBegin + 1;
- do
+ do
{
if (matchIt == matchEnd)
return ((it - 1) - begin);
@@ -200,7 +200,7 @@ static QTextCodec* codecForName(const QByteArray& charset, bool translateAscii =
{
int index;
- if (translateAscii && encoding.contains("ascii"))
+ if (translateAscii && encoding.contains("ascii"))
{
// We'll assume the text is plain ASCII, to be extracted to Latin-1
encoding = "ISO-8859-1";
@@ -265,7 +265,7 @@ static QMailMessageBody::TransferEncoding encodingForName(const QByteArray& name
static const char* nameForEncoding(QMailMessageBody::TransferEncoding te)
{
- switch( te )
+ switch( te )
{
case QMailMessageBody::SevenBit:
return "7bit";
@@ -286,7 +286,7 @@ static const char* nameForEncoding(QMailMessageBody::TransferEncoding te)
static QMailCodec* codecForEncoding(QMailMessageBody::TransferEncoding te, bool textualData)
{
- switch( te )
+ switch( te )
{
case QMailMessageBody::NoEncoding:
case QMailMessageBody::Binary:
@@ -499,14 +499,14 @@ static QList<Token> tokenSequence(const QString& input)
const QChar* it = input.constData();
const QChar* const end = it + input.length();
- if (it != end)
+ if (it != end)
{
const QChar* token = it;
- EncodingTokenType state = ((*it) == '"' ? Quote : ((*it).isSpace() ? Whitespace : Word));
+ EncodingTokenType state = ((*it) == '"' ? Quote : ((*it).isSpace() ? Whitespace : Word));
- for (++it; it != end; ++it)
+ for (++it; it != end; ++it)
{
- if (!escaped && (*it == '\\'))
+ if (!escaped && (*it == '\\'))
{
escaped = true;
continue;
@@ -517,7 +517,7 @@ static QList<Token> tokenSequence(const QString& input)
// This quotation mark is a token by itself
result.append(makeToken(state, token, it, escaped));
- state = ((*it) == '"' && !escaped ? Quote : ((*it).isSpace() ? Whitespace : Word));
+ state = ((*it) == '"' && !escaped ? Quote : ((*it).isSpace() ? Whitespace : Word));
token = it;
}
else if (state == Whitespace)
@@ -676,8 +676,8 @@ static QString decodeParameter(const QByteArray& encodedParameter)
return decodeParameterText(parameterFormat.cap(2).toLatin1(), parameterFormat.cap(1).toLatin1());
// Treat the whole thing as input, and deafult the charset to ascii
- // This is not required by the RFC, since the input is illegal. But, it
- // seems ok since the parameter name has already indicated that the text
+ // This is not required by the RFC, since the input is illegal. But, it
+ // seems ok since the parameter name has already indicated that the text
// should be encoded...
return decodeParameterText(encodedParameter, "us-ascii");
}
@@ -710,7 +710,7 @@ static QByteArray generateEncodedParameter(const QByteArray& charset, const QByt
result.append('\'');
result.append(lang);
result.append('\'');
-
+
// Have a guess at how long the result will be
result.reserve(result.length() + (2 * text.length()));
@@ -981,7 +981,7 @@ bool QMailMessageHeaderFieldPrivate::operator== (const QMailMessageHeaderFieldPr
{
if (!insensitiveEqual(_id, other._id))
return false;
-
+
if (_content != other._content)
return false;
@@ -1062,7 +1062,7 @@ void QMailMessageHeaderFieldPrivate::setParameter(const QByteArray& name, const
_parameters.erase(matches.takeFirst());
if (matches.count() == 1)
it = matches.takeFirst();
-
+
// If the value is too long to fit on one line, break it into manageable pieces
const int maxInputLength = 78 - 9 - param.length();
@@ -1090,7 +1090,7 @@ void QMailMessageHeaderFieldPrivate::setParameter(const QByteArray& name, const
}
}
else {
- // Overwrite the remaining instance of the parameter, and place any
+ // Overwrite the remaining instance of the parameter, and place any
// following pieces immediately after
int n = pieces.count() - 1;
int initial = n;
@@ -1212,7 +1212,7 @@ QByteArray QMailMessageHeaderFieldPrivate::toString(bool includeName, bool prese
if (includeName) {
result = _id + ":";
}
-
+
if (!_content.isEmpty()) {
if (includeName)
result += ' ';
@@ -1244,7 +1244,7 @@ static void outputHeaderPart(QDataStream& out, const QByteArray& text, int* line
int wsIndex = -1;
int lastIndex = -1;
int preferredIndex = -1;
- do
+ do
{
lastIndex = wsIndex;
if ((lastIndex > 0) && (text[lastIndex - 1] == ';')) {
@@ -1344,7 +1344,7 @@ QString QMailMessageHeaderFieldPrivate::decodedContent() const
return result;
}
-template <typename Stream>
+template <typename Stream>
void QMailMessageHeaderFieldPrivate::serialize(Stream &stream) const
{
stream << _id;
@@ -1353,7 +1353,7 @@ void QMailMessageHeaderFieldPrivate::serialize(Stream &stream) const
stream << _parameters;
}
-template <typename Stream>
+template <typename Stream>
void QMailMessageHeaderFieldPrivate::deserialize(Stream &stream)
{
stream >> _id;
@@ -1367,27 +1367,27 @@ void QMailMessageHeaderFieldPrivate::deserialize(Stream &stream)
\class QMailMessageHeaderField
\brief The QMailMessageHeaderField class encapsulates the parsing of message header fields.
-
+
\ingroup messaginglibrary
-
- QMailMessageHeaderField provides simplified access to the various components of the
+
+ QMailMessageHeaderField provides simplified access to the various components of the
header field, and allows the field content to be extracted in a standardized form.
- The content of a header field may be formed of unstructured text, or it may have an
- internal structure. If a structured field is specified, QMailMessageHeaderField assumes
- that the contained header field is structured in a format equivalent to that used for the
- RFC 2045 'Content-Type' and RFC 2183 'Content-Disposition' header fields. If the field
+ The content of a header field may be formed of unstructured text, or it may have an
+ internal structure. If a structured field is specified, QMailMessageHeaderField assumes
+ that the contained header field is structured in a format equivalent to that used for the
+ RFC 2045 'Content-Type' and RFC 2183 'Content-Disposition' header fields. If the field
is unstructured, or conforms to a different structure, then the parameter() and parameters() functions
will return empty results, and the setParameter() function will have no effect.
QMailMessageHeaderField contains static functions to assist in creating correct
- header field content, and presenting header field content. The encodeWord() and
+ header field content, and presenting header field content. The encodeWord() and
decodeWord() functions translate between plain text and the encoded-word specification
defined in RFC 2045. The encodeParameter() and decodeParameter() functions translate
between plain text and the encoded-parameter format defined in RFC 2231.
The removeWhitespace() function can be used to remove irrelevant whitespace characters
- from a string, and the removeComments() function can remove any comment sequences
+ from a string, and the removeComments() function can remove any comment sequences
present, encododed according to the RFC 2822 specification.
*/
@@ -1410,9 +1410,9 @@ QMailMessageHeaderField::QMailMessageHeaderField()
}
/*!
- Creates a message header field object from the data in \a text. If \a fieldType is
- QMailMessageHeaderField::StructuredField, then \a text will be parsed assuming a
- format equivalent to that used for the RFC 2045 'Content-Type' and
+ Creates a message header field object from the data in \a text. If \a fieldType is
+ QMailMessageHeaderField::StructuredField, then \a text will be parsed assuming a
+ format equivalent to that used for the RFC 2045 'Content-Type' and
RFC 2183 'Content-Disposition' header fields.
*/
QMailMessageHeaderField::QMailMessageHeaderField(const QByteArray& text, FieldType fieldType)
@@ -1421,9 +1421,9 @@ QMailMessageHeaderField::QMailMessageHeaderField(const QByteArray& text, FieldTy
}
/*!
- Creates a message header field object with the field id \a id and the content
- data in \a text. If \a fieldType is QMailMessageHeaderField::StructuredField,
- then \a text will be parsed assuming a format equivalent to that used for the
+ Creates a message header field object with the field id \a id and the content
+ data in \a text. If \a fieldType is QMailMessageHeaderField::StructuredField,
+ then \a text will be parsed assuming a format equivalent to that used for the
RFC 2045 'Content-Type' and RFC 2183 'Content-Disposition' header fields.
*/
QMailMessageHeaderField::QMailMessageHeaderField(const QByteArray& id, const QByteArray& text, FieldType fieldType)
@@ -1478,7 +1478,7 @@ void QMailMessageHeaderField::setContent(const QByteArray& text)
}
/*!
- Returns the value of the parameter with the name \a name.
+ Returns the value of the parameter with the name \a name.
Name comparisons are case-insensitive.
*/
QByteArray QMailMessageHeaderField::parameter(const QByteArray& name) const
@@ -1487,7 +1487,7 @@ QByteArray QMailMessageHeaderField::parameter(const QByteArray& name) const
}
/*!
- Sets the parameter with the name \a name to have the value \a value, if present;
+ Sets the parameter with the name \a name to have the value \a value, if present;
otherwise a new parameter is appended with the supplied properties. If \a name
ends with a single asterisk, the parameter will be flagged as encoded.
@@ -1499,8 +1499,8 @@ void QMailMessageHeaderField::setParameter(const QByteArray& name, const QByteAr
}
/*!
- Returns true if the parameter with name \a name exists and is marked as encoded
- according to RFC 2231; otherwise returns false.
+ Returns true if the parameter with name \a name exists and is marked as encoded
+ according to RFC 2231; otherwise returns false.
Name comparisons are case-insensitive.
*/
bool QMailMessageHeaderField::isParameterEncoded(const QByteArray& name) const
@@ -1528,9 +1528,9 @@ QList<QMailMessageHeaderField::ParameterType> QMailMessageHeaderField::parameter
/*!
Returns the entire header field text as a formatted string, with the name of the field
- included if \a includeName is true. If \a presentable is true, artifacts of RFC 2822
- transmission format such as parameter folding will be removed. For example:
-
+ included if \a includeName is true. If \a presentable is true, artifacts of RFC 2822
+ transmission format such as parameter folding will be removed. For example:
+
\code
QMailMessageHeaderField hdr;
hdr.setId("Content-Type");
@@ -1562,7 +1562,7 @@ void QMailMessageHeaderField::parse(const QByteArray& text, FieldType fieldType)
/*!
Returns the content of the string \a input encoded into a series of RFC 2045 'encoded-word'
- format tokens, each no longer than 75 characters. The encoding used can be specified in
+ format tokens, each no longer than 75 characters. The encoding used can be specified in
\a charset, or can be deduced from the content of \a input if \a charset is empty.
*/
QByteArray QMailMessageHeaderField::encodeWord(const QString& input, const QByteArray& charset)
@@ -1581,9 +1581,9 @@ QString QMailMessageHeaderField::decodeWord(const QByteArray& input)
/*!
Returns the content of the string \a input encoded into RFC 2231 'extended-parameter'
- format. The encoding used can be specified in \a charset, or can be deduced from the
- content of \a input if \a charset is empty. If \a language is non-empty, it will be
- included in the encoded output; otherwise the language component will be extracted from
+ format. The encoding used can be specified in \a charset, or can be deduced from the
+ content of \a input if \a charset is empty. If \a language is non-empty, it will be
+ included in the encoded output; otherwise the language component will be extracted from
\a charset, if it contains a trailing language specifier as defined in RFC 2231.
*/
QByteArray QMailMessageHeaderField::encodeParameter(const QString& input, const QByteArray& charset, const QByteArray& language)
@@ -1627,7 +1627,7 @@ QByteArray QMailMessageHeaderField::removeComments(const QByteArray& input)
}
/*!
- Returns the content of \a input with any whitespace characters removed.
+ Returns the content of \a input with any whitespace characters removed.
Whitespace inside double quotes is preserved.
*/
QByteArray QMailMessageHeaderField::removeWhitespace(const QByteArray& input)
@@ -1646,7 +1646,7 @@ QByteArray QMailMessageHeaderField::removeWhitespace(const QByteArray& input)
if (quoted || !isspace(*it))
result.append(*it);
}
-
+
return result;
}
@@ -1656,21 +1656,21 @@ void QMailMessageHeaderField::output(QDataStream& out) const
impl(this)->output(out);
}
-/*!
+/*!
\fn QMailMessageHeaderField::serialize(Stream&) const
- \internal
+ \internal
*/
-template <typename Stream>
+template <typename Stream>
void QMailMessageHeaderField::serialize(Stream &stream) const
{
impl(this)->serialize(stream);
}
-/*!
+/*!
\fn QMailMessageHeaderField::deserialize(Stream&)
- \internal
+ \internal
*/
-template <typename Stream>
+template <typename Stream>
void QMailMessageHeaderField::deserialize(Stream &stream)
{
impl(this)->deserialize(stream);
@@ -1682,10 +1682,10 @@ void QMailMessageHeaderField::deserialize(Stream &stream)
\brief The QMailMessageContentType class encapsulates the parsing of the RFC 2822
'Content-Type' header field.
-
+
\ingroup messaginglibrary
-
- QMailMessageContentType provides simplified access to the various components of the
+
+ QMailMessageContentType provides simplified access to the various components of the
'Content-Type' header field.
Components of the header field not exposed by member functions can be accessed using
the functions inherited from QMailMessageHeaderField.
@@ -1751,7 +1751,7 @@ QByteArray QMailMessageContentType::type() const
}
/*!
- Sets the primary type information of the 'Content-Type' header field to \a type. If \a type
+ Sets the primary type information of the 'Content-Type' header field to \a type. If \a type
is empty, then any pre-existing sub-type information will be cleared.
\sa setSubType()
@@ -1874,10 +1874,10 @@ void QMailMessageContentType::setCharset(const QByteArray& charset)
\brief The QMailMessageContentDisposition class encapsulates the parsing of the RFC 2822
'Content-Disposition' header field.
-
+
\ingroup messaginglibrary
-
- QMailMessageContentDisposition provides simplified access to the various components of the
+
+ QMailMessageContentDisposition provides simplified access to the various components of the
'Content-Disposition' header field.
Components of the header field not exposed by member functions can be accessed using
the functions inherited from QMailMessageHeaderField.
@@ -2230,13 +2230,13 @@ void QMailMessageHeaderPrivate::output(QDataStream& out, const QList<QByteArray>
}
}
-template <typename Stream>
+template <typename Stream>
void QMailMessageHeaderPrivate::serialize(Stream &stream) const
{
stream << _headerFields;
}
-template <typename Stream>
+template <typename Stream>
void QMailMessageHeaderPrivate::deserialize(Stream &stream)
{
stream >> _headerFields;
@@ -2303,21 +2303,21 @@ void QMailMessageHeader::output(QDataStream& out, const QList<QByteArray>& exclu
impl(this)->output(out, exclusions, excludeInternalFields);
}
-/*!
+/*!
\fn QMailMessageHeader::serialize(Stream&) const
- \internal
+ \internal
*/
-template <typename Stream>
+template <typename Stream>
void QMailMessageHeader::serialize(Stream &stream) const
{
impl(this)->serialize(stream);
}
-/*!
+/*!
\fn QMailMessageHeader::deserialize(Stream&)
- \internal
+ \internal
*/
-template <typename Stream>
+template <typename Stream>
void QMailMessageHeader::deserialize(Stream &stream)
{
impl(this)->deserialize(stream);
@@ -2358,7 +2358,7 @@ void QMailMessageBodyPrivate::fromStream(QDataStream& in, const QMailMessageCont
_encoded = true;
_filename = QString();
_bodyData = LongString();
-
+
// If the data is already encoded, we don't need to do it again
if (status == QMailMessageBody::AlreadyEncoded)
te = QMailMessageBody::SevenBit;
@@ -2575,7 +2575,7 @@ bool QMailMessageBodyPrivate::toStream(QTextStream& out) const
bool result = false;
if (!_encoded && !_filename.isEmpty() && unicodeConvertingCharset(charset))
- {
+ {
// The data is already in unicode format
QTextStream* in = _bodyData.textStream();
in->setCodec(charset);
@@ -2630,7 +2630,7 @@ void QMailMessageBodyPrivate::output(QDataStream& out, bool includeAttachments)
toStream( out, QMailMessageBody::Encoded );
}
-template <typename Stream>
+template <typename Stream>
void QMailMessageBodyPrivate::serialize(Stream &stream) const
{
stream << _encoding;
@@ -2640,7 +2640,7 @@ void QMailMessageBodyPrivate::serialize(Stream &stream) const
stream << _type;
}
-template <typename Stream>
+template <typename Stream>
void QMailMessageBodyPrivate::deserialize(Stream &stream)
{
stream >> _encoding;
@@ -2655,9 +2655,9 @@ void QMailMessageBodyPrivate::deserialize(Stream &stream)
\class QMailMessageBody
\brief The QMailMessageBody class contains the body element of a message or message part.
-
+
\ingroup messaginglibrary
-
+
The body of a message or message part is treated as an atomic unit by the Qt Extended messaging library. It can only be inserted into a message part container or extracted
from one. It can be inserted or extracted using either a QByteArray, a QDataStream
or to/from a file. In the case of unicode text data, the insertion and extraction can
@@ -2666,30 +2666,30 @@ void QMailMessageBodyPrivate::deserialize(Stream &stream)
The body data must be associated with a QMailMessageContentType describing that data.
When extracting body data from a message or part to unicode text, the content type
description must include a parameter named 'charset'; this parameter is used to locate
- a QTextCodec to be used to extract unicode data from the body data octet stream.
-
- If the Content-Type of the data is a subtype of "text", then line-ending translation
- will be used to ensure that the text is transmitted with CR/LF line endings. The text
- data supplied to QMailMessageBody must conform to the RFC 2822 restrictions on maximum
- line lengths: "Each line of characters MUST be no more than 998 characters, and SHOULD
- be no more than 78 characters, excluding the CRLF." Textual message body data decoded
- from a QMailMessageBody object will have transmitted CR/LF line endings converted to
+ a QTextCodec to be used to extract unicode data from the body data octet stream.
+
+ If the Content-Type of the data is a subtype of "text", then line-ending translation
+ will be used to ensure that the text is transmitted with CR/LF line endings. The text
+ data supplied to QMailMessageBody must conform to the RFC 2822 restrictions on maximum
+ line lengths: "Each line of characters MUST be no more than 998 characters, and SHOULD
+ be no more than 78 characters, excluding the CRLF." Textual message body data decoded
+ from a QMailMessageBody object will have transmitted CR/LF line endings converted to
\c \n on extraction.
The body data can also be encoded from 8-bit octets to 7-bit ASCII characters for
- safe transmission through obsolete email systems. When creating an instance of the
- QMailMessageBody class, the encoding to be used must be specified using the
+ safe transmission through obsolete email systems. When creating an instance of the
+ QMailMessageBody class, the encoding to be used must be specified using the
QMailMessageBody::TransferEncoding enum.
\sa QMailMessagePart, QMailMessage, QTextCodec
-*/
+*/
/*!
\typedef QMailMessageBody::ImplementationType
\internal
*/
-/*!
+/*!
Creates an instance of QMailMessageBody.
*/
QMailMessageBody::QMailMessageBody()
@@ -2698,13 +2698,13 @@ QMailMessageBody::QMailMessageBody()
}
/*!
- Creates a message body from the data contained in the file \a filename, having the content type
- \a type. If \a status is QMailMessageBody::RequiresEncoding, the data from the file will be
+ Creates a message body from the data contained in the file \a filename, having the content type
+ \a type. If \a status is QMailMessageBody::RequiresEncoding, the data from the file will be
encoded to \a encoding for transmission; otherwise it must already be in that encoding, which
will be reported to recipients of the data.
If \a type is a subtype of "text", the data will be treated as text, and line-ending
- translation will be employed. Otherwise, the file will be treated as containing binary
+ translation will be employed. Otherwise, the file will be treated as containing binary
data. If the file contains unicode text data, it will be converted to an octet stream using
a QTextCodec object identified by the 'charset' parameter of \a type.
@@ -2723,13 +2723,13 @@ QMailMessageBody QMailMessageBody::fromFile(const QString& filename, const QMail
}
/*!
- Creates a message body from the data read from \a in, having the content type \a type.
- If \a status is QMailMessageBody::RequiresEncoding, the data from the file will be
- encoded to \a encoding for transmission; otherwise it must already be in that encoding,
+ Creates a message body from the data read from \a in, having the content type \a type.
+ If \a status is QMailMessageBody::RequiresEncoding, the data from the file will be
+ encoded to \a encoding for transmission; otherwise it must already be in that encoding,
which will be reported to recipients of the data.
If \a type is a subtype of "text", the data will be treated as text, and line-ending
- translation will be employed. Otherwise, the file will be treated as containing binary
+ translation will be employed. Otherwise, the file will be treated as containing binary
data.
If \a encoding is QMailMessageBody::QuotedPrintable, encoding will be performed assuming
@@ -2745,13 +2745,13 @@ QMailMessageBody QMailMessageBody::fromStream(QDataStream& in, const QMailMessag
}
/*!
- Creates a message body from the data contained in \a input, having the content type
- \a type. If \a status is QMailMessageBody::RequiresEncoding, the data from the file will be
- encoded to \a encoding for transmission; otherwise it must already be in that encoding,
+ Creates a message body from the data contained in \a input, having the content type
+ \a type. If \a status is QMailMessageBody::RequiresEncoding, the data from the file will be
+ encoded to \a encoding for transmission; otherwise it must already be in that encoding,
which will be reported to recipients of the data.
If \a type is a subtype of "text", the data will be treated as text, and line-ending
- translation will be employed. Otherwise, the file will be treated as containing binary
+ translation will be employed. Otherwise, the file will be treated as containing binary
data.
If \a encoding is QMailMessageBody::QuotedPrintable, encoding will be performed assuming
@@ -2770,9 +2770,9 @@ QMailMessageBody QMailMessageBody::fromData(const QByteArray& input, const QMail
}
/*!
- Creates a message body from the data read from \a in, having the content type \a type.
+ Creates a message body from the data read from \a in, having the content type \a type.
The data read from \a in will be encoded to \a encoding for transmission, and line-ending
- translation will be employed. The unicode text data will be converted to an octet stream
+ translation will be employed. The unicode text data will be converted to an octet stream
using a QTextCodec object identified by the 'charset' parameter of \a type.
If \a encoding is QMailMessageBody::QuotedPrintable, encoding will be performed assuming
@@ -2788,9 +2788,9 @@ QMailMessageBody QMailMessageBody::fromStream(QTextStream& in, const QMailMessag
}
/*!
- Creates a message body from the data contained in \a input, having the content type
- \a type. The data from \a input will be encoded to \a encoding for transmission, and
- line-ending translation will be employed. The unicode text data will be converted to
+ Creates a message body from the data contained in \a input, having the content type
+ \a type. The data from \a input will be encoded to \a encoding for transmission, and
+ line-ending translation will be employed. The unicode text data will be converted to
an octet stream using a QTextCodec object identified by the 'charset' parameter of \a type.
If \a encoding is QMailMessageBody::QuotedPrintable, encoding will be performed assuming
@@ -2822,8 +2822,8 @@ QMailMessageBody QMailMessageBody::fromLongString(LongString& ls, const QMailMes
QMailMessageBody::Encoded, then the data is written in the transfer encoding it was
created with; otherwise, it is written in unencoded form.
- If the body has a content type with a QMailMessageContentType::type() of "text", and the
- content type parameter 'charset' is not empty, then the unencoded data will be written
+ If the body has a content type with a QMailMessageContentType::type() of "text", and the
+ content type parameter 'charset' is not empty, then the unencoded data will be written
as unicode text data, using the charset parameter to locate the appropriate QTextCodec.
Returns false if the operation causes an error; otherwise returns true.
@@ -2870,7 +2870,7 @@ bool QMailMessageBody::toStream(QDataStream& out, EncodingFormat format) const
Returns the data of the message body as a QString, in unencoded form. Line-endings
transmitted as CR/LF pairs are converted to \c \n on extraction.
- The 'charset' parameter of the body's content type is used to locate the appropriate
+ The 'charset' parameter of the body's content type is used to locate the appropriate
QTextCodec to convert the data from an octet stream to unicode, if necessary.
\sa QMailCodec, QMailMessageContentType, QTextCodec
@@ -2886,11 +2886,11 @@ QString QMailMessageBody::data() const
}
/*!
- Writes the data of the message body to the stream \a out, in unencoded form.
+ Writes the data of the message body to the stream \a out, in unencoded form.
Line-endings transmitted as CR/LF pairs are converted to \c \n on extraction.
Returns false if the operation causes an error; otherwise returns true.
- The 'charset' parameter of the body's content type is used to locate the appropriate
+ The 'charset' parameter of the body's content type is used to locate the appropriate
QTextCodec to convert the data from an octet stream to unicode, if necessary.
\sa QMailCodec, QMailMessageContentType, QTextCodec
@@ -2944,21 +2944,21 @@ void QMailMessageBody::output(QDataStream& out, bool includeAttachments) const
impl(this)->output(out, includeAttachments);
}
-/*!
+/*!
\fn QMailMessageBody::serialize(Stream&) const
- \internal
+ \internal
*/
-template <typename Stream>
+template <typename Stream>
void QMailMessageBody::serialize(Stream &stream) const
{
impl(this)->serialize(stream);
}
-/*!
+/*!
\fn QMailMessageBody::deserialize(Stream&)
- \internal
+ \internal
*/
-template <typename Stream>
+template <typename Stream>
void QMailMessageBody::deserialize(Stream &stream)
{
impl(this)->deserialize(stream);
@@ -3006,8 +3006,8 @@ int QMailMessagePartContainerPrivate::partNumber() const
bool QMailMessagePartContainerPrivate::contains(const QMailMessagePart::Location& location) const
{
- const QMailMessagePart* part = 0;
- const QList<QMailMessagePart>* partList = &_messageParts;
+ const QMailMessagePart* part = 0;
+ const QList<QMailMessagePart>* partList = &_messageParts;
foreach (uint index, location.d->_indices) {
if (partList->count() < index) {
@@ -3023,8 +3023,8 @@ bool QMailMessagePartContainerPrivate::contains(const QMailMessagePart::Location
const QMailMessagePart& QMailMessagePartContainerPrivate::partAt(const QMailMessagePart::Location& location) const
{
- const QMailMessagePart* part = 0;
- const QList<QMailMessagePart>* partList = &_messageParts;
+ const QMailMessagePart* part = 0;
+ const QList<QMailMessagePart>* partList = &_messageParts;
foreach (uint index, location.d->_indices) {
part = &(partList->at(index - 1));
@@ -3037,8 +3037,8 @@ const QMailMessagePart& QMailMessagePartContainerPrivate::partAt(const QMailMess
QMailMessagePart& QMailMessagePartContainerPrivate::partAt(const QMailMessagePart::Location& location)
{
- QMailMessagePart* part = 0;
- QList<QMailMessagePart>* partList = &_messageParts;
+ QMailMessagePart* part = 0;
+ QList<QMailMessagePart>* partList = &_messageParts;
foreach (uint index, location.d->_indices) {
part = &((*partList)[index - 1]);
@@ -3593,7 +3593,7 @@ void QMailMessagePartContainerPrivate::setDirty(bool value, bool recursive)
}
}
-template <typename Stream>
+template <typename Stream>
void QMailMessagePartContainerPrivate::serialize(Stream &stream) const
{
stream << _multipartType;
@@ -3608,7 +3608,7 @@ void QMailMessagePartContainerPrivate::serialize(Stream &stream) const
stream << _dirty;
}
-template <typename Stream>
+template <typename Stream>
void QMailMessagePartContainerPrivate::deserialize(Stream &stream)
{
stream >> _multipartType;
@@ -3628,27 +3628,27 @@ void QMailMessagePartContainerPrivate::deserialize(Stream &stream)
\class QMailMessagePartContainer
\brief The QMailMessagePartContainer class provides access to a collection of message parts.
-
+
\ingroup messaginglibrary
-
- Message formats such as email messages conforming to
- \l{http://www.ietf.org/rfc/rfc2822.txt} {RFC 2822} (Internet Message Format) can consist of
- multiple independent parts, whose relationship to each other is defined by the message that
- contains those parts. The QMailMessagePartContainer class provides storage for these related
+
+ Message formats such as email messages conforming to
+ \l{http://www.ietf.org/rfc/rfc2822.txt} {RFC 2822} (Internet Message Format) can consist of
+ multiple independent parts, whose relationship to each other is defined by the message that
+ contains those parts. The QMailMessagePartContainer class provides storage for these related
message parts, and the interface through which they are accessed.
- The multipartType() function returns a member of the MultipartType enumeration, which
+ The multipartType() function returns a member of the MultipartType enumeration, which
describes the relationship of the parts in the container to each other.
The part container can instead contain a message body element. In this case, it cannot contain
- sub-parts, and the multipartType() function will return MultipartType::MultipartNone for the part.
+ sub-parts, and the multipartType() function will return MultipartType::MultipartNone for the part.
The body element can be accessed via the body() function.
The QMailMessagePart class is itself derived from QMailMessagePartContainer, which allows
messages to support the nesting of part collections within other part collections.
\sa QMailMessagePart, QMailMessage, QMailMessageBody
-*/
+*/
/*!
\typedef QMailMessagePartContainer::ImplementationType
@@ -3658,7 +3658,7 @@ void QMailMessagePartContainerPrivate::deserialize(Stream &stream)
/*!
\fn QMailMessagePartContainer::QMailMessagePartContainer(Subclass*)
- Constructs an empty part container object, in the space allocated
+ Constructs an empty part container object, in the space allocated
within the subclass instance at \a p.
*/
template<typename Subclass>
@@ -3675,7 +3675,7 @@ void QMailMessagePartContainer::setHeader(const QMailMessageHeader& partHeader,
/*!
Returns the number of attachments the message has.
-*/
+*/
uint QMailMessagePartContainer::partCount() const
{
return impl(this)->_messageParts.count();
@@ -3708,7 +3708,7 @@ void QMailMessagePartContainer::removePartAt(uint pos)
}
/*!
- Returns a const reference to the item at position \a pos in the list of
+ Returns a const reference to the item at position \a pos in the list of
attachments for the message.
\a pos must be a valid index position in the list (i.e., 0 <= i < partCount()).
@@ -3719,7 +3719,7 @@ const QMailMessagePart& QMailMessagePartContainer::partAt(uint pos) const
}
/*!
- Returns a non-const reference to the item at position \a pos in the list of
+ Returns a non-const reference to the item at position \a pos in the list of
attachments for the message.
\a pos must be a valid index position in the list (i.e., 0 <= i < partCount()).
@@ -3740,7 +3740,7 @@ void QMailMessagePartContainer::clearParts()
/*!
Returns the type of multipart relationship shared by the parts contained within this container, or
\l {QMailMessagePartContainerFwd::MultipartNone}{MultipartNone} if the content is not a multipart message.
-*/
+*/
QMailMessagePartContainer::MultipartType QMailMessagePartContainer::multipartType() const
{
return impl(this)->_multipartType;
@@ -3796,7 +3796,7 @@ bool QMailMessagePartContainer::hasBody() const
/*!
Returns the content type of this part. Where hasBody() is true, the type of the
- contained body element is returned; otherwise a content type matching the
+ contained body element is returned; otherwise a content type matching the
multipartType() for this part is returned.
\sa hasBody(), QMailMessageBody::contentType(), multipartType()
@@ -3809,7 +3809,7 @@ QMailMessageContentType QMailMessagePartContainer::contentType() const
/*!
Returns the transfer encoding type of this part. Where hasBody() is true, the
transfer encoding type of the contained body element is returned; otherwise, the
- transfer encoding type specified by the 'Content-Transfer-Encoding' field of the
+ transfer encoding type specified by the 'Content-Transfer-Encoding' field of the
header for this part is returned.
\sa hasBody(), QMailMessageBody::transferEncoding()
@@ -3829,8 +3829,8 @@ QString QMailMessagePartContainer::headerFieldText( const QString &id ) const
/*!
Returns an object containing the value of the first header field with the given \a id.
- If \a fieldType is QMailMessageHeaderField::StructuredField, then the field content
- will be parsed assuming a format equivalent to that used for the RFC 2045 'Content-Type'
+ If \a fieldType is QMailMessageHeaderField::StructuredField, then the field content
+ will be parsed assuming a format equivalent to that used for the RFC 2045 'Content-Type'
and RFC 2183 'Content-Disposition' header fields.
*/
QMailMessageHeaderField QMailMessagePartContainer::headerField( const QString &id, QMailMessageHeaderField::FieldType fieldType ) const
@@ -3858,8 +3858,8 @@ QStringList QMailMessagePartContainer::headerFieldsText( const QString &id ) con
/*!
Returns a list of objects containing the value of each header field with the given \a id.
- If \a fieldType is QMailMessageHeaderField::StructuredField, then the field content will
- be parsed assuming a format equivalent to that used for the RFC 2045 'Content-Type' and
+ If \a fieldType is QMailMessageHeaderField::StructuredField, then the field content will
+ be parsed assuming a format equivalent to that used for the RFC 2045 'Content-Type' and
RFC 2183 'Content-Disposition' header fields.
*/
QList<QMailMessageHeaderField> QMailMessagePartContainer::headerFields( const QString &id, QMailMessageHeaderField::FieldType fieldType ) const
@@ -3888,14 +3888,14 @@ QList<QMailMessageHeaderField> QMailMessagePartContainer::headerFields() const
}
/*!
- Sets the value of the first header field with identity \a id to \a value if it already
- exists; otherwise adds the header with the supplied id and value. If \a value is of
+ Sets the value of the first header field with identity \a id to \a value if it already
+ exists; otherwise adds the header with the supplied id and value. If \a value is of
the form "<id>:<content>", then only the part after the semi-colon is processed.
- RFC 2822 encoding requires header fields to be transmitted in ASCII characters.
- If \a value contains non-ASCII characters, it will be encoded to ASCII via the
- QMailMessageHeaderField::encodeContent() function; depending on the specific header
- field this may result in illegal content. Where possible, clients should encode
+ RFC 2822 encoding requires header fields to be transmitted in ASCII characters.
+ If \a value contains non-ASCII characters, it will be encoded to ASCII via the
+ QMailMessageHeaderField::encodeContent() function; depending on the specific header
+ field this may result in illegal content. Where possible, clients should encode
non-ASCII data prior to calling setHeaderField.
\sa QMailMessageHeaderField
@@ -3929,13 +3929,13 @@ void QMailMessagePartContainer::setHeaderField( const QMailMessageHeaderField& f
/*!
Appends a new header field with id \a id and value \a value to the existing
list of header fields. Any existing header fields with the same id are not modified.
- If \a value is of the form "<id>:<content>", then only the part after the
+ If \a value is of the form "<id>:<content>", then only the part after the
semi-colon is processed.
- RFC 2822 encoding requires header fields to be transmitted in ASCII characters.
- If \a value contains non-ASCII characters, it will be encoded to ASCII via the
- QMailMessageHeaderField::encodeContent() function; depending on the specific header
- field this may result in illegal content. Where possible, clients should encode
+ RFC 2822 encoding requires header fields to be transmitted in ASCII characters.
+ If \a value contains non-ASCII characters, it will be encoded to ASCII via the
+ QMailMessageHeaderField::encodeContent() function; depending on the specific header
+ field this may result in illegal content. Where possible, clients should encode
non-ASCII data prior to calling appendHeaderField.
\sa QMailMessageHeaderField
@@ -3958,7 +3958,7 @@ void QMailMessagePartContainer::appendHeaderField( const QString& id, const QStr
}
/*!
- Appends a new header field with the properties of \a field. Any existing header
+ Appends a new header field with the properties of \a field. Any existing header
fields with the same id are not modified.
*/
void QMailMessagePartContainer::appendHeaderField( const QMailMessageHeaderField& field )
@@ -4016,7 +4016,7 @@ QMailMessagePartContainer::MultipartType QMailMessagePartContainer::multipartTyp
*/
QByteArray QMailMessagePartContainer::nameForMultipartType(QMailMessagePartContainer::MultipartType type)
{
- switch (type)
+ switch (type)
{
case QMailMessagePartContainer::MultipartSigned:
{
@@ -4109,7 +4109,7 @@ QMailMessagePart::ReferenceType QMailMessagePartPrivate::referenceType() const
{
if (_referenceId.isValid())
return QMailMessagePart::MessageReference;
-
+
if (_referenceLocation.isValid())
return QMailMessagePart::PartReference;
@@ -4189,7 +4189,7 @@ void QMailMessagePartPrivate::output(QDataStream **out, bool addMimePreamble, bo
}
}
-template <typename Stream>
+template <typename Stream>
void QMailMessagePartPrivate::serialize(Stream &stream) const
{
QMailMessagePartContainerPrivate::serialize(stream);
@@ -4199,7 +4199,7 @@ void QMailMessagePartPrivate::serialize(Stream &stream) const
stream << _resolution;
}
-template <typename Stream>
+template <typename Stream>
void QMailMessagePartPrivate::deserialize(Stream &stream)
{
QMailMessagePartContainerPrivate::deserialize(stream);
@@ -4209,16 +4209,16 @@ void QMailMessagePartPrivate::deserialize(Stream &stream)
stream >> _resolution;
}
-void QMailMessagePartPrivate::setReference(const QMailMessageId &id,
- const QMailMessageContentType& type,
+void QMailMessagePartPrivate::setReference(const QMailMessageId &id,
+ const QMailMessageContentType& type,
QMailMessageBody::TransferEncoding encoding)
{
_referenceId = id;
setBodyProperties(type, encoding);
}
-void QMailMessagePartPrivate::setReference(const QMailMessagePart::Location &location,
- const QMailMessageContentType& type,
+void QMailMessagePartPrivate::setReference(const QMailMessagePart::Location &location,
+ const QMailMessageContentType& type,
QMailMessageBody::TransferEncoding encoding)
{
_referenceLocation = location;
@@ -4244,7 +4244,7 @@ QMailMessagePartContainerPrivate* QMailMessagePartContainerPrivate::privatePoint
/*!
\fn bool QMailMessagePartContainer::foreachPart(F func)
-
+
Applies the function or functor \a func to each part contained within the container.
\a func must implement the signature 'bool operator()(QMailMessagePart &)', and must
return true to indicate success, or false to end the traversal operation.
@@ -4255,7 +4255,7 @@ QMailMessagePartContainerPrivate* QMailMessagePartContainerPrivate::privatePoint
/*!
\fn bool QMailMessagePartContainer::foreachPart(F func) const
-
+
Applies the function or functor \a func to each part contained within the container.
\a func must implement the signature 'bool operator()(const QMailMessagePart &)', and must
return true to indicate success, or false to end the traversal operation.
@@ -4271,21 +4271,21 @@ QMailMessagePartContainerPrivate* QMailMessagePartContainerPrivate::privatePoint
/*!
\class QMailMessagePart
- \brief The QMailMessagePart class provides a convenient interface for working
+ \brief The QMailMessagePart class provides a convenient interface for working
with message attachments.
\ingroup messaginglibrary
-
- A message part inherits the properties of QMailMessagePartContainer, and can
- therefore contain a message body or a collection of sub-parts.
-
- A message part differs from a message proper in that a part will often have
- properties specified by the MIME multipart specification, not relevant to
- messages. These include the 'name' and 'filename' parameters of the Content-Type
+
+ A message part inherits the properties of QMailMessagePartContainer, and can
+ therefore contain a message body or a collection of sub-parts.
+
+ A message part differs from a message proper in that a part will often have
+ properties specified by the MIME multipart specification, not relevant to
+ messages. These include the 'name' and 'filename' parameters of the Content-Type
and Content-Disposition fields, and the Content-Id and Content-Location fields.
A message part may consist entirely of a reference to an external message, or
- a part within an external message. Parts that consists of references may be
+ a part within an external message. Parts that consists of references may be
used with some protocols that permit data to be transmitted by reference, such
as IMAP with the URLAUTH extension. Not all messaging protocols support the
use of content references. The partReference() and messageReference() functions
@@ -4307,9 +4307,9 @@ QMailMessagePartContainerPrivate* QMailMessagePartContainerPrivate::privatePoint
with the message that contains it.
\ingroup messaginglibrary
-
+
A Location object is used to refer to a single part within a multi-part message. The
- location can be used to reference a part within a QMailMessage object, via the
+ location can be used to reference a part within a QMailMessage object, via the
\l{QMailMessage::partAt()}{partAt} function.
*/
@@ -4384,7 +4384,7 @@ const QMailMessagePart::Location &QMailMessagePart::Location::operator=(const QM
return *this;
}
-/*!
+/*!
Returns true if the location object contains the location of a valid message part.
If \a extended is true, the location must also contain a valid message identifier.
*/
@@ -4393,7 +4393,7 @@ bool QMailMessagePart::Location::isValid(bool extended) const
return ((!extended || d->_messageId.isValid()) && !d->_indices.isEmpty());
}
-/*!
+/*!
Returns the identifier of the message that contains the part with this location.
*/
QMailMessageId QMailMessagePart::Location::containingMessageId() const
@@ -4401,7 +4401,7 @@ QMailMessageId QMailMessagePart::Location::containingMessageId() const
return d->_messageId;
}
-/*!
+/*!
Sets the identifier of the message that contains the part with this location to \a id.
*/
void QMailMessagePart::Location::setContainingMessageId(const QMailMessageId &id)
@@ -4426,11 +4426,11 @@ QString QMailMessagePart::Location::toString(bool extended) const
return result.append(numbers.join("."));
}
-/*!
+/*!
\fn QMailMessagePart::Location::serialize(Stream&) const
- \internal
+ \internal
*/
-template <typename Stream>
+template <typename Stream>
void QMailMessagePart::Location::serialize(Stream &stream) const
{
stream << d->_messageId;
@@ -4439,11 +4439,11 @@ void QMailMessagePart::Location::serialize(Stream &stream) const
template void QMailMessagePart::Location::serialize(QDataStream &) const;
-/*!
+/*!
\fn QMailMessagePart::Location::deserialize(Stream&)
- \internal
+ \internal
*/
-template <typename Stream>
+template <typename Stream>
void QMailMessagePart::Location::deserialize(Stream &stream)
{
stream >> d->_messageId;
@@ -4461,16 +4461,16 @@ QMailMessagePart::QMailMessagePart()
}
/*!
- Creates a QMailMessagePart containing an attachment of type \a disposition, from the
+ Creates a QMailMessagePart containing an attachment of type \a disposition, from the
data contained in \a filename, of content type \a type and using the transfer encoding
\a encoding. The current status of the data is specified as \a status.
\sa QMailMessageBody::fromFile()
*/
QMailMessagePart QMailMessagePart::fromFile(const QString& filename,
- const QMailMessageContentDisposition& disposition,
- const QMailMessageContentType& type,
- QMailMessageBody::TransferEncoding encoding,
+ const QMailMessageContentDisposition& disposition,
+ const QMailMessageContentType& type,
+ QMailMessageBody::TransferEncoding encoding,
QMailMessageBody::EncodingStatus status)
{
QMailMessagePart part;
@@ -4481,16 +4481,16 @@ QMailMessagePart QMailMessagePart::fromFile(const QString& filename,
}
/*!
- Creates a QMailMessagePart containing an attachment of type \a disposition, from the
+ Creates a QMailMessagePart containing an attachment of type \a disposition, from the
data read from \a in, of content type \a type and using the transfer encoding
\a encoding. The current status of the data is specified as \a status.
\sa QMailMessageBody::fromStream()
*/
QMailMessagePart QMailMessagePart::fromStream(QDataStream& in,
- const QMailMessageContentDisposition& disposition,
- const QMailMessageContentType& type,
- QMailMessageBody::TransferEncoding encoding,
+ const QMailMessageContentDisposition& disposition,
+ const QMailMessageContentType& type,
+ QMailMessageBody::TransferEncoding encoding,
QMailMessageBody::EncodingStatus status)
{
QMailMessagePart part;
@@ -4501,16 +4501,16 @@ QMailMessagePart QMailMessagePart::fromStream(QDataStream& in,
}
/*!
- Creates a QMailMessagePart containing an attachment of type \a disposition, from the
+ Creates a QMailMessagePart containing an attachment of type \a disposition, from the
data contained in \a input, of content type \a type and using the transfer encoding
\a encoding. The current status of the data is specified as \a status.
\sa QMailMessageBody::fromData()
*/
QMailMessagePart QMailMessagePart::fromData(const QByteArray& input,
- const QMailMessageContentDisposition& disposition,
- const QMailMessageContentType& type,
- QMailMessageBody::TransferEncoding encoding,
+ const QMailMessageContentDisposition& disposition,
+ const QMailMessageContentType& type,
+ QMailMessageBody::TransferEncoding encoding,
QMailMessageBody::EncodingStatus status)
{
QMailMessagePart part;
@@ -4521,15 +4521,15 @@ QMailMessagePart QMailMessagePart::fromData(const QByteArray& input,
}
/*!
- Creates a QMailMessagePart containing an attachment of type \a disposition, from the
+ Creates a QMailMessagePart containing an attachment of type \a disposition, from the
data read from \a in, of content type \a type and using the transfer encoding
\a encoding.
\sa QMailMessageBody::fromStream()
*/
QMailMessagePart QMailMessagePart::fromStream(QTextStream& in,
- const QMailMessageContentDisposition& disposition,
- const QMailMessageContentType& type,
+ const QMailMessageContentDisposition& disposition,
+ const QMailMessageContentType& type,
QMailMessageBody::TransferEncoding encoding)
{
QMailMessagePart part;
@@ -4540,15 +4540,15 @@ QMailMessagePart QMailMessagePart::fromStream(QTextStream& in,
}
/*!
- Creates a QMailMessagePart containing an attachment of type \a disposition, from the
+ Creates a QMailMessagePart containing an attachment of type \a disposition, from the
data contained in \a input, of content type \a type and using the transfer encoding
\a encoding.
\sa QMailMessageBody::fromData()
*/
QMailMessagePart QMailMessagePart::fromData(const QString& input,
- const QMailMessageContentDisposition& disposition,
- const QMailMessageContentType& type,
+ const QMailMessageContentDisposition& disposition,
+ const QMailMessageContentType& type,
QMailMessageBody::TransferEncoding encoding)
{
QMailMessagePart part;
@@ -4560,16 +4560,16 @@ QMailMessagePart QMailMessagePart::fromData(const QString& input,
/*!
Creates a QMailMessagePart containing an attachment of type \a disposition, whose
- content is a reference to the message identified by \a messageId. The resulting
+ content is a reference to the message identified by \a messageId. The resulting
part has content type \a type and uses the transfer encoding \a encoding.
-
- The message reference can only be resolved by transmitting the message to an external
- server, where both the originating server of the referenced message and the receiving
+
+ The message reference can only be resolved by transmitting the message to an external
+ server, where both the originating server of the referenced message and the receiving
server of the new message support resolution of the content reference.
*/
QMailMessagePart QMailMessagePart::fromMessageReference(const QMailMessageId &messageId,
- const QMailMessageContentDisposition& disposition,
- const QMailMessageContentType& type,
+ const QMailMessageContentDisposition& disposition,
+ const QMailMessageContentType& type,
QMailMessageBody::TransferEncoding encoding)
{
QMailMessagePart part;
@@ -4581,16 +4581,16 @@ QMailMessagePart QMailMessagePart::fromMessageReference(const QMailMessageId &me
/*!
Creates a QMailMessagePart containing an attachment of type \a disposition, whose
- content is a reference to the message part identified by \a partLocation. The
+ content is a reference to the message part identified by \a partLocation. The
resulting part has content type \a type and uses the transfer encoding \a encoding.
-
- The part reference can only be resolved by transmitting the message to an external
- server, where both the originating server of the referenced part's message and the
+
+ The part reference can only be resolved by transmitting the message to an external
+ server, where both the originating server of the referenced part's message and the
receiving server of the new message support resolution of the content reference.
*/
QMailMessagePart QMailMessagePart::fromPartReference(const QMailMessagePart::Location &partLocation,
- const QMailMessageContentDisposition& disposition,
- const QMailMessageContentType& type,
+ const QMailMessageContentDisposition& disposition,
+ const QMailMessageContentType& type,
QMailMessageBody::TransferEncoding encoding)
{
QMailMessagePart part;
@@ -4603,9 +4603,9 @@ QMailMessagePart QMailMessagePart::fromPartReference(const QMailMessagePart::Loc
/*!
Sets the part content to contain a reference to the message identified by \a id,
having content type \a type and using the transfer encoding \a encoding.
-
- The message reference can only be resolved by transmitting the message to an external
- server, where both the originating server of the referenced message and the receiving
+
+ The message reference can only be resolved by transmitting the message to an external
+ server, where both the originating server of the referenced message and the receiving
server of the new message support resolution of the content reference.
\sa referenceType(), setReferenceResolution()
@@ -4618,9 +4618,9 @@ void QMailMessagePart::setReference(const QMailMessageId &id, const QMailMessage
/*!
Sets the part content to contain a reference to the message part identified by \a location,
having content type \a type and using the transfer encoding \a encoding.
-
- The part reference can only be resolved by transmitting the message to an external
- server, where both the originating server of the referenced part's message and the
+
+ The part reference can only be resolved by transmitting the message to an external
+ server, where both the originating server of the referenced part's message and the
receiving server of the new message support resolution of the content reference.
\sa referenceType(), setReferenceResolution()
@@ -4666,7 +4666,7 @@ void QMailMessagePart::setContentID(const QString &id)
}
/*!
- Returns the Content-Location header field for the part, if present;
+ Returns the Content-Location header field for the part, if present;
otherwise returns an empty string.
*/
QString QMailMessagePart::contentLocation() const
@@ -4683,7 +4683,7 @@ void QMailMessagePart::setContentLocation(const QString &location)
}
/*!
- Returns the Content-Description header field for the part, if present;
+ Returns the Content-Description header field for the part, if present;
otherwise returns an empty string.
*/
QString QMailMessagePart::contentDescription() const
@@ -4716,7 +4716,7 @@ void QMailMessagePart::setContentDisposition(const QMailMessageContentDispositio
}
/*!
- Returns the Content-Language header field for the part, if present;
+ Returns the Content-Language header field for the part, if present;
otherwise returns an empty string.
*/
QString QMailMessagePart::contentLanguage() const
@@ -4749,11 +4749,11 @@ QMailMessagePart::Location QMailMessagePart::location() const
}
/*!
- Returns a non-empty string to identify the part, appropriate for display. If the part
- 'Content-Type' header field contains a 'name' parameter, that value is used. Otherwise,
- if the part has a 'Content-Disposition' header field containing a 'filename' parameter,
- that value is used. Otherwise, if the part has a 'Content-ID' header field, that value
- is used. Finally, a usable name will be created by combining the content type of the
+ Returns a non-empty string to identify the part, appropriate for display. If the part
+ 'Content-Type' header field contains a 'name' parameter, that value is used. Otherwise,
+ if the part has a 'Content-Disposition' header field containing a 'filename' parameter,
+ that value is used. Otherwise, if the part has a 'Content-ID' header field, that value
+ is used. Finally, a usable name will be created by combining the content type of the
part with the part's number.
\sa identifier()
@@ -4780,10 +4780,10 @@ QString QMailMessagePart::displayName() const
}
/*!
- Returns a non-empty string to identify the part, appropriate for storage. If the part
- has a 'Content-ID' header field, that value is used. Otherwise, if the part has a
+ Returns a non-empty string to identify the part, appropriate for storage. If the part
+ has a 'Content-ID' header field, that value is used. Otherwise, if the part has a
'Content-Disposition' header field containing a 'filename' parameter, that value is used.
- Otherwise, if the part 'Content-Type' header field contains a 'name' parameter, that value
+ Otherwise, if the part 'Content-Type' header field contains a 'name' parameter, that value
is used. Finally, the part's number will be returned.
*/
QString QMailMessagePart::identifier() const
@@ -4866,7 +4866,7 @@ void QMailMessagePart::setReferenceResolution(const QString &uri)
static QString randomString(int length)
{
- if (length <= 0)
+ if (length <= 0)
return QString();
QString str;
@@ -4916,7 +4916,7 @@ static QString partFileName(const QMailMessagePart &part)
/*!
Writes the decoded body of the part to a file under the directory specified by \a path.
- The name of the resulting file is taken from the part. If that file name already exists
+ The name of the resulting file is taken from the part. If that file name already exists
in the path a new unique name of the format <random chars>.<filename> is saved.
Returns the path of the file written on success, or an empty string otherwise.
@@ -4951,14 +4951,14 @@ QString QMailMessagePart::writeBodyTo(const QString &path) const
qWarning() << "Could not write part data to file " << filepath;
return QString();
}
-
+
return filepath;
}
/*!
Returns an indication of the size of the part. This measure should be used
only in comparing the relative size of parts with respect to transmission.
-*/
+*/
uint QMailMessagePart::indicativeSize() const
{
return impl(this)->indicativeSize();
@@ -4987,11 +4987,11 @@ void QMailMessagePart::output(QDataStream& out, bool includeAttachments, bool ex
return impl(this)->output<DummyChunkProcessor>(&ds, false, includeAttachments, excludeInternalFields, 0);
}
-/*!
+/*!
\fn QMailMessagePart::serialize(Stream&) const
- \internal
+ \internal
*/
-template <typename Stream>
+template <typename Stream>
void QMailMessagePart::serialize(Stream &stream) const
{
impl(this)->serialize(stream);
@@ -4999,11 +4999,11 @@ void QMailMessagePart::serialize(Stream &stream) const
template void QMailMessagePart::serialize(QDataStream &) const;
-/*!
+/*!
\fn QMailMessagePart::deserialize(Stream&)
- \internal
+ \internal
*/
-template <typename Stream>
+template <typename Stream>
void QMailMessagePart::deserialize(Stream &stream)
{
impl(this)->deserialize(stream);
@@ -5164,7 +5164,7 @@ void QMailMessageMetaDataPrivate::setReceivedDate(const QMailTimeStamp& timeStam
void QMailMessageMetaDataPrivate::setFrom(const QString& s)
{
updateMember(_from, s);
-}
+}
void QMailMessageMetaDataPrivate::setTo(const QString& s)
{
@@ -5260,7 +5260,7 @@ void QMailMessageMetaDataPrivate::setCustomFields(const QMap<QString, QString> &
_customFieldsModified = true;
}
-template <typename Stream>
+template <typename Stream>
void QMailMessageMetaDataPrivate::serialize(Stream &stream) const
{
stream << _messageType;
@@ -5290,7 +5290,7 @@ void QMailMessageMetaDataPrivate::serialize(Stream &stream) const
stream << _dirty;
}
-template <typename Stream>
+template <typename Stream>
void QMailMessageMetaDataPrivate::deserialize(Stream &stream)
{
QString timeStamp;
@@ -5329,25 +5329,25 @@ void QMailMessageMetaDataPrivate::deserialize(Stream &stream)
\class QMailMessageMetaData
\brief The QMailMessageMetaData class provides information about a message stored by Qtopia.
-
+
\ingroup messaginglibrary
-
+
The QMailMessageMetaData class provides information about messages stored in the Qt Extended system as QMailMessage objects. The meta data is more compact and more easily accessed and
- manipulated than the content of the message itself. Many messaging-related tasks can
- be accomplished by manipulating the message meta data, such as listing, filtering, and
+ manipulated than the content of the message itself. Many messaging-related tasks can
+ be accomplished by manipulating the message meta data, such as listing, filtering, and
searching through sets of messages.
QMailMessageMetaData objects can be created as needed, specifying the identifier of
- the message whose meta data is required. The meta data of a message can be located by
- specifying the QMailMessageId identifier directly, or by specifying the account and server UID
+ the message whose meta data is required. The meta data of a message can be located by
+ specifying the QMailMessageId identifier directly, or by specifying the account and server UID
pair needed to locate the message.
- The content of the message described by the meta data object can be accessed by creating
+ The content of the message described by the meta data object can be accessed by creating
a QMailMessage object specifying the identifier returned by QMailMessageMetaData::id().
\sa QMailStore, QMailMessageId
-*/
-
+*/
+
/*!
\typedef QMailMessageMetaData::ImplementationType
\internal
@@ -5356,7 +5356,7 @@ void QMailMessageMetaDataPrivate::deserialize(Stream &stream)
/*!
\variable QMailMessageMetaData::Incoming
- The status mask needed for testing the value of the registered status flag named
+ The status mask needed for testing the value of the registered status flag named
\c "Incoming" against the result of QMailMessage::status().
This flag indicates that the message has been sent from an external source to an
@@ -5366,17 +5366,17 @@ void QMailMessageMetaDataPrivate::deserialize(Stream &stream)
/*!
\variable QMailMessageMetaData::Outgoing
- The status mask needed for testing the value of the registered status flag named
+ The status mask needed for testing the value of the registered status flag named
\c "Outgoing" against the result of QMailMessage::status().
- This flag indicates that the message originates within Qt Extended, for transmission
+ This flag indicates that the message originates within Qt Extended, for transmission
to an external message sink.
*/
/*!
\variable QMailMessageMetaData::Sent
- The status mask needed for testing the value of the registered status flag named
+ The status mask needed for testing the value of the registered status flag named
\c "Sent" against the result of QMailMessage::status().
This flag indicates that the message has been delivered to an external message sink.
@@ -5385,27 +5385,27 @@ void QMailMessageMetaDataPrivate::deserialize(Stream &stream)
/*!
\variable QMailMessageMetaData::Replied
- The status mask needed for testing the value of the registered status flag named
+ The status mask needed for testing the value of the registered status flag named
\c "Replied" against the result of QMailMessage::status().
- This flag indicates that a message replying to the source of this message has been
+ This flag indicates that a message replying to the source of this message has been
created, in response to this message.
*/
/*!
\variable QMailMessageMetaData::RepliedAll
- The status mask needed for testing the value of the registered status flag named
+ The status mask needed for testing the value of the registered status flag named
\c "RepliedAll" against the result of QMailMessage::status().
- This flag indicates that a message replying to the source of this message and all
+ This flag indicates that a message replying to the source of this message and all
its recipients, has been created in response to this message.
*/
/*!
\variable QMailMessageMetaData::Forwarded
- The status mask needed for testing the value of the registered status flag named
+ The status mask needed for testing the value of the registered status flag named
\c "Forwarded" against the result of QMailMessage::status().
This flag indicates that a message forwarding the content of this message has been created.
@@ -5414,7 +5414,7 @@ void QMailMessageMetaDataPrivate::deserialize(Stream &stream)
/*!
\variable QMailMessageMetaData::Read
- The status mask needed for testing the value of the registered status flag named
+ The status mask needed for testing the value of the registered status flag named
\c "Read" against the result of QMailMessage::status().
This flag indicates that the content of this message has been displayed to the user.
@@ -5423,7 +5423,7 @@ void QMailMessageMetaDataPrivate::deserialize(Stream &stream)
/*!
\variable QMailMessageMetaData::Removed
- The status mask needed for testing the value of the registered status flag named
+ The status mask needed for testing the value of the registered status flag named
\c "Removed" against the result of QMailMessage::status().
This flag indicates that the message has been deleted from or moved on the originating server.
@@ -5432,7 +5432,7 @@ void QMailMessageMetaDataPrivate::deserialize(Stream &stream)
/*!
\variable QMailMessageMetaData::ReadElsewhere
- The status mask needed for testing the value of the registered status flag named
+ The status mask needed for testing the value of the registered status flag named
\c "ReadElsewhere" against the result of QMailMessage::status().
This flag indicates that the content of this message has been reported as having
@@ -5442,7 +5442,7 @@ void QMailMessageMetaDataPrivate::deserialize(Stream &stream)
/*!
\variable QMailMessageMetaData::UnloadedData
- The status mask needed for testing the value of the registered status flag named
+ The status mask needed for testing the value of the registered status flag named
\c "UnloadedData" against the result of QMailMessage::status().
This flag indicates that the meta data of the message is not loaded in entirety.
@@ -5451,7 +5451,7 @@ void QMailMessageMetaDataPrivate::deserialize(Stream &stream)
/*!
\variable QMailMessageMetaData::New
- The status mask needed for testing the value of the registered status flag named
+ The status mask needed for testing the value of the registered status flag named
\c "New" against the result of QMailMessage::status().
This flag indicates that the meta data of the message has not yet been displayed to the user.
@@ -5460,7 +5460,7 @@ void QMailMessageMetaDataPrivate::deserialize(Stream &stream)
/*!
\variable QMailMessageMetaData::ReadReplyRequested
- The status mask needed for testing the value of the registered status flag named
+ The status mask needed for testing the value of the registered status flag named
\c "ReadReplyRequested" against the result of QMailMessage::status().
This flag indicates that the message has requested that a read confirmation reply be returned to the sender.
@@ -5469,7 +5469,7 @@ void QMailMessageMetaDataPrivate::deserialize(Stream &stream)
/*!
\variable QMailMessageMetaData::Trash
- The status mask needed for testing the value of the registered status flag named
+ The status mask needed for testing the value of the registered status flag named
\c "Trash" against the result of QMailMessage::status().
This flag indicates that the message has been marked as trash, and should be considered logically deleted.
@@ -5478,7 +5478,7 @@ void QMailMessageMetaDataPrivate::deserialize(Stream &stream)
/*!
\variable QMailMessageMetaData::ContentAvailable
- The status mask needed for testing the value of the registered status flag named
+ The status mask needed for testing the value of the registered status flag named
\c "ContentAvailable" against the result of QMailMessage::status().
This flag indicates that the entire content of the message has been retrieved from the originating server,
@@ -5490,7 +5490,7 @@ void QMailMessageMetaDataPrivate::deserialize(Stream &stream)
/*!
\variable QMailMessageMetaData::PartialContentAvailable
- The status mask needed for testing the value of the registered status flag named
+ The status mask needed for testing the value of the registered status flag named
\c "PartialContentAvailable" against the result of QMailMessage::status().
This flag indicates that some portion of the content of the message has been retrieved from the originating server.
@@ -5501,7 +5501,7 @@ void QMailMessageMetaDataPrivate::deserialize(Stream &stream)
/*!
\variable QMailMessageMetaData::HasAttachments
- The status mask needed for testing the value of the registered status flag named
+ The status mask needed for testing the value of the registered status flag named
\c "HasAttachments" against the result of QMailMessage::status().
This flag indicates that the message contains at least one sub-part with 'Attachment' disposition.
@@ -5512,7 +5512,7 @@ void QMailMessageMetaDataPrivate::deserialize(Stream &stream)
/*!
\variable QMailMessageMetaData::HasReferences
- The status mask needed for testing the value of the registered status flag named
+ The status mask needed for testing the value of the registered status flag named
\c "HasReferences" against the result of QMailMessage::status().
This flag indicates that the message contains at least one sub-part which is a reference to an external message element.
@@ -5523,7 +5523,7 @@ void QMailMessageMetaDataPrivate::deserialize(Stream &stream)
/*!
\variable QMailMessageMetaData::HasUnresolvedReferences
- The status mask needed for testing the value of the registered status flag named
+ The status mask needed for testing the value of the registered status flag named
\c "HasUnresolvedReferences" against the result of QMailMessage::status().
This flag indicates that the message contains at least one sub-part which is a reference, that has no corresponding resolution value.
@@ -5534,7 +5534,7 @@ void QMailMessageMetaDataPrivate::deserialize(Stream &stream)
/*!
\variable QMailMessageMetaData::Draft
- The status mask needed for testing the value of the registered status flag named
+ The status mask needed for testing the value of the registered status flag named
\c "Draft" against the result of QMailMessage::status().
This flag indicates that the message has been marked as a draft, and should be considered subject to further composition.
@@ -5543,7 +5543,7 @@ void QMailMessageMetaDataPrivate::deserialize(Stream &stream)
/*!
\variable QMailMessageMetaData::Outbox
- The status mask needed for testing the value of the registered status flag named
+ The status mask needed for testing the value of the registered status flag named
\c "Outbox" against the result of QMailMessage::status().
This flag indicates that the message has been marked as ready for transmission.
@@ -5552,7 +5552,7 @@ void QMailMessageMetaDataPrivate::deserialize(Stream &stream)
/*!
\variable QMailMessageMetaData::Junk
- The status mask needed for testing the value of the registered status flag named
+ The status mask needed for testing the value of the registered status flag named
\c "Junk" against the result of QMailMessage::status().
This flag indicates that the message has been marked as junk, and should be considered unsuitable for standard listings.
@@ -5561,7 +5561,7 @@ void QMailMessageMetaDataPrivate::deserialize(Stream &stream)
/*!
\variable QMailMessageMetaData::TransmitFromExternal
- The status mask needed for testing the value of the registered status flag named
+ The status mask needed for testing the value of the registered status flag named
\c "TransmitFromExternal" against the result of QMailMessage::status().
This flag indicates that the message should be transmitted by reference to its external server location.
@@ -5570,7 +5570,7 @@ void QMailMessageMetaDataPrivate::deserialize(Stream &stream)
/*!
\variable QMailMessageMetaData::LocalOnly
- The status mask needed for testing the value of the registered status flag named
+ The status mask needed for testing the value of the registered status flag named
\c "LocalOnly" against the result of QMailMessage::status().
This flag indicates that the message exists only on the local device, and has no representation on any external server.
@@ -5619,7 +5619,7 @@ QMailMessageMetaData::QMailMessageMetaData(const QMailMessageId& id)
}
/*!
- Constructs a message meta data object from data stored in the message store with the unique
+ Constructs a message meta data object from data stored in the message store with the unique
identifier \a uid from the account with id \a accountId.
*/
QMailMessageMetaData::QMailMessageMetaData(const QString& uid, const QMailAccountId& accountId)
@@ -5730,7 +5730,7 @@ void QMailMessageMetaData::setSubject(const QString &subject)
/*!
- Returns the timestamp contained in the origination date header field of the message, if present;
+ Returns the timestamp contained in the origination date header field of the message, if present;
otherwise returns an empty timestamp.
*/
QMailTimeStamp QMailMessageMetaData::date() const
@@ -5763,7 +5763,7 @@ void QMailMessageMetaData::setReceivedDate(const QMailTimeStamp &timeStamp)
impl(this)->setReceivedDate(timeStamp);
}
-/*!
+/*!
Returns the list of primary recipients for the message.
\sa QMailAddress
@@ -5773,7 +5773,7 @@ QList<QMailAddress> QMailMessageMetaData::to() const
return QMailAddress::fromStringList(impl(this)->_to);
}
-/*!
+/*!
Sets the list of primary recipients for the message to \a toList.
*/
void QMailMessageMetaData::setTo(const QList<QMailAddress>& toList)
@@ -5781,7 +5781,7 @@ void QMailMessageMetaData::setTo(const QList<QMailAddress>& toList)
impl(this)->setTo(QMailAddress::toStringList(toList).join(","));
}
-/*!
+/*!
Sets the list of primary recipients for the message to contain \a address.
*/
void QMailMessageMetaData::setTo(const QMailAddress& address)
@@ -5793,7 +5793,7 @@ void QMailMessageMetaData::setTo(const QMailAddress& address)
Returns the status value for the message.
\sa setStatus(), statusMask()
-*/
+*/
quint64 QMailMessageMetaData::status() const
{
return impl(this)->_status;
@@ -5828,7 +5828,7 @@ void QMailMessageMetaData::setStatus(quint64 mask, bool set)
#ifndef QTOPIAMAIL_PARSING_ONLY
/*!
Returns the id of the originating account for the message.
-*/
+*/
QMailAccountId QMailMessageMetaData::parentAccountId() const
{
return impl(this)->_parentAccountId;
@@ -5836,7 +5836,7 @@ QMailAccountId QMailMessageMetaData::parentAccountId() const
/*!
Sets the id of the originating account for the message to \a id.
-*/
+*/
void QMailMessageMetaData::setParentAccountId(const QMailAccountId& id)
{
impl(this)->setParentAccountId(id);
@@ -5845,7 +5845,7 @@ void QMailMessageMetaData::setParentAccountId(const QMailAccountId& id)
/*!
Returns the identifier for the message on the originating server.
-*/
+*/
QString QMailMessageMetaData::serverUid() const
{
return impl(this)->_serverUid;
@@ -5854,7 +5854,7 @@ QString QMailMessageMetaData::serverUid() const
/*!
Sets the originating server identifier for the message to \a server.
The identifier specified should be unique.
-*/
+*/
void QMailMessageMetaData::setServerUid(const QString &server)
{
impl(this)->setServerUid(server);
@@ -5862,7 +5862,7 @@ void QMailMessageMetaData::setServerUid(const QString &server)
/*!
Returns the complete size of the message as indicated on the originating server.
-*/
+*/
uint QMailMessageMetaData::size() const
{
return impl(this)->_size;
@@ -5870,7 +5870,7 @@ uint QMailMessageMetaData::size() const
/*!
Sets the complete size of the message as found on the server to \a size.
-*/
+*/
void QMailMessageMetaData::setSize(uint size)
{
impl(this)->setSize(size);
@@ -5879,7 +5879,7 @@ void QMailMessageMetaData::setSize(uint size)
/*!
Returns an indication of the size of the message. This measure should be used
only in comparing the relative size of messages with respect to transmission.
-*/
+*/
uint QMailMessageMetaData::indicativeSize() const
{
return impl(this)->indicativeSize();
@@ -5887,7 +5887,7 @@ uint QMailMessageMetaData::indicativeSize() const
/*!
Returns the type of content contained within the message.
-*/
+*/
QMailMessage::ContentType QMailMessageMetaData::content() const
{
return impl(this)->_contentType;
@@ -5896,9 +5896,9 @@ QMailMessage::ContentType QMailMessageMetaData::content() const
/*!
\fn QMailMessageMetaData::setContent(QMailMessageMetaData::ContentType)
- Sets the type of content contained within the message to \a type.
+ Sets the type of content contained within the message to \a type.
It is the caller's responsibility to ensure that this value matches the actual content.
-*/
+*/
void QMailMessageMetaData::setContent(QMailMessage::ContentType type)
{
impl(this)->setContent(type);
@@ -5906,7 +5906,7 @@ void QMailMessageMetaData::setContent(QMailMessage::ContentType type)
#ifndef QTOPIAMAIL_PARSING_ONLY
/*!
- Return the QMailFolderId of the folder that contained the message before it was
+ Return the QMailFolderId of the folder that contained the message before it was
moved into the current parent folder.
*/
QMailFolderId QMailMessageMetaData::previousParentFolderId() const
@@ -5915,7 +5915,7 @@ QMailFolderId QMailMessageMetaData::previousParentFolderId() const
}
/*!
- Sets the QMailFolderId of the folder that contained the message before it was
+ Sets the QMailFolderId of the folder that contained the message before it was
moved into the current parent folder to \a id.
*/
void QMailMessageMetaData::setPreviousParentFolderId(const QMailFolderId &id)
@@ -5926,7 +5926,7 @@ void QMailMessageMetaData::setPreviousParentFolderId(const QMailFolderId &id)
/*!
Returns the scheme used to store the content of this message.
-*/
+*/
QString QMailMessageMetaData::contentScheme() const
{
return impl(this)->_contentScheme;
@@ -5935,7 +5935,7 @@ QString QMailMessageMetaData::contentScheme() const
/*!
Sets the scheme used to store the content of this message to \a scheme, and returns
true if successful. Once set, the scheme cannot be modified.
-*/
+*/
bool QMailMessageMetaData::setContentScheme(const QString &scheme)
{
if (!impl(this)->_contentScheme.isEmpty() && (impl(this)->_contentScheme != scheme)) {
@@ -5948,7 +5948,7 @@ bool QMailMessageMetaData::setContentScheme(const QString &scheme)
/*!
Returns the identifer used to locate the content of this message.
-*/
+*/
QString QMailMessageMetaData::contentIdentifier() const
{
return impl(this)->_contentIdentifier;
@@ -5959,7 +5959,7 @@ QString QMailMessageMetaData::contentIdentifier() const
true if successful. Once set, the identifier cannot be modified.
The identifier specified should be unique within the scheme returned by contentScheme().
-*/
+*/
bool QMailMessageMetaData::setContentIdentifier(const QString &identifier)
{
impl(this)->setContentIdentifier(identifier);
@@ -5968,7 +5968,7 @@ bool QMailMessageMetaData::setContentIdentifier(const QString &identifier)
/*!
Returns the identifier of the message that this message was created in response to.
-*/
+*/
QMailMessageId QMailMessageMetaData::inResponseTo() const
{
return impl(this)->_responseId;
@@ -5986,7 +5986,7 @@ void QMailMessageMetaData::setInResponseTo(const QMailMessageId &id)
Returns the type of response that this message was created as.
\sa inResponseTo()
-*/
+*/
QMailMessageMetaData::ResponseType QMailMessageMetaData::responseType() const
{
return impl(this)->_responseType;
@@ -6032,7 +6032,7 @@ void QMailMessageMetaData::setUnmodified()
#ifndef QTOPIAMAIL_PARSING_ONLY
/*!
- Returns the status bitmask needed to test the result of QMailMessageMetaData::status()
+ Returns the status bitmask needed to test the result of QMailMessageMetaData::status()
against the QMailMessageMetaData status flag registered with the identifier \a flagName.
\sa status(), QMailStore::messageStatusMask()
@@ -6043,7 +6043,7 @@ quint64 QMailMessageMetaData::statusMask(const QString &flagName)
}
#endif
-/*!
+/*!
Returns the value recorded in the custom field named \a name.
\sa setCustomField(), customFields()
@@ -6053,7 +6053,7 @@ QString QMailMessageMetaData::customField(const QString &name) const
return d->customField(name);
}
-/*!
+/*!
Sets the value of the custom field named \a name to \a value.
\sa customField(), customFields()
@@ -6063,7 +6063,7 @@ void QMailMessageMetaData::setCustomField(const QString &name, const QString &va
d->setCustomField(name, value);
}
-/*!
+/*!
Removes the custom field named \a name.
\sa customField(), customFields()
@@ -6073,7 +6073,7 @@ void QMailMessageMetaData::removeCustomField(const QString &name)
d->removeCustomField(name);
}
-/*!
+/*!
Returns the map of custom fields stored in the message.
\sa customField(), setCustomField()
@@ -6109,11 +6109,11 @@ void QMailMessageMetaData::initStore()
}
#endif
-/*!
+/*!
\fn QMailMessageMetaData::serialize(Stream&) const
- \internal
+ \internal
*/
-template <typename Stream>
+template <typename Stream>
void QMailMessageMetaData::serialize(Stream &stream) const
{
impl(this)->serialize(stream);
@@ -6121,11 +6121,11 @@ void QMailMessageMetaData::serialize(Stream &stream) const
template void QMailMessageMetaData::serialize(QDataStream &) const;
-/*!
+/*!
\fn QMailMessageMetaData::deserialize(Stream&)
- \internal
+ \internal
*/
-template <typename Stream>
+template <typename Stream>
void QMailMessageMetaData::deserialize(Stream &stream)
{
impl(this)->deserialize(stream);
@@ -6194,7 +6194,7 @@ void QMailMessagePrivate::setDate(const QMailTimeStamp& timeStamp)
void QMailMessagePrivate::setFrom(const QString& s)
{
updateHeaderField( "From:", s );
-}
+}
void QMailMessagePrivate::setReplyTo(const QString& s)
{
@@ -6235,7 +6235,7 @@ bool QMailMessagePrivate::hasRecipients() const
uint QMailMessagePrivate::indicativeSize() const
{
- uint size = QMailMessagePartContainerPrivate::indicativeSize();
+ uint size = QMailMessagePartContainerPrivate::indicativeSize();
// Count the message header as one size unit
return (size + 1);
@@ -6285,7 +6285,7 @@ void QMailMessagePrivate::toRfc2822(QDataStream **out, QMailMessage::EncodingFor
bool isOutgoing = (messageStatus & (QMailMessage::Outgoing | QMailMessage::Sent));
bool addTimeStamp = (format != QMailMessage::IdentityFormat);
- bool addContentHeaders = ((format != QMailMessage::IdentityFormat) &&
+ bool addContentHeaders = ((format != QMailMessage::IdentityFormat) &&
((format != QMailMessage::StorageFormat) || isOutgoing || !hasBody()));
bool includeBcc = (format != QMailMessage::TransmissionFormat);
bool excludeInternalFields = (format == QMailMessage::TransmissionFormat);
@@ -6350,13 +6350,13 @@ void QMailMessagePrivate::setUnmodified()
setDirty(false, true);
}
-template <typename Stream>
+template <typename Stream>
void QMailMessagePrivate::serialize(Stream &stream) const
{
QMailMessagePartContainerPrivate::serialize(stream);
}
-template <typename Stream>
+template <typename Stream>
void QMailMessagePrivate::deserialize(Stream &stream)
{
QMailMessagePartContainerPrivate::deserialize(stream);
@@ -6369,34 +6369,34 @@ void QMailMessagePrivate::deserialize(Stream &stream)
\class QMailMessage
\brief The QMailMessage class provides a convenient interface for working with messages.
-
+
\ingroup messaginglibrary
-
- QMailMessage supports a number of types. These include telephony types
- such as SMS and MMS, and internet email messages as defined in
- \l{http://www.ietf.org/rfc/rfc2822.txt} {RFC 2822} (Internet Message Format), and
- \l{http://www.ietf.org/rfc/rfc2045.txt} {RFC 2045} (Format of Internet Message Bodies) through
+
+ QMailMessage supports a number of types. These include telephony types
+ such as SMS and MMS, and internet email messages as defined in
+ \l{http://www.ietf.org/rfc/rfc2822.txt} {RFC 2822} (Internet Message Format), and
+ \l{http://www.ietf.org/rfc/rfc2045.txt} {RFC 2045} (Format of Internet Message Bodies) through
\l{http://www.ietf.org/rfc/rfc2049.txt} {RFC 2049} (Conformance Criteria and Examples).
-
+
The most common way to use QMailMessage is to initialize it from raw
data using QMailMessage::fromRfc2822().
-
- A QMailMessage can also be constructed piece by piece using functions such as
- setMessageType(), setFrom(), setTo(), setSubject(), and setBody() or appendPart().
+
+ A QMailMessage can also be constructed piece by piece using functions such as
+ setMessageType(), setFrom(), setTo(), setSubject(), and setBody() or appendPart().
Convenience functions such as from()/setFrom() and date()/setDate() accept and
return wrapper types, to simplify the exchange of correctly-formatted data.
- In some cases, however, it may be simpler for clients to get and set the content
+ In some cases, however, it may be simpler for clients to get and set the content
of header fields directly, using the headerField() and setHeaderField() functions inherited
from QMailMessagePartContainer.
-
- Messages can be added to the QMailStore, or retrieved from the store via their QMailMessageId
+
+ Messages can be added to the QMailStore, or retrieved from the store via their QMailMessageId
identifier. The QMailMessage object also provides access to any relevant meta data
describing the message, using the functions inherited from QMailMessageMetaData.
A message may be serialized to a QDataStream, or returned as a QByteArray using toRfc2822().
-
+
\sa QMailMessageMetaData, QMailMessagePart, QMailMessageBody, QMailStore, QMailMessageId
-*/
+*/
const char QMailMessage::CarriageReturn = '\015';
@@ -6424,7 +6424,7 @@ QMailMessage::QMailMessage(const QMailMessageId& id)
}
/*!
- Constructs a message object from data stored in the message store with the unique
+ Constructs a message object from data stored in the message store with the unique
identifier \a uid from the account with id \a accountId.
*/
QMailMessage::QMailMessage(const QString& uid, const QMailAccountId& accountId)
@@ -6537,7 +6537,7 @@ QByteArray QMailMessage::toRfc2822(EncodingFormat format) const
}
/*!
- Writes the message to the output stream \a out, in RFC 2822 format.
+ Writes the message to the output stream \a out, in RFC 2822 format.
The encoded content will vary depending on the value of \a format.
*/
void QMailMessage::toRfc2822(QDataStream& out, EncodingFormat format) const
@@ -6562,7 +6562,7 @@ struct ChunkStore
close();
}
- void close()
+ void close()
{
if (ds) {
delete ds;
@@ -6646,7 +6646,7 @@ void QMailMessage::setTo(const QMailAddress& address)
Returns a list of all the cc (carbon copy) recipients specified for the message.
\sa to(), bcc(), QMailAddress
-*/
+*/
QList<QMailAddress> QMailMessage::cc() const
{
return QMailAddress::fromStringList(headerFieldText("Cc"));
@@ -6656,7 +6656,7 @@ QList<QMailAddress> QMailMessage::cc() const
Set the list of cc (carbon copy) recipients for the message to \a ccList.
\sa setTo(), setBcc()
-*/
+*/
void QMailMessage::setCc(const QList<QMailAddress>& ccList)
{
partContainerImpl()->setCc(QMailAddress::toStringList(ccList).join(","));
@@ -6666,7 +6666,7 @@ void QMailMessage::setCc(const QList<QMailAddress>& ccList)
Returns a list of all the bcc (blind carbon copy) recipients specified for the message.
\sa to(), cc(), QMailAddress
-*/
+*/
QList<QMailAddress> QMailMessage::bcc() const
{
return QMailAddress::fromStringList(headerFieldText("Bcc"));
@@ -6676,7 +6676,7 @@ QList<QMailAddress> QMailMessage::bcc() const
Set the list of bcc (blind carbon copy) recipients for the message to \a bccList.
\sa setTo(), setCc()
-*/
+*/
void QMailMessage::setBcc(const QList<QMailAddress>& bccList)
{
partContainerImpl()->setBcc(QMailAddress::toStringList(bccList).join(","));
@@ -6684,7 +6684,7 @@ void QMailMessage::setBcc(const QList<QMailAddress>& bccList)
/*!
Returns the address specified by the RFC 2822 'Reply-To' field for the message, if present.
-*/
+*/
QMailAddress QMailMessage::replyTo() const
{
return QMailAddress(headerFieldText("Reply-To"));
@@ -6692,7 +6692,7 @@ QMailAddress QMailMessage::replyTo() const
/*!
Sets the RFC 2822 'Reply-To' address of the message to \a address.
-*/
+*/
void QMailMessage::setReplyTo(const QMailAddress &address)
{
partContainerImpl()->setReplyTo(address.toString());
@@ -6700,7 +6700,7 @@ void QMailMessage::setReplyTo(const QMailAddress &address)
/*!
Returns the message ID specified by the RFC 2822 'In-Reply-To' field for the message, if present.
-*/
+*/
QString QMailMessage::inReplyTo() const
{
return headerFieldText("In-Reply-To");
@@ -6718,7 +6718,7 @@ void QMailMessage::setInReplyTo(const QString &messageId)
Returns a list of all the recipients specified for the message, either as To, CC, or BCC addresses.
\sa to(), cc(), bcc(), hasRecipients()
-*/
+*/
QList<QMailAddress> QMailMessage::recipients() const
{
QList<QMailAddress> addresses;
@@ -6739,15 +6739,15 @@ QList<QMailAddress> QMailMessage::recipients() const
}
/*!
- Returns true if there are any recipients (either To, CC or BCC addresses)
+ Returns true if there are any recipients (either To, CC or BCC addresses)
defined for this message; otherwise returns false.
-*/
+*/
bool QMailMessage::hasRecipients() const
{
return partContainerImpl()->hasRecipients();
}
-/*! \reimp */
+/*! \reimp */
uint QMailMessage::indicativeSize() const
{
// Count the message header as one size unit
@@ -6756,7 +6756,7 @@ uint QMailMessage::indicativeSize() const
/*!
Returns the size of the message content excluding any meta data, in bytes.
-*/
+*/
uint QMailMessage::contentSize() const
{
return customField("qtopiamail-content-size").toUInt();
@@ -6772,7 +6772,7 @@ void QMailMessage::setContentSize(uint size)
/*!
Returns a value by which the external location of the message can be referenced, if available.
-*/
+*/
QString QMailMessage::externalLocationReference() const
{
return customField("qtopiamail-external-location-reference");
@@ -6800,30 +6800,30 @@ bool QMailMessage::partialContentAvailable() const
// The QMMMetaData half of this object is implemented in a QMailMessageMetaDataPrivate object
/*! \internal */
-QMailMessageMetaDataPrivate* QMailMessage::metaDataImpl()
-{
- return QMailMessageMetaData::impl<QMailMessageMetaDataPrivate>();
+QMailMessageMetaDataPrivate* QMailMessage::metaDataImpl()
+{
+ return QMailMessageMetaData::impl<QMailMessageMetaDataPrivate>();
}
/*! \internal */
-const QMailMessageMetaDataPrivate* QMailMessage::metaDataImpl() const
-{
- return QMailMessageMetaData::impl<const QMailMessageMetaDataPrivate>();
+const QMailMessageMetaDataPrivate* QMailMessage::metaDataImpl() const
+{
+ return QMailMessageMetaData::impl<const QMailMessageMetaDataPrivate>();
}
// The QMMPartContainer half of this object is implemented in a QMailMessagePrivate object
/*! \internal */
-QMailMessagePrivate* QMailMessage::partContainerImpl()
-{
- return QMailMessagePartContainer::impl<QMailMessagePrivate>();
+QMailMessagePrivate* QMailMessage::partContainerImpl()
+{
+ return QMailMessagePartContainer::impl<QMailMessagePrivate>();
}
/*! \internal */
-const QMailMessagePrivate* QMailMessage::partContainerImpl() const
-{
- return QMailMessagePartContainer::impl<const QMailMessagePrivate>();
+const QMailMessagePrivate* QMailMessage::partContainerImpl() const
+{
+ return QMailMessagePartContainer::impl<const QMailMessagePrivate>();
}
-
+
/*! \internal */
bool QMailMessage::contentModified() const
{
@@ -6899,11 +6899,11 @@ QMailMessage QMailMessage::fromRfc2822(LongString& ls)
return mail;
}
-/*!
+/*!
\fn QMailMessage::serialize(Stream&) const
- \internal
+ \internal
*/
-template <typename Stream>
+template <typename Stream>
void QMailMessage::serialize(Stream &stream) const
{
metaDataImpl()->serialize(stream);
@@ -6912,11 +6912,11 @@ void QMailMessage::serialize(Stream &stream) const
template void QMailMessage::serialize(QDataStream &) const;
-/*!
+/*!
\fn QMailMessage::deserialize(Stream&)
- \internal
+ \internal
*/
-template <typename Stream>
+template <typename Stream>
void QMailMessage::deserialize(Stream &stream)
{
metaDataImpl()->deserialize(stream);
diff --git a/src/messaging/win32wce/qmailmessagefwd.cpp b/src/messaging/win32wce/qmailmessagefwd.cpp
index a77111c4c9..d77b4debf4 100644
--- a/src/messaging/win32wce/qmailmessagefwd.cpp
+++ b/src/messaging/win32wce/qmailmessagefwd.cpp
@@ -42,14 +42,15 @@
/*!
\class QMailMessageHeaderFieldFwd
\brief The QMailMessageHeaderFieldFwd class declares enumerations used by QMailMessageHeaderField
-
- QMailMessageHeaderFieldFwd allows QMailMessageHeaderField::FieldType
+
+
+ QMailMessageHeaderFieldFwd allows QMailMessageHeaderField::FieldType
to be used without including all of \c qmailmessage.h.
*/
/*!
\enum QMailMessageHeaderFieldFwd::FieldType
-
+
This enum type is used to describe the formatting of field content.
\value StructuredField The field content should be parsed assuming it is structured according to the specification for RFC 2045 'Content-Type' fields.
@@ -59,14 +60,15 @@
/*!
\class QMailMessageContentDispositionFwd
\brief The QMailMessageContentDispositionFwd class declares enumerations used by QMailMessageContentDisposition
-
- QMailMessageContentDispositionFwd allows QMailMessageContentDisposition::DispositionType
+
+
+ QMailMessageContentDispositionFwd allows QMailMessageContentDisposition::DispositionType
to be used without including all of \c qmailmessage.h.
*/
/*!
\enum QMailMessageContentDispositionFwd::DispositionType
-
+
This enum type is used to describe the disposition of a message part.
\value Attachment The part data should be presented as an attachment.
@@ -77,16 +79,17 @@
/*!
\class QMailMessageBodyFwd
\brief The QMailMessageBodyFwd class declares enumerations used by QMailMessageBody
-
+
+
QMailMessageBodyFwd allows QMailMessageBody::TransferEncoding and QMailMessageBody::EncodingStatus
to be used without including all of \c qmailmessage.h.
*/
/*!
\enum QMailMessageBodyFwd::TransferEncoding
-
+
This enum type is used to describe a type of binary to text encoding.
- Encoding types used here are documented in
+ Encoding types used here are documented in
\l {http://www.ietf.org/rfc/rfc2045.txt}{RFC 2045} "Format of Internet Message Bodies"
\value NoEncoding The encoding is not specified.
@@ -101,7 +104,7 @@
/*!
\enum QMailMessageBodyFwd::EncodingStatus
-
+
This enum type is used to describe the encoding status of body data.
\value AlreadyEncoded The body data is already encoded to the necessary encoding.
@@ -110,17 +113,18 @@
/*!
\enum QMailMessageBodyFwd::EncodingFormat
-
+
This enum type is used to describe the format in which body data should be presented.
- \value Encoded The body data should be presented in encoded form.
- \value Decoded The body data should be presented in unencoded form.
+ \value Encoded The body data should be presented in encoded form.
+ \value Decoded The body data should be presented in unencoded form.
*/
/*!
\class QMailMessagePartContainerFwd
\brief The QMailMessagePartContainerFwd class declares enumerations used by QMailMessagePartContainer
-
+
+
QMailMessagePartContainerFwd allows QMailMessagePartContainerFwd::MultipartType
to be used without including all of \c qmailmessage.h.
*/
@@ -143,9 +147,10 @@
*/
/*!
- \class QMailMessagePartFwd
+ \class QMailMessagePartFwd
\brief The QMailMessagePartFwd class declares enumerations used by QMailMessagePart
-
+
+
QMailMessagePartFwd allows QMailMessagePartFwd::ReferenceType
to be used without including all of \c qmailmessage.h.
*/
@@ -163,7 +168,8 @@
/*!
\class QMailMessageMetaDataFwd
\brief The QMailMessageMetaDataFwd class declares enumerations used by QMailMessageMetaData
-
+
+
QMailMessageMetaDataFwd allows QMailMessageMetaData::MessageType, QMailMessageMetaData::ContentType and QMailMessageMetaData::ResponseType
to be used without including all of \c qmailmessage.h.
*/
@@ -222,7 +228,8 @@
/*!
\class QMailMessageFwd
\brief The QMailMessageFwd class declares enumerations used by QMailMessage
-
+
+
QMailMessageFwd allows QMailMessage::AttachmentsAction and QMailMessage::EncodingFormat
to be used without including all of \c qmailmessage.h.
*/
@@ -230,14 +237,14 @@
/*!
\enum QMailMessageFwd::AttachmentsAction
- This enum type is used to describe the action that should be performed on
+ This enum type is used to describe the action that should be performed on
each message attachment.
- \value LinkToAttachments Add a part to the message containing a link to the
- supplied attachment. If the document is removed, the
+ \value LinkToAttachments Add a part to the message containing a link to the
+ supplied attachment. If the document is removed, the
message will no longer have access to the data.
\value CopyAttachments Add a part to the message containing a copy of the
- data in the supplied attachment. If the document is
+ data in the supplied attachment. If the document is
removed, the message will still contain the data.
\value CopyAndDeleteAttachments Add a part to the message containing a copy of the
data in the supplied attachment, then delete the
@@ -246,7 +253,7 @@
/*!
\enum QMailMessageFwd::EncodingFormat
-
+
This enum type is used to describe the format in which a message should be serialized.
\value HeaderOnlyFormat Only the header portion of the message is serialized, to RFC 2822 form.
@@ -257,7 +264,7 @@
/*!
\enum QMailMessageFwd::ChunkType
-
+
This enum type is used to denote the content of a single chunk in a partitioned output sequence.
\value Text The chunk contains verbatim output text.
diff --git a/src/messaging/win32wce/qmailtimestamp.cpp b/src/messaging/win32wce/qmailtimestamp.cpp
index d4fa5da66b..eab878dc63 100644
--- a/src/messaging/win32wce/qmailtimestamp.cpp
+++ b/src/messaging/win32wce/qmailtimestamp.cpp
@@ -153,7 +153,7 @@ QMailTimeStampPrivate::QMailTimeStampPrivate(const QString& timeText)
year = value;
if ( year < 100 ) {
year += ( year <= 49 ? 2000 : 1900 );
- }
+ }
else if ( year < 1000 ) {
year += 1900;
}
@@ -172,10 +172,10 @@ QMailTimeStampPrivate::QMailTimeStampPrivate(const QString& timeText)
QTime timeComponent;
QTime parsedTime;
- if ( timeStr.length() == 8 ) {
+ if ( timeStr.length() == 8 ) {
parsedTime = QTime::fromString( timeStr, "hh:mm:ss" );
}
- else if ( timeStr.length() == 5 ) {
+ else if ( timeStr.length() == 5 ) {
// Is this legal? Either way, it seems desirable for robustness...
parsedTime = QTime::fromString( timeStr, "hh:mm" );
}
@@ -228,7 +228,7 @@ QMailTimeStampPrivate::QMailTimeStampPrivate(const QDateTime& dateTime)
}
QMailTimeStampPrivate::QMailTimeStampPrivate(const QMailTimeStampPrivate& other)
- : QSharedData(other)
+ : QSharedData(other)
{
this->operator=(other);
}
@@ -340,9 +340,10 @@ bool QMailTimeStampPrivate::operator>= (const QMailTimeStampPrivate& other) cons
\brief The QMailTimeStamp class manages message time stamps.
\ingroup messaginglibrary
+
QMailTimeStamp provides functions for creating and manipulating the time stamps of messages.
- QMailTimeStamp can be created from time stamp strings, or from QDateTime objects. The
- time stamp information can be extracted in UTC time, local time, or as a formatted
+ QMailTimeStamp can be created from time stamp strings, or from QDateTime objects. The
+ time stamp information can be extracted in UTC time, local time, or as a formatted
string.
QMailTimeStamp maintains the timezone information of a time stamp, so it can be used to
@@ -353,7 +354,7 @@ bool QMailTimeStampPrivate::operator>= (const QMailTimeStampPrivate& other) cons
/*!
\enum QMailTimeStamp::OutputFormat
-
+
This enum type is used to select a format for timestamp output.
\value Rfc2822 The format used in SMTP message format; example: "Wed, 17 May 2006 20:45:00 +0100".
diff --git a/src/multimedia/qcameraflashcontrol.cpp b/src/multimedia/qcameraflashcontrol.cpp
index a35d0d16e5..7b94d42180 100644
--- a/src/multimedia/qcameraflashcontrol.cpp
+++ b/src/multimedia/qcameraflashcontrol.cpp
@@ -53,6 +53,8 @@ QT_BEGIN_NAMESPACE
\ingroup camera
\inmodule QtMultimediaKit
+ \inmodule QtMultimediaKit
+
The interface name of QCameraFlashControl is \c com.nokia.Qt.QCameraFlashControl/1.0 as
defined in QCameraFlashControl_iid.
diff --git a/src/multimedia/qmediarecorder.cpp b/src/multimedia/qmediarecorder.cpp
index 51918f3eca..1bf4e2f653 100644
--- a/src/multimedia/qmediarecorder.cpp
+++ b/src/multimedia/qmediarecorder.cpp
@@ -780,6 +780,9 @@ QVariant QMediaRecorder::metaData(QtMultimediaKit::MetaData key) const
/*!
Sets a \a value for a meta-data \a key.
+
+ \note To ensure that meta data is set corretly, it should be set before starting the recording.
+ Once the recording is stopped, any meta data set will be attached to the next recording.
*/
void QMediaRecorder::setMetaData(QtMultimediaKit::MetaData key, const QVariant &value)
{
diff --git a/src/multimedia/qtmedianamespace.qdoc b/src/multimedia/qtmedianamespace.qdoc
index acf1036036..a5a642ff02 100644
--- a/src/multimedia/qtmedianamespace.qdoc
+++ b/src/multimedia/qtmedianamespace.qdoc
@@ -43,6 +43,9 @@
This enum provides identifiers for meta-data attributes.
+ \note Not all identifiers are supported on all platforms. Please consult vendor documentation for specific support
+ on different platforms.
+
Common attributes
\value Title The title of the media. QString.
\value SubTitle The sub-title of the media. QString.
diff --git a/src/multimedia/qvideowidget.cpp b/src/multimedia/qvideowidget.cpp
index a738d39f87..ddf9687bd5 100644
--- a/src/multimedia/qvideowidget.cpp
+++ b/src/multimedia/qvideowidget.cpp
@@ -592,6 +592,8 @@ void QVideoWidgetPrivate::_q_dimensionsChanged()
\ingroup multimedia
\inmodule QtMultimediaKit
+ \inmodule QtMultimediaKit
+
Attaching a QVideoWidget to a QMediaObject allows it to display the
video or image output of that media object. A QVideoWidget is attached
to media object by passing a pointer to the QMediaObject in its
diff --git a/src/organizer/qorganizermanager.cpp b/src/organizer/qorganizermanager.cpp
index 5b644425ed..16bd223df4 100644
--- a/src/organizer/qorganizermanager.cpp
+++ b/src/organizer/qorganizermanager.cpp
@@ -344,7 +344,7 @@ QOrganizerManager::~QOrganizerManager()
/*! Return the error code of the most recent operation */
QOrganizerManager::Error QOrganizerManager::error() const
{
- return d->m_error;
+ return d->m_lastError;
}
/*!
@@ -358,7 +358,7 @@ QOrganizerManager::Error QOrganizerManager::error() const
*/
QMap<int, QOrganizerManager::Error> QOrganizerManager::errorMap() const
{
- return d->m_errorMap;
+ return d->m_lastErrorMap;
}
/*!
@@ -375,9 +375,8 @@ QMap<int, QOrganizerManager::Error> QOrganizerManager::errorMap() const
*/
QList<QOrganizerItem> QOrganizerManager::itemOccurrences(const QOrganizerItem& parentItem, const QDateTime& periodStart, const QDateTime& periodEnd, int maxCount, const QOrganizerItemFetchHint& fetchHint) const
{
- d->m_error = QOrganizerManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->itemOccurrences(parentItem, periodStart, periodEnd, maxCount, fetchHint, &d->m_error);
+ QOrganizerManagerSyncOpErrorHolder h(this);
+ return d->m_engine->itemOccurrences(parentItem, periodStart, periodEnd, maxCount, fetchHint, &h.error);
}
/*!
@@ -386,8 +385,8 @@ QList<QOrganizerItem> QOrganizerManager::itemOccurrences(const QOrganizerItem& p
*/
QList<QOrganizerItemId> QOrganizerManager::itemIds(const QOrganizerItemFilter& filter, const QList<QOrganizerItemSortOrder>& sortOrders) const
{
- d->m_error = QOrganizerManager::NoError;
- return d->m_engine->itemIds(QDateTime(), QDateTime(), filter, sortOrders, &d->m_error);
+ QOrganizerManagerSyncOpErrorHolder h(this);
+ return d->m_engine->itemIds(QDateTime(), QDateTime(), filter, sortOrders, &h.error);
}
/*!
@@ -400,9 +399,8 @@ QList<QOrganizerItemId> QOrganizerManager::itemIds(const QOrganizerItemFilter& f
*/
QList<QOrganizerItemId> QOrganizerManager::itemIds(const QDateTime& startDate, const QDateTime& endDate, const QOrganizerItemFilter& filter, const QList<QOrganizerItemSortOrder>& sortOrders) const
{
- d->m_error = QOrganizerManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->itemIds(startDate, endDate, filter, sortOrders, &d->m_error);
+ QOrganizerManagerSyncOpErrorHolder h(this);
+ return d->m_engine->itemIds(startDate, endDate, filter, sortOrders, &h.error);
}
/*!
@@ -423,9 +421,8 @@ QList<QOrganizerItemId> QOrganizerManager::itemIds(const QDateTime& startDate, c
*/
QList<QOrganizerItem> QOrganizerManager::items(const QOrganizerItemFilter& filter, const QList<QOrganizerItemSortOrder>& sortOrders, const QOrganizerItemFetchHint& fetchHint) const
{
- d->m_error = QOrganizerManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->items(QDateTime(), QDateTime(), filter, sortOrders, fetchHint, &d->m_error);
+ QOrganizerManagerSyncOpErrorHolder h(this);
+ return d->m_engine->items(QDateTime(), QDateTime(), filter, sortOrders, fetchHint, &h.error);
}
/*!
@@ -452,9 +449,8 @@ QList<QOrganizerItem> QOrganizerManager::items(const QOrganizerItemFilter& filte
*/
QList<QOrganizerItem> QOrganizerManager::items(const QDateTime& startDate, const QDateTime& endDate, const QOrganizerItemFilter& filter, const QList<QOrganizerItemSortOrder>& sortOrders, const QOrganizerItemFetchHint& fetchHint) const
{
- d->m_error = QOrganizerManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->items(startDate, endDate, filter, sortOrders, fetchHint, &d->m_error);
+ QOrganizerManagerSyncOpErrorHolder h(this);
+ return d->m_engine->items(startDate, endDate, filter, sortOrders, fetchHint, &h.error);
}
/*!
@@ -482,9 +478,8 @@ QList<QOrganizerItem> QOrganizerManager::items(const QDateTime& startDate, const
*/
QList<QOrganizerItem> QOrganizerManager::items(const QDateTime& startDate, const QDateTime& endDate, int maxCount, const QOrganizerItemFilter& filter, const QOrganizerItemFetchHint& fetchHint) const
{
- d->m_error = QOrganizerManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->items(startDate, endDate, maxCount, filter, fetchHint, &d->m_error);
+ QOrganizerManagerSyncOpErrorHolder h(this);
+ return d->m_engine->items(startDate, endDate, maxCount, filter, fetchHint, &h.error);
}
/*!
@@ -509,9 +504,8 @@ QList<QOrganizerItem> QOrganizerManager::items(const QDateTime& startDate, const
*/
QList<QOrganizerItem> QOrganizerManager::itemsForExport(const QDateTime& startDate, const QDateTime& endDate, const QOrganizerItemFilter& filter, const QList<QOrganizerItemSortOrder>& sortOrders, const QOrganizerItemFetchHint& fetchHint) const
{
- d->m_error = QOrganizerManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->itemsForExport(startDate, endDate, filter, sortOrders, fetchHint, &d->m_error);
+ QOrganizerManagerSyncOpErrorHolder h(this);
+ return d->m_engine->itemsForExport(startDate, endDate, filter, sortOrders, fetchHint, &h.error);
}
/*!
@@ -530,9 +524,8 @@ QList<QOrganizerItem> QOrganizerManager::itemsForExport(const QDateTime& startDa
*/
QOrganizerItem QOrganizerManager::item(const QOrganizerItemId& itemId, const QOrganizerItemFetchHint& fetchHint) const
{
- d->m_error = QOrganizerManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->item(itemId, fetchHint, &d->m_error);
+ QOrganizerManagerSyncOpErrorHolder h(this);
+ return d->m_engine->item(itemId, fetchHint, &h.error);
}
/*!
@@ -571,12 +564,11 @@ QOrganizerItem QOrganizerManager::item(const QOrganizerItemId& itemId, const QOr
*/
bool QOrganizerManager::saveItem(QOrganizerItem* item)
{
- d->m_errorMap.clear();
+ QOrganizerManagerSyncOpErrorHolder h(this);
if (item) {
- d->m_error = QOrganizerManager::NoError;
- return d->m_engine->saveItem(item, &d->m_error);
+ return d->m_engine->saveItem(item, &h.error);
} else {
- d->m_error = QOrganizerManager::BadArgumentError;
+ h.error = QOrganizerManager::BadArgumentError;
return false;
}
}
@@ -588,9 +580,8 @@ bool QOrganizerManager::saveItem(QOrganizerItem* item)
*/
bool QOrganizerManager::removeItem(const QOrganizerItemId& itemId)
{
- d->m_error = QOrganizerManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->removeItem(itemId, &d->m_error);
+ QOrganizerManagerSyncOpErrorHolder h(this);
+ return d->m_engine->removeItem(itemId, &h.error);
}
/*!
@@ -614,14 +605,13 @@ bool QOrganizerManager::removeItem(const QOrganizerItemId& itemId)
*/
bool QOrganizerManager::saveItems(QList<QOrganizerItem>* items)
{
- d->m_errorMap.clear();
+ QOrganizerManagerSyncOpErrorHolder h(this);
if (!items) {
- d->m_error = QOrganizerManager::BadArgumentError;
+ h.error = QOrganizerManager::BadArgumentError;
return false;
}
- d->m_error = QOrganizerManager::NoError;
- return d->m_engine->saveItems(items, &d->m_errorMap, &d->m_error);
+ return d->m_engine->saveItems(items, &h.errorMap, &h.error);
}
/*!
@@ -649,14 +639,13 @@ bool QOrganizerManager::saveItems(QList<QOrganizerItem>* items)
*/
bool QOrganizerManager::saveItems(QList<QOrganizerItem>* items, const QStringList& definitionMask)
{
- d->m_errorMap.clear();
+ QOrganizerManagerSyncOpErrorHolder h(this);
if (!items) {
- d->m_error = QOrganizerManager::BadArgumentError;
+ h.error = QOrganizerManager::BadArgumentError;
return false;
}
- d->m_error = QOrganizerManager::NoError;
- return d->m_engine->saveItems(items, definitionMask, &d->m_errorMap, &d->m_error);
+ return d->m_engine->saveItems(items, definitionMask, &h.errorMap, &h.error);
}
/*!
@@ -681,14 +670,13 @@ bool QOrganizerManager::saveItems(QList<QOrganizerItem>* items, const QStringLis
*/
bool QOrganizerManager::removeItems(const QList<QOrganizerItemId>& organizeritemIds)
{
- d->m_errorMap.clear();
+ QOrganizerManagerSyncOpErrorHolder h(this);
if (organizeritemIds.isEmpty()) {
- d->m_error = QOrganizerManager::BadArgumentError;
+ h.error = QOrganizerManager::BadArgumentError;
return false;
}
- d->m_error = QOrganizerManager::NoError;
- return d->m_engine->removeItems(organizeritemIds, &d->m_errorMap, &d->m_error);
+ return d->m_engine->removeItems(organizeritemIds, &h.errorMap, &h.error);
}
/*!
@@ -696,9 +684,8 @@ bool QOrganizerManager::removeItems(const QList<QOrganizerItemId>& organizeritem
*/
QOrganizerCollection QOrganizerManager::defaultCollection() const
{
- d->m_error = QOrganizerManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->defaultCollection(&d->m_error);
+ QOrganizerManagerSyncOpErrorHolder h(this);
+ return d->m_engine->defaultCollection(&h.error);
}
/*!
@@ -706,9 +693,8 @@ QOrganizerCollection QOrganizerManager::defaultCollection() const
*/
QOrganizerCollection QOrganizerManager::collection(const QOrganizerCollectionId& collectionId) const
{
- d->m_error = QOrganizerManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->collection(collectionId, &d->m_error);
+ QOrganizerManagerSyncOpErrorHolder h(this);
+ return d->m_engine->collection(collectionId, &h.error);
}
/*!
@@ -716,9 +702,8 @@ QOrganizerCollection QOrganizerManager::collection(const QOrganizerCollectionId&
*/
QList<QOrganizerCollection> QOrganizerManager::collections() const
{
- d->m_error = QOrganizerManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->collections(&d->m_error);
+ QOrganizerManagerSyncOpErrorHolder h(this);
+ return d->m_engine->collections(&h.error);
}
/*!
@@ -746,12 +731,11 @@ QList<QOrganizerCollection> QOrganizerManager::collections() const
*/
bool QOrganizerManager::saveCollection(QOrganizerCollection* collection)
{
- d->m_errorMap.clear();
+ QOrganizerManagerSyncOpErrorHolder h(this);
if (collection) {
- d->m_error = QOrganizerManager::NoError;
- return d->m_engine->saveCollection(collection, &d->m_error);
+ return d->m_engine->saveCollection(collection, &h.error);
} else {
- d->m_error = QOrganizerManager::BadArgumentError;
+ h.error = QOrganizerManager::BadArgumentError;
return false;
}
}
@@ -766,9 +750,8 @@ bool QOrganizerManager::saveCollection(QOrganizerCollection* collection)
*/
bool QOrganizerManager::removeCollection(const QOrganizerCollectionId& collectionId)
{
- d->m_error = QOrganizerManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->removeCollection(collectionId, &d->m_error);
+ QOrganizerManagerSyncOpErrorHolder h(this);
+ return d->m_engine->removeCollection(collectionId, &h.error);
}
/*!
@@ -777,9 +760,8 @@ bool QOrganizerManager::removeCollection(const QOrganizerCollectionId& collectio
*/
QOrganizerItem QOrganizerManager::compatibleItem(const QOrganizerItem& original) const
{
- d->m_error = QOrganizerManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->compatibleItem(original, &d->m_error);
+ QOrganizerManagerSyncOpErrorHolder h(this);
+ return d->m_engine->compatibleItem(original, &h.error);
}
/*!
@@ -788,9 +770,8 @@ QOrganizerItem QOrganizerManager::compatibleItem(const QOrganizerItem& original)
*/
QOrganizerCollection QOrganizerManager::compatibleCollection(const QOrganizerCollection& original) const
{
- d->m_error = QOrganizerManager::NoError;
- d->m_errorMap.clear();
- return d->m_engine->compatibleCollection(original, &d->m_error);
+ QOrganizerManagerSyncOpErrorHolder h(this);
+ return d->m_engine->compatibleCollection(original, &h.error);
}
/*!
@@ -799,53 +780,49 @@ QOrganizerCollection QOrganizerManager::compatibleCollection(const QOrganizerCol
*/
QMap<QString, QOrganizerItemDetailDefinition> QOrganizerManager::detailDefinitions(const QString& organizeritemType) const
{
- d->m_errorMap.clear();
+ QOrganizerManagerSyncOpErrorHolder h(this);
if (!supportedItemTypes().contains(organizeritemType)) {
- d->m_error = QOrganizerManager::InvalidItemTypeError;
+ h.error = QOrganizerManager::InvalidItemTypeError;
return QMap<QString, QOrganizerItemDetailDefinition>();
}
- d->m_error = QOrganizerManager::NoError;
- return d->m_engine->detailDefinitions(organizeritemType, &d->m_error);
+ return d->m_engine->detailDefinitions(organizeritemType, &h.error);
}
/*! Returns the definition identified by the given \a definitionName that is valid for the organizer items whose type is the given \a organizeritemType in this store, or a default-constructed QOrganizerItemDetailDefinition if no such definition exists */
QOrganizerItemDetailDefinition QOrganizerManager::detailDefinition(const QString& definitionName, const QString& organizeritemType) const
{
- d->m_errorMap.clear();
+ QOrganizerManagerSyncOpErrorHolder h(this);
if (!supportedItemTypes().contains(organizeritemType)) {
- d->m_error = QOrganizerManager::InvalidItemTypeError;
+ h.error = QOrganizerManager::InvalidItemTypeError;
return QOrganizerItemDetailDefinition();
}
- d->m_error = QOrganizerManager::NoError;
- return d->m_engine->detailDefinition(definitionName, organizeritemType, &d->m_error);
+ return d->m_engine->detailDefinition(definitionName, organizeritemType, &h.error);
}
/*! Persists the given definition \a def in the database, which is valid for organizer items whose type is the given \a organizeritemType. Returns true if the definition was saved successfully, otherwise returns false */
bool QOrganizerManager::saveDetailDefinition(const QOrganizerItemDetailDefinition& def, const QString& organizeritemType)
{
- d->m_errorMap.clear();
+ QOrganizerManagerSyncOpErrorHolder h(this);
if (!supportedItemTypes().contains(organizeritemType)) {
- d->m_error = QOrganizerManager::InvalidItemTypeError;
+ h.error = QOrganizerManager::InvalidItemTypeError;
return false;
}
- d->m_error = QOrganizerManager::NoError;
- return d->m_engine->saveDetailDefinition(def, organizeritemType, &d->m_error);
+ return d->m_engine->saveDetailDefinition(def, organizeritemType, &h.error);
}
/*! Removes the detail definition identified by \a definitionName from the database, which is valid for organizer items whose type is the given \a organizeritemType. Returns true if the definition was removed successfully, otherwise returns false */
bool QOrganizerManager::removeDetailDefinition(const QString& definitionName, const QString& organizeritemType)
{
- d->m_errorMap.clear();
+ QOrganizerManagerSyncOpErrorHolder h(this);
if (!supportedItemTypes().contains(organizeritemType)) {
- d->m_error = QOrganizerManager::InvalidItemTypeError;
+ h.error = QOrganizerManager::InvalidItemTypeError;
return false;
}
- d->m_error = QOrganizerManager::NoError;
- return d->m_engine->removeDetailDefinition(definitionName, organizeritemType, &d->m_error);
+ return d->m_engine->removeDetailDefinition(definitionName, organizeritemType, &h.error);
}
/*!
diff --git a/src/organizer/qorganizermanager_p.cpp b/src/organizer/qorganizermanager_p.cpp
index 6465fab84a..89946d867c 100644
--- a/src/organizer/qorganizermanager_p.cpp
+++ b/src/organizer/qorganizermanager_p.cpp
@@ -116,7 +116,7 @@ void QOrganizerManagerData::createEngine(const QString& managerName, const QMap<
/* See if we got a fast hit */
QList<QOrganizerManagerEngineFactory*> factories = m_engines.values(builtManagerName);
- m_error = QOrganizerManager::NoError;
+ m_lastError = QOrganizerManager::NoError;
while(!found) {
foreach (QOrganizerManagerEngineFactory* f, factories) {
@@ -124,7 +124,7 @@ void QOrganizerManagerData::createEngine(const QString& managerName, const QMap<
if (implementationVersion == -1 ||//no given implementation version required
versions.isEmpty() || //the manager engine factory does not report any version
versions.contains(implementationVersion)) {
- QOrganizerManagerEngine* engine = f->engine(parameters, &m_error);
+ QOrganizerManagerEngine* engine = f->engine(parameters, &m_lastError);
// if it's a V2, use it
m_engine = qobject_cast<QOrganizerManagerEngineV2*>(engine);
if (!m_engine && engine) {
@@ -149,13 +149,13 @@ void QOrganizerManagerData::createEngine(const QString& managerName, const QMap<
// XXX remove this
// the engine factory could lie to us, so check the real implementation version
if (m_engine && (implementationVersion != -1 && m_engine->managerVersion() != implementationVersion)) {
- m_error = QOrganizerManager::VersionMismatchError;
+ m_lastError = QOrganizerManager::VersionMismatchError;
m_engine = 0;
}
if (!m_engine) {
- if (m_error == QOrganizerManager::NoError)
- m_error = QOrganizerManager::DoesNotExistError;
+ if (m_lastError == QOrganizerManager::NoError)
+ m_lastError = QOrganizerManager::DoesNotExistError;
m_engine = new QOrganizerItemInvalidEngine();
}
}
diff --git a/src/organizer/qorganizermanager_p.h b/src/organizer/qorganizermanager_p.h
index 56dc645449..e48f743ce8 100644
--- a/src/organizer/qorganizermanager_p.h
+++ b/src/organizer/qorganizermanager_p.h
@@ -73,7 +73,7 @@ class QOrganizerManagerData
public:
QOrganizerManagerData()
: m_engine(0),
- m_error(QOrganizerManager::NoError)
+ m_lastError(QOrganizerManager::NoError)
{
}
@@ -89,8 +89,8 @@ public:
static QOrganizerCollectionEngineId* createEngineCollectionId(const QString& managerName, const QMap<QString, QString>& parameters, const QString& engineIdString);
QOrganizerManagerEngineV2* m_engine;
- QOrganizerManager::Error m_error;
- QMap<int, QOrganizerManager::Error> m_errorMap;
+ QOrganizerManager::Error m_lastError;
+ QMap<int, QOrganizerManager::Error> m_lastErrorMap;
/* Manager plugins */
static QHash<QString, QOrganizerManagerEngineFactory*> m_engines;
@@ -107,11 +107,42 @@ public:
void _q_itemsDeleted(const QList<QOrganizerItemId>& ids);
QMultiHash<QOrganizerItemId, QOrganizerItemObserver*> m_observerForItem;
+ static QOrganizerManagerData* managerData(const QOrganizerManager*m) {return m->d;}
private:
Q_DISABLE_COPY(QOrganizerManagerData)
};
+/*
+ Helper to hold the error state of a synchronous operation - when destructed, updates the
+ manager's last error variables to the result of this operation. This means that during
+ callbacks the error state can't be modified behind the engines back. and it's more conceptually
+ correct.
+ */
+class QOrganizerManagerSyncOpErrorHolder
+{
+public:
+ QOrganizerManagerSyncOpErrorHolder(const QOrganizerManager* m, QMap<int, QOrganizerManager::Error> *pUserError = 0)
+ : error(QOrganizerManager::NoError),
+ data(QOrganizerManagerData::managerData(m)),
+ userError(pUserError)
+ {
+ }
+
+ ~QOrganizerManagerSyncOpErrorHolder()
+ {
+ data->m_lastError = error;
+ data->m_lastErrorMap = errorMap;
+ if (userError)
+ *userError = errorMap;
+ }
+
+ QOrganizerManager::Error error;
+ QOrganizerManagerData* data;
+ QMap<int, QOrganizerManager::Error> errorMap;
+ QMap<int, QOrganizerManager::Error> *userError;
+};
+
QTM_END_NAMESPACE
#endif
diff --git a/src/organizer/requests/qorganizercollectionremoverequest.cpp b/src/organizer/requests/qorganizercollectionremoverequest.cpp
index b7ea891f45..55cf3f2950 100644
--- a/src/organizer/requests/qorganizercollectionremoverequest.cpp
+++ b/src/organizer/requests/qorganizercollectionremoverequest.cpp
@@ -57,6 +57,8 @@ QTM_BEGIN_NAMESPACE
the overall operation error (which may be retrieved by calling error()) is updated.
\ingroup organizeritems-requests
+
+ \inmodule QtOrganizer
*/
/*! Constructs a new organizeritem fetch request whose parent is the specified \a parent */
diff --git a/src/organizer/requests/qorganizercollectionsaverequest.cpp b/src/organizer/requests/qorganizercollectionsaverequest.cpp
index 1950384392..14dcdc2118 100644
--- a/src/organizer/requests/qorganizercollectionsaverequest.cpp
+++ b/src/organizer/requests/qorganizercollectionsaverequest.cpp
@@ -57,6 +57,8 @@ QTM_BEGIN_NAMESPACE
the overall operation error (which may be retrieved by calling error()) is updated.
\ingroup organizeritems-requests
+
+ \inmodule QtOrganizer
*/
/*! Constructs a new organizeritem fetch request whose parent is the specified \a parent */
diff --git a/src/versit/qversitcontactpluginloader_p.cpp b/src/versit/qversitcontactpluginloader_p.cpp
index 80837bf217..97f4a3ab68 100644
--- a/src/versit/qversitcontactpluginloader_p.cpp
+++ b/src/versit/qversitcontactpluginloader_p.cpp
@@ -67,6 +67,7 @@ QVersitContactPluginLoader* QVersitContactPluginLoader::mInstance = NULL;
/*!
* \class QVersitContactPluginLoader
* This is a singleton class that loads Versit plugins for contacts processing
+ \inmodule QtVersit
*/
QVersitContactPluginLoader::QVersitContactPluginLoader()
diff --git a/tests/auto/qcontactmanager/tst_qcontactmanager.cpp b/tests/auto/qcontactmanager/tst_qcontactmanager.cpp
index 39be6bf9db..d0fcec72c2 100644
--- a/tests/auto/qcontactmanager/tst_qcontactmanager.cpp
+++ b/tests/auto/qcontactmanager/tst_qcontactmanager.cpp
@@ -205,6 +205,7 @@ private slots:
void changeSet();
void fetchHint();
void engineDefaultSchema();
+ void errorSemantics();
/* Special test with special data */
void uriParsing_data();
@@ -3775,5 +3776,59 @@ void tst_QContactManager::lateDeletion()
cm->setParent(qApp); // now do nothing
}
+class errorSemanticsTester : public QObject {
+ Q_OBJECT;
+public:
+ bool initialErrorWasDoesNotExist;
+ bool slotErrorWasBadArgument;
+ QContactManager* mManager;
+
+ errorSemanticsTester(QContactManager* manager)
+ : initialErrorWasDoesNotExist(false),
+ slotErrorWasBadArgument(false),
+ mManager(manager)
+ {
+ connect(manager, SIGNAL(contactsAdded(QList<QContactLocalId>)), this, SLOT(handleAdded()));
+ }
+
+public slots:
+ void handleAdded()
+ {
+ // Make sure the initial error state is correct
+ initialErrorWasDoesNotExist = mManager->error() == QContactManager::DoesNotExistError;
+ // Now force a different error
+ mManager->removeContacts(QList<QContactLocalId>());
+ slotErrorWasBadArgument = mManager->error() == QContactManager::BadArgumentError;
+ // and return
+ }
+};
+
+void tst_QContactManager::errorSemantics()
+{
+ /*
+ Test to make sure that calling functions in response to signals doesn't upset the correct error results
+ This relies on the memory engine emitting signals before e.g. saveContacts returns
+ */
+
+ QContactManager m("memory");
+ errorSemanticsTester t(&m);
+
+ QVERIFY(m.error() == QContactManager::NoError);
+
+ QContactDetailDefinition nameDef = m.detailDefinition(QContactName::DefinitionName, QContactType::TypeContact);
+ QContact alice = createContact(nameDef, "Alice", "inWonderland", "1234567");
+
+ // Try creating some specific error so we can test it later on
+ QContact a = m.contact(567);
+ QVERIFY(m.error() == QContactManager::DoesNotExistError);
+
+ // Now save something
+ QVERIFY(m.saveContact(&alice));
+
+ QVERIFY(t.initialErrorWasDoesNotExist);
+ QVERIFY(t.slotErrorWasBadArgument);
+ QVERIFY(m.error() == QContactManager::NoError);
+}
+
QTEST_MAIN(tst_QContactManager)
#include "tst_qcontactmanager.moc"
diff --git a/tests/auto/qorganizermanager/tst_qorganizermanager.cpp b/tests/auto/qorganizermanager/tst_qorganizermanager.cpp
index e402ddc2d6..94351264de 100644
--- a/tests/auto/qorganizermanager/tst_qorganizermanager.cpp
+++ b/tests/auto/qorganizermanager/tst_qorganizermanager.cpp
@@ -194,6 +194,7 @@ private slots:
void fetchHint();
void testFilterFunction();
void testItemOccurrences();
+ void errorSemantics();
/* Special test with special data */
void uriParsing_data();
@@ -4527,5 +4528,70 @@ void tst_QOrganizerManager::collections()
}
}
+class errorSemanticsTester : public QObject {
+ Q_OBJECT;
+public:
+ bool initialErrorWasDoesNotExist;
+ bool slotErrorWasBadArgument;
+ QOrganizerManager* mManager;
+
+ errorSemanticsTester(QOrganizerManager* manager)
+ : initialErrorWasDoesNotExist(false),
+ slotErrorWasBadArgument(false),
+ mManager(manager)
+ {
+ connect(manager, SIGNAL(itemsAdded(QList<QOrganizerItemId>)), this, SLOT(handleAdded()));
+ }
+
+public slots:
+ void handleAdded()
+ {
+ // Make sure the initial error state is correct
+ initialErrorWasDoesNotExist = mManager->error() == QOrganizerManager::DoesNotExistError;
+ // Now force a different error
+ mManager->removeItems(QList<QOrganizerItemId>());
+ slotErrorWasBadArgument = mManager->error() == QOrganizerManager::BadArgumentError;
+ // and return
+ }
+};
+
+void tst_QOrganizerManager::errorSemantics()
+{
+ /*
+ Test to make sure that calling functions in response to signals doesn't upset the correct error results
+ This relies on the memory engine emitting signals before e.g. saveItems returns
+ */
+
+ QOrganizerManager m("memory");
+ errorSemanticsTester t(&m);
+
+ QVERIFY(m.error() == QOrganizerManager::NoError);
+
+ QString type;
+ if (m.detailDefinitions(QOrganizerItemType::TypeNote).count())
+ type = QLatin1String(QOrganizerItemType::TypeNote);
+ else if (m.detailDefinitions(QOrganizerItemType::TypeTodo).count())
+ type = QLatin1String(QOrganizerItemType::TypeTodo);
+ else
+ QSKIP("This manager does not support note or todo item", SkipSingle);
+
+ QOrganizerItem item;
+ item.setType(type);
+ item.setDisplayLabel("This is a note");
+ item.setDescription("This note is a particularly notey note");
+
+ // Try creating some specific error so we can test it later on
+ QVERIFY(!m.removeItem(QOrganizerItemId()));
+ QVERIFY(m.error() == QOrganizerManager::DoesNotExistError);
+
+ // Now save something
+ QVERIFY(m.saveItem(&item));
+
+ QVERIFY(t.initialErrorWasDoesNotExist);
+ QVERIFY(t.slotErrorWasBadArgument);
+ QVERIFY(m.error() == QOrganizerManager::NoError);
+}
+
+
QTEST_MAIN(tst_QOrganizerManager)
#include "tst_qorganizermanager.moc"
diff --git a/tests/auto/qremoteserviceregister/tst_qremoteserviceregister.cpp b/tests/auto/qremoteserviceregister/tst_qremoteserviceregister.cpp
index 5ddf23e3c9..84876f20d0 100644
--- a/tests/auto/qremoteserviceregister/tst_qremoteserviceregister.cpp
+++ b/tests/auto/qremoteserviceregister/tst_qremoteserviceregister.cpp
@@ -79,11 +79,14 @@ private slots:
void checkCreateEntryWithEmptyServiceName();
void checkOperators();
void checkPublish();
+ void tst_instanceClosed();
private:
QRemoteServiceRegister* serviceRegister;
QRemoteServiceRegister::Entry uniqueEntry;
QRemoteServiceRegister::Entry uniqueEntry2;
+
+ QObject *connectToService(const QString &serviceName);
};
bool mySecurityFilterFunction(const void *p)
@@ -97,6 +100,11 @@ bool mySecurityFilterFunction(const void *p)
return false;
}
+bool alwaysPass(const void *p)
+{
+ return true;
+}
+
void tst_QRemoteServiceRegister::initTestCase()
{
qRegisterMetaType<QServiceFilter>("QServiceFilter");
@@ -226,5 +234,51 @@ void tst_QRemoteServiceRegister::checkPublish()
QVERIFY(type2 == QRemoteServiceRegister::GlobalInstance);
}
+Q_DECLARE_METATYPE(QRemoteServiceRegister::Entry);
+
+void tst_QRemoteServiceRegister::tst_instanceClosed()
+{
+ qRegisterMetaType<QRemoteServiceRegister::Entry>("QRemoteServiceRegister::Entry");
+
+ serviceRegister->setSecurityFilter(alwaysPass);
+ QSignalSpy spy(serviceRegister,SIGNAL(instanceClosed(QRemoteServiceRegister::Entry)));
+ QSignalSpy spyAll(serviceRegister,SIGNAL(allInstancesClosed()));
+
+ QObject *o = connectToService("RSRExampleService");
+ QVERIFY(o);
+
+ delete o;
+
+ QCOMPARE(spy.count(), 1);
+ QCOMPARE(spyAll.count(), 1);
+
+}
+
+QObject *tst_QRemoteServiceRegister::connectToService(const QString &serviceName)
+{
+ QServiceManager manager;
+
+ QList<QServiceInterfaceDescriptor> list = manager.findInterfaces(serviceName);
+ if (list.isEmpty()) {
+ qWarning() << "Couldn't find service" << serviceName;
+ return 0;
+ }
+
+ // Get the interface descriptor
+ QServiceInterfaceDescriptor desc = list.at(0);
+ if (!desc.isValid()) {
+ qWarning() << "Warning: Invalid service interface descriptor for" << serviceName;
+ return 0;
+ }
+
+ QObject* service = manager.loadInterface(desc);
+ if (!service) {
+ qWarning() << "Couldn't load service interface for" << serviceName;
+ return 0;
+ }
+ return service;
+}
+
+
QTEST_MAIN(tst_QRemoteServiceRegister);
#include "tst_qremoteserviceregister.moc"