From 01db702c3fb415ffc3df06965014900d6bff09e9 Mon Sep 17 00:00:00 2001 From: Armin Felder <armin.felder@osalliance.com> Date: Sat, 24 Nov 2018 19:04:11 +0100 Subject: [PATCH] std::move arguments from construtors --- ddpRequests/ddprequest.cpp | 4 ++-- ddpRequests/ddprequest.h | 4 ++-- repos/entities/emoji.cpp | 8 ++++---- repos/entities/emoji.h | 8 ++++---- repos/entities/rocketchatuser.cpp | 2 +- repos/entities/rocketchatuser.h | 2 +- rocketchatserver.cpp | 2 +- rocketchatserver.h | 2 +- services/requests/loadhistoryservicerequest.cpp | 6 +++--- services/requests/loadhistoryservicerequest.h | 6 +++--- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/ddpRequests/ddprequest.cpp b/ddpRequests/ddprequest.cpp index b3c65ac..1c3aa47 100755 --- a/ddpRequests/ddprequest.cpp +++ b/ddpRequests/ddprequest.cpp @@ -28,12 +28,12 @@ DDPRequest::DDPRequest( const QJsonObject &pRequest ): mRawRequest( pRequest ) } -DDPRequest::DDPRequest( const QJsonObject &pRequest, const DdpCallback &pSuccess ): mRawRequest( pRequest ), mSuccess( pSuccess ) +DDPRequest::DDPRequest( const QJsonObject &pRequest, DdpCallback pSuccess ): mRawRequest( pRequest ), mSuccess( std::move( pSuccess ) ) { } -DDPRequest::DDPRequest( const QJsonObject &pRequest, const DdpCallback &pSuccess, const DdpCallback &error ): mRawRequest( pRequest ), mSuccess( pSuccess ), mError( error ) +DDPRequest::DDPRequest( const QJsonObject &pRequest, DdpCallback pSuccess, DdpCallback error ): mRawRequest( pRequest ), mSuccess( std::move( pSuccess ) ), mError( std::move( error ) ) { } diff --git a/ddpRequests/ddprequest.h b/ddpRequests/ddprequest.h index 34d3d40..e925b27 100755 --- a/ddpRequests/ddprequest.h +++ b/ddpRequests/ddprequest.h @@ -34,8 +34,8 @@ class DDPRequest : public QObject Q_OBJECT public: DDPRequest( const QJsonObject &pRequest ); - DDPRequest( const QJsonObject &pRequest, const DdpCallback &pSuccess ); - DDPRequest( const QJsonObject &pRequest, const DdpCallback &pSuccess, const DdpCallback &pError ); + DDPRequest( const QJsonObject &pRequest, DdpCallback pSuccess ); + DDPRequest( const QJsonObject &pRequest, DdpCallback pSuccess, DdpCallback pError ); QJsonObject getRawRequest() const; QString getFrame() const; void setFrame( const QString &value ); diff --git a/repos/entities/emoji.cpp b/repos/entities/emoji.cpp index 2bb9f0e..560f5b4 100644 --- a/repos/entities/emoji.cpp +++ b/repos/entities/emoji.cpp @@ -21,7 +21,7 @@ #include "emoji.h" -Emoji::Emoji( const QString &name, const QString &extension, const QString &category ): mCategory( category ) +Emoji::Emoji( QString name, QString extension, QString category ): mCategory( std::move( category ) ) { this->mIdentifier = ':' + name + ':'; @@ -30,7 +30,7 @@ Emoji::Emoji( const QString &name, const QString &extension, const QString &cate this->mType = QStringLiteral( "emoji" ); } -Emoji::Emoji( const QString &name, const QString &category, const QString &filePath, const QString &html ): mCategory( category ) +Emoji::Emoji( QString name, QString category, QString filePath, QString html ): mCategory( std::move( category ) ) { this->mIdentifier = name; QFileInfo fileInfo( filePath ); @@ -39,7 +39,7 @@ Emoji::Emoji( const QString &name, const QString &category, const QString &fileP mExtension = fileInfo.completeSuffix(); } -Emoji::Emoji( const QString &name, const QString &category, const QString &filePath, const QString &html, const QString &unicode ): mCategory( category ), mUnicodeChar( unicode ) +Emoji::Emoji( QString name, QString category, QString filePath, QString html, QString unicode ): mCategory( std::move( category ) ), mUnicodeChar( std::move( unicode ) ) { this->mIdentifier = name; QFileInfo fileInfo( filePath ); @@ -48,7 +48,7 @@ Emoji::Emoji( const QString &name, const QString &category, const QString &fileP mExtension = fileInfo.completeSuffix(); } -Emoji::Emoji( const QString &name, const QString &category, const QString &filePath, const QString &html, const QString &unicode, int order ): mCategory( category ), mUnicodeChar( unicode ), mOrder( order ) +Emoji::Emoji( QString name, QString category, QString filePath, QString html, QString unicode, int order ): mCategory( std::move( category ) ), mUnicodeChar( std::move( unicode ) ), mOrder( order ) { this->mIdentifier = name; QFileInfo fileInfo( filePath ); diff --git a/repos/entities/emoji.h b/repos/entities/emoji.h index 79cd3f1..1a830a3 100644 --- a/repos/entities/emoji.h +++ b/repos/entities/emoji.h @@ -29,10 +29,10 @@ class Emoji : public TempFile { public: - Emoji( const QString &name, const QString &extension, const QString &category ); - Emoji( const QString &name, const QString &category, const QString &file, const QString &html ); - Emoji( const QString &name, const QString &category, const QString &file, const QString &html, const QString &unicode ); - Emoji( const QString &name, const QString &category, const QString &file, const QString &html, const QString &unicode, int order ); + Emoji( QString name, QString extension, QString category ); + Emoji( QString name, QString category, QString file, QString html ); + Emoji( QString name, QString category, QString file, QString html, QString unicode ); + Emoji( QString name, QString category, QString file, QString html, QString unicode, int order ); QString getIdentifier() const; QVariantMap toQVariantMap(); diff --git a/repos/entities/rocketchatuser.cpp b/repos/entities/rocketchatuser.cpp index 66a3d4a..ef4d8f9 100755 --- a/repos/entities/rocketchatuser.cpp +++ b/repos/entities/rocketchatuser.cpp @@ -22,7 +22,7 @@ #include "rocketchatuser.h" -RocketChatUser::RocketChatUser( const QString &pId ): mUserId( pId ) +RocketChatUser::RocketChatUser( QString pId ): mUserId( std::move( pId ) ) { } diff --git a/repos/entities/rocketchatuser.h b/repos/entities/rocketchatuser.h index df7c840..c7c5ebe 100755 --- a/repos/entities/rocketchatuser.h +++ b/repos/entities/rocketchatuser.h @@ -37,7 +37,7 @@ class RocketChatUser : public QObject OFFLINE = 2, BUSY = 3 }; - explicit RocketChatUser( const QString &pId ) ; + explicit RocketChatUser( QString pId ) ; QString getUserName() const; void setUserName( const QString &pValue ); diff --git a/rocketchatserver.cpp b/rocketchatserver.cpp index e8c5b8b..fc0f4ad 100755 --- a/rocketchatserver.cpp +++ b/rocketchatserver.cpp @@ -23,7 +23,7 @@ #include "CustomModels/models.h" -RocketChatServerData::RocketChatServerData( const QString &pId, QString pBaseUrl, bool pUnsecure ): mBaseUrl( pBaseUrl ), mServerId( pId ), userModel( Models::getUsersModel() ), loginMethodsModel( Models::getLoginMethodsModel() ), channelsModel( Models::getPublicGroupsModel() ), +RocketChatServerData::RocketChatServerData( QString pId, QString pBaseUrl, bool pUnsecure ): mBaseUrl( std::move( pBaseUrl ) ), mServerId( std::move( pId ) ), userModel( Models::getUsersModel() ), loginMethodsModel( Models::getLoginMethodsModel() ), channelsModel( Models::getPublicGroupsModel() ), directModel( Models::getDirectChannelsModel() ), groupsModel( Models::getPublicGroupsModel() ) { qRegisterMetaType<User>( "User" ); diff --git a/rocketchatserver.h b/rocketchatserver.h index cf04c77..0e98dd8 100755 --- a/rocketchatserver.h +++ b/rocketchatserver.h @@ -115,7 +115,7 @@ class RocketChatServerData : public MessageListener Q_OBJECT public: - RocketChatServerData( const QString &pId, QString pBaseUrl, + RocketChatServerData( QString pId, QString pBaseUrl, bool pUnsecure = false ); void setServerId( const QString &pValue ); diff --git a/services/requests/loadhistoryservicerequest.cpp b/services/requests/loadhistoryservicerequest.cpp index f19d18f..7e3df1d 100644 --- a/services/requests/loadhistoryservicerequest.cpp +++ b/services/requests/loadhistoryservicerequest.cpp @@ -27,17 +27,17 @@ LoadHistoryServiceRequest::LoadHistoryServiceRequest( const QString &pChannelId } -LoadHistoryServiceRequest::LoadHistoryServiceRequest( const QStringList &pChannelIds ): mChannelIds( pChannelIds ) +LoadHistoryServiceRequest::LoadHistoryServiceRequest( QStringList pChannelIds ): mChannelIds( std::move( pChannelIds ) ) { } -LoadHistoryServiceRequest::LoadHistoryServiceRequest( const QString &pChannelId, int pLimit ): LoadHistoryServiceRequest( pChannelId ) +LoadHistoryServiceRequest::LoadHistoryServiceRequest( QString pChannelId, int pLimit ): LoadHistoryServiceRequest( std::move( pChannelId ) ) { mLimit = pLimit; } -LoadHistoryServiceRequest::LoadHistoryServiceRequest( const QStringList &pChannelIds, int pLimit ): LoadHistoryServiceRequest( pChannelIds ) +LoadHistoryServiceRequest::LoadHistoryServiceRequest( QStringList pChannelIds, int pLimit ): LoadHistoryServiceRequest( std::move( pChannelIds ) ) { mLimit = pLimit; } diff --git a/services/requests/loadhistoryservicerequest.h b/services/requests/loadhistoryservicerequest.h index b64ba98..b93ce21 100644 --- a/services/requests/loadhistoryservicerequest.h +++ b/services/requests/loadhistoryservicerequest.h @@ -32,9 +32,9 @@ class LoadHistoryServiceRequest { public: LoadHistoryServiceRequest( const QString &pChannelId ); - LoadHistoryServiceRequest( const QStringList &pChannelIds ); - LoadHistoryServiceRequest( const QString &pChannelId, int pLimit ); - LoadHistoryServiceRequest( const QStringList &pChannelIds, int pLimit ); + LoadHistoryServiceRequest( QStringList pChannelIds ); + LoadHistoryServiceRequest( QString pChannelId, int pLimit ); + LoadHistoryServiceRequest( QStringList pChannelIds, int pLimit ); enum class Source { AUTO, -- GitLab