From f8503c78763b634ba3e82ac49f42b80a47849629 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Tue, 9 Jan 2018 19:20:18 +0900 Subject: Qualify a bind() invocation with 'std::'; use an actual value instead of a placeholder An unqualified bind() seems to upset some build environments; also, use a User* value at hand instead of binding it at the moment of signal-slot triggering. --- room.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/room.cpp b/room.cpp index b647a506..28107228 100644 --- a/room.cpp +++ b/room.cpp @@ -510,7 +510,7 @@ void Room::Private::addMember(User *u) { insertMemberIntoMap(u); connect(u, &User::nameChanged, q, - bind(&Private::renameMember, this, _1, _2)); + std::bind(&Private::renameMember, this, u, _2)); emit q->userAdded(u); } } -- cgit v1.2.3 From f7eddb98158033ed79d94df8897c9cdc6e7837d8 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Wed, 10 Jan 2018 10:49:25 +0900 Subject: Event/RoomEvent: use Q_DECLARE_METATYPE properly --- events/event.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/events/event.h b/events/event.h index 319c3443..6ed5ba49 100644 --- a/events/event.h +++ b/events/event.h @@ -290,7 +290,7 @@ namespace QMatrixClient QScopedPointer _prev; }; } // namespace QMatrixClient -Q_DECLARE_OPAQUE_POINTER(QMatrixClient::Event*) Q_DECLARE_METATYPE(QMatrixClient::Event*) -Q_DECLARE_OPAQUE_POINTER(QMatrixClient::RoomEvent*) Q_DECLARE_METATYPE(QMatrixClient::RoomEvent*) +Q_DECLARE_METATYPE(const QMatrixClient::Event*) +Q_DECLARE_METATYPE(const QMatrixClient::RoomEvent*) -- cgit v1.2.3 From f8f7fb7a00e5100881e347f18e96a5b1a8f56227 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 12 Jan 2018 21:41:12 +0900 Subject: BaseJob::maxRetries: Align the type with that of JobTimeoutConfig Fixes some signedness warnings --- jobs/basejob.cpp | 4 ++-- jobs/basejob.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/jobs/basejob.cpp b/jobs/basejob.cpp index 9df3e430..c92c2944 100644 --- a/jobs/basejob.cpp +++ b/jobs/basejob.cpp @@ -319,12 +319,12 @@ BaseJob::duration_t BaseJob::millisToRetry() const return d->retryTimer.isActive() ? d->retryTimer.remainingTime() : 0; } -size_t BaseJob::maxRetries() const +int BaseJob::maxRetries() const { return d->maxRetries; } -void BaseJob::setMaxRetries(size_t newMaxRetries) +void BaseJob::setMaxRetries(int newMaxRetries) { d->maxRetries = newMaxRetries; } diff --git a/jobs/basejob.h b/jobs/basejob.h index 2f75c095..5fcbbc97 100644 --- a/jobs/basejob.h +++ b/jobs/basejob.h @@ -45,7 +45,7 @@ namespace QMatrixClient class BaseJob: public QObject { Q_OBJECT - Q_PROPERTY(size_t maxRetries READ maxRetries WRITE setMaxRetries) + Q_PROPERTY(int maxRetries READ maxRetries WRITE setMaxRetries) public: /* Just in case, the values are compatible with KJob * (which BaseJob used to inherit from). */ @@ -137,8 +137,8 @@ namespace QMatrixClient int error() const; virtual QString errorString() const; - size_t maxRetries() const; - void setMaxRetries(size_t newMaxRetries); + int maxRetries() const; + void setMaxRetries(int newMaxRetries); Q_INVOKABLE duration_t getCurrentTimeout() const; Q_INVOKABLE duration_t getNextRetryInterval() const; -- cgit v1.2.3