summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Caliste <dcaliste@free.fr>2018-09-11 15:30:20 +0200
committerPekka Vuorela <pvuorela@iki.fi>2018-09-29 11:50:37 +0000
commit066aff4b15160c6872c0e77f6ab2556aa293c185 (patch)
tree6e88cc082521d49f28a9679a505eeb476c730ce3
parent59c603e58e9aa4c169b0dcc6a58fe806b5fddbab (diff)
Update deprecated functions and suppress warnings
Change-Id: I2a88dafc4b47d42e27ae25c22ba03654c3830ff9 Reviewed-by: Pekka Vuorela <pvuorela@iki.fi> Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
-rw-r--r--src/libraries/qmfclient/qmailmessage.cpp8
-rw-r--r--src/libraries/qmfclient/qmailstore.cpp2
-rw-r--r--src/libraries/qmfclient/qmailstore.h7
-rw-r--r--src/libraries/qmfclient/qmailstore_p.cpp5
-rw-r--r--src/tools/messageserver/servicehandler.cpp2
5 files changed, 9 insertions, 15 deletions
diff --git a/src/libraries/qmfclient/qmailmessage.cpp b/src/libraries/qmfclient/qmailmessage.cpp
index 0ab3ca7a..dc782b9e 100644
--- a/src/libraries/qmfclient/qmailmessage.cpp
+++ b/src/libraries/qmfclient/qmailmessage.cpp
@@ -3950,8 +3950,8 @@ const QMailMessagePart& QMailMessagePartContainerPrivate::partAt(const QMailMess
const QMailMessagePart* part = 0;
const QList<QMailMessagePart>* partList = &_messageParts;
- foreach (uint index, location.d->_indices) {
- if (index >= 0 && index <= partList->size()) {
+ foreach (int index, location.d->_indices) {
+ if (index > 0 && index <= partList->size()) {
part = &(partList->at(index - 1));
partList = &(part->impl<const QMailMessagePartContainerPrivate>()->_messageParts);
} else {
@@ -3969,8 +3969,8 @@ QMailMessagePart& QMailMessagePartContainerPrivate::partAt(const QMailMessagePar
QMailMessagePart* part = 0;
QList<QMailMessagePart>* partList = &_messageParts;
- foreach (uint index, location.d->_indices) {
- if (index >= 0 && index <= partList->size()) {
+ foreach (int index, location.d->_indices) {
+ if (index > 0 && index <= partList->size()) {
part = &((*partList)[index - 1]);
partList = &(part->impl<QMailMessagePartContainerPrivate>()->_messageParts);
} else {
diff --git a/src/libraries/qmfclient/qmailstore.cpp b/src/libraries/qmfclient/qmailstore.cpp
index 93eb17fc..c8f3499f 100644
--- a/src/libraries/qmfclient/qmailstore.cpp
+++ b/src/libraries/qmfclient/qmailstore.cpp
@@ -31,8 +31,6 @@
**
****************************************************************************/
-// Needed to give friend access to the function defined by Q_GLOBAL_STATIC
-#define QMAILSTOREINSTANCE_DEFINED_HERE
#include "qmailstore.h"
#include "qmailstore_p.h"
#include <QThreadStorage>
diff --git a/src/libraries/qmfclient/qmailstore.h b/src/libraries/qmfclient/qmailstore.h
index 18b5e736..118d799d 100644
--- a/src/libraries/qmfclient/qmailstore.h
+++ b/src/libraries/qmfclient/qmailstore.h
@@ -53,10 +53,6 @@
class QMailStore;
class QMailStoreImplementation;
-#ifdef QMAILSTOREINSTANCE_DEFINED_HERE
-static QMailStore* QMailStoreInstance();
-#endif
-
class QMF_EXPORT QMailStore : public QObject
{
Q_OBJECT
@@ -195,9 +191,6 @@ public:
void reconnectIpc();
static QMailStore* instance();
-#ifdef QMAILSTOREINSTANCE_DEFINED_HERE
- friend QMailStore* QMailStoreInstance();
-#endif
Q_SIGNALS:
void errorOccurred(QMailStore::ErrorCode code);
diff --git a/src/libraries/qmfclient/qmailstore_p.cpp b/src/libraries/qmfclient/qmailstore_p.cpp
index b32f7115..64a72532 100644
--- a/src/libraries/qmfclient/qmailstore_p.cpp
+++ b/src/libraries/qmfclient/qmailstore_p.cpp
@@ -3038,7 +3038,10 @@ void QMailStorePrivate::setQueryError(const QSqlError &error, const QString &des
QString s;
QTextStream ts(&s);
- lastQueryError = error.number();
+ bool ok = false;
+ lastQueryError = error.nativeErrorCode().toInt(&ok);
+ if (!ok)
+ lastQueryError = QSqlError::UnknownError;
ts << qPrintable(description) << "; error:\"" << error.text() << '"';
if (!statement.isEmpty())
diff --git a/src/tools/messageserver/servicehandler.cpp b/src/tools/messageserver/servicehandler.cpp
index 06fdb13e..c8da979c 100644
--- a/src/tools/messageserver/servicehandler.cpp
+++ b/src/tools/messageserver/servicehandler.cpp
@@ -1181,7 +1181,7 @@ void ServiceHandler::dispatchRequest()
void ServiceHandler::updateAction(quint64 action)
{
- QLinkedList<quint64>::iterator it = qFind(mActionExpiry.begin(), mActionExpiry.end(), action);
+ QLinkedList<quint64>::iterator it = std::find(mActionExpiry.begin(), mActionExpiry.end(), action);
if (it != mActionExpiry.end()) {
// Move this action to the end of the list
mActionExpiry.erase(it);