From 173f18f7ad6ab4b4fe0617cb9b8734e2d6be6d1a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 2 Feb 2014 14:06:03 -0800 Subject: Normalize signal & slot signatures in connection Profiling shows Qt Creator spends 2% of its load time normalizing Change-Id: Ica52c45e34fe53823b31faaa7d77a633458549d5 Reviewed-by: Thiago Macieira Reviewed-by: Alex Blasche --- .../qdeclarativesupportedcategoriesmodel.cpp | 24 +++++++++++----------- src/imports/location/qdeclarativegeomap.cpp | 8 ++++---- .../location/qdeclarativegeomapitemview.cpp | 8 ++++---- src/location/maps/qgeocodingmanager.cpp | 4 ++-- src/location/maps/qgeomap.cpp | 4 ++-- src/location/maps/qgeoroutingmanager.cpp | 4 ++-- src/location/maps/qgeotiledmapdata.cpp | 4 ++-- .../nokia/qgeocodingmanagerengine_nokia.cpp | 6 +++--- .../nokia/qgeoroutingmanagerengine_nokia.cpp | 10 ++++----- src/plugins/geoservices/nokia/qgeouriprovider.cpp | 2 +- .../osm/qgeoroutingmanagerengineosm.cpp | 2 +- 11 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/imports/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp b/src/imports/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp index 38a73f2e..fc88c889 100644 --- a/src/imports/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp +++ b/src/imports/location/declarativeplaces/qdeclarativesupportedcategoriesmodel.cpp @@ -263,12 +263,12 @@ void QDeclarativeSupportedCategoriesModel::setPlugin(QDeclarativeGeoServiceProvi if (serviceProvider) { QPlaceManager *placeManager = serviceProvider->placeManager(); if (placeManager) { - disconnect(placeManager, SIGNAL(categoryAdded(QPlaceCategory, QString)), - this, SLOT(addedCategory(QPlaceCategory, QString))); - disconnect(placeManager, SIGNAL(categoryUpdated(QPlaceCategory, QString)), - this, SLOT(updatedCategory(QPlaceCategory, QString))); - disconnect(placeManager, SIGNAL(categoryRemoved(QString, QString)), - this, SLOT(removedCategory(QString, QString))); + disconnect(placeManager, SIGNAL(categoryAdded(QPlaceCategory,QString)), + this, SLOT(addedCategory(QPlaceCategory,QString))); + disconnect(placeManager, SIGNAL(categoryUpdated(QPlaceCategory,QString)), + this, SLOT(updatedCategory(QPlaceCategory,QString))); + disconnect(placeManager, SIGNAL(categoryRemoved(QString,QString)), + this, SLOT(removedCategory(QString,QString))); disconnect(placeManager, SIGNAL(dataChanged()), this, SIGNAL(dataChanged())); } @@ -479,12 +479,12 @@ void QDeclarativeSupportedCategoriesModel::connectNotificationSignals() // listen for any category notifications so that we can reupdate the categories // model. - connect(placeManager, SIGNAL(categoryAdded(QPlaceCategory, QString)), - this, SLOT(addedCategory(QPlaceCategory, QString))); - connect(placeManager, SIGNAL(categoryUpdated(QPlaceCategory, QString)), - this, SLOT(updatedCategory(QPlaceCategory, QString))); - connect(placeManager, SIGNAL(categoryRemoved(QString, QString)), - this, SLOT(removedCategory(QString, QString))); + connect(placeManager, SIGNAL(categoryAdded(QPlaceCategory,QString)), + this, SLOT(addedCategory(QPlaceCategory,QString))); + connect(placeManager, SIGNAL(categoryUpdated(QPlaceCategory,QString)), + this, SLOT(updatedCategory(QPlaceCategory,QString))); + connect(placeManager, SIGNAL(categoryRemoved(QString,QString)), + this, SLOT(removedCategory(QString,QString))); connect(placeManager, SIGNAL(dataChanged()), this, SIGNAL(dataChanged())); } diff --git a/src/imports/location/qdeclarativegeomap.cpp b/src/imports/location/qdeclarativegeomap.cpp index 4e12e422..9e2e4ebb 100644 --- a/src/imports/location/qdeclarativegeomap.cpp +++ b/src/imports/location/qdeclarativegeomap.cpp @@ -256,9 +256,9 @@ void QDeclarativeGeoMap::onMapChildrenChanged() copyrightsWPtr_ = new QDeclarativeGeoMapCopyrightNotice(this); copyrights = copyrightsWPtr_.data(); connect(map_, - SIGNAL(copyrightsChanged(const QImage &, const QPoint &)), + SIGNAL(copyrightsChanged(QImage,QPoint)), copyrights, - SLOT(copyrightsChanged(const QImage &, const QPoint &))); + SLOT(copyrightsChanged(QImage,QPoint))); } else { // just re-set its parent. copyrights->setParent(this); @@ -483,9 +483,9 @@ void QDeclarativeGeoMap::mappingManagerInitialized() copyrightsWPtr_ = new QDeclarativeGeoMapCopyrightNotice(this); connect(map_, - SIGNAL(copyrightsChanged(const QImage &, const QPoint &)), + SIGNAL(copyrightsChanged(QImage,QPoint)), copyrightsWPtr_.data(), - SLOT(copyrightsChanged(const QImage &, const QPoint &))); + SLOT(copyrightsChanged(QImage,QPoint))); connect(map_, SIGNAL(updateRequired()), diff --git a/src/imports/location/qdeclarativegeomapitemview.cpp b/src/imports/location/qdeclarativegeomapitemview.cpp index ccfc4537..28a8a9b4 100644 --- a/src/imports/location/qdeclarativegeomapitemview.cpp +++ b/src/imports/location/qdeclarativegeomapitemview.cpp @@ -121,10 +121,10 @@ void QDeclarativeGeoMapItemView::setModel(const QVariant &model) itemModel_ = itemModel; QObject::connect(itemModel_, SIGNAL(modelReset()), this, SLOT(itemModelReset())); - QObject::connect(itemModel_, SIGNAL(rowsRemoved(QModelIndex, int, int)), - this, SLOT(itemModelRowsRemoved(QModelIndex, int, int))); - QObject::connect(itemModel_, SIGNAL(rowsInserted(QModelIndex, int, int)), - this, SLOT(itemModelRowsInserted(QModelIndex, int, int))); + QObject::connect(itemModel_, SIGNAL(rowsRemoved(QModelIndex,int,int)), + this, SLOT(itemModelRowsRemoved(QModelIndex,int,int))); + QObject::connect(itemModel_, SIGNAL(rowsInserted(QModelIndex,int,int)), + this, SLOT(itemModelRowsInserted(QModelIndex,int,int))); repopulate(); emit modelChanged(); } diff --git a/src/location/maps/qgeocodingmanager.cpp b/src/location/maps/qgeocodingmanager.cpp index 5dcb873e..79b0bcc6 100644 --- a/src/location/maps/qgeocodingmanager.cpp +++ b/src/location/maps/qgeocodingmanager.cpp @@ -96,9 +96,9 @@ QGeoCodingManager::QGeoCodingManager(QGeoCodingManagerEngine *engine, QObject *p SIGNAL(finished(QGeoCodeReply*))); connect(d_ptr->engine, - SIGNAL(error(QGeoCodeReply*, QGeoCodeReply::Error, QString)), + SIGNAL(error(QGeoCodeReply*,QGeoCodeReply::Error,QString)), this, - SIGNAL(error(QGeoCodeReply*, QGeoCodeReply::Error, QString))); + SIGNAL(error(QGeoCodeReply*,QGeoCodeReply::Error,QString))); } else { qFatal("The geocoding manager engine that was set for this geocoding manager was NULL."); } diff --git a/src/location/maps/qgeomap.cpp b/src/location/maps/qgeomap.cpp index 1f2b6e9b..f937c29b 100644 --- a/src/location/maps/qgeomap.cpp +++ b/src/location/maps/qgeomap.cpp @@ -79,10 +79,10 @@ QGeoMap::QGeoMap(QGeoMapData *mapData, QObject *parent) : QObject(parent), mapData_(mapData) { - connect(mapData_, SIGNAL(cameraDataChanged(const QGeoCameraData&)), this, SIGNAL(cameraDataChanged(const QGeoCameraData&))); + connect(mapData_, SIGNAL(cameraDataChanged(QGeoCameraData)), this, SIGNAL(cameraDataChanged(QGeoCameraData))); connect(mapData_, SIGNAL(updateRequired()), this, SIGNAL(updateRequired())); connect(mapData_, SIGNAL(activeMapTypeChanged()), this, SIGNAL(activeMapTypeChanged())); - connect(mapData_, SIGNAL(copyrightsChanged(const QImage&, const QPoint&)), this, SIGNAL(copyrightsChanged(const QImage&, const QPoint&))); + connect(mapData_, SIGNAL(copyrightsChanged(QImage,QPoint)), this, SIGNAL(copyrightsChanged(QImage,QPoint))); } QGeoMap::~QGeoMap() diff --git a/src/location/maps/qgeoroutingmanager.cpp b/src/location/maps/qgeoroutingmanager.cpp index 07af687b..429136a5 100644 --- a/src/location/maps/qgeoroutingmanager.cpp +++ b/src/location/maps/qgeoroutingmanager.cpp @@ -174,9 +174,9 @@ QGeoRoutingManager::QGeoRoutingManager(QGeoRoutingManagerEngine *engine, QObject SIGNAL(finished(QGeoRouteReply*))); connect(d_ptr->engine, - SIGNAL(error(QGeoRouteReply*, QGeoRouteReply::Error, QString)), + SIGNAL(error(QGeoRouteReply*,QGeoRouteReply::Error,QString)), this, - SIGNAL(error(QGeoRouteReply*, QGeoRouteReply::Error, QString))); + SIGNAL(error(QGeoRouteReply*,QGeoRouteReply::Error,QString))); } else { qFatal("The routing manager engine that was set for this routing manager was NULL."); } diff --git a/src/location/maps/qgeotiledmapdata.cpp b/src/location/maps/qgeotiledmapdata.cpp index 1655327b..dd64917a 100644 --- a/src/location/maps/qgeotiledmapdata.cpp +++ b/src/location/maps/qgeotiledmapdata.cpp @@ -184,9 +184,9 @@ QGeoTiledMapDataPrivate::QGeoTiledMapDataPrivate(QGeoTiledMapData *parent, QGeoT mapScene_->setTileSize(engine->tileSize().width()); QObject::connect(mapScene_, - SIGNAL(newTilesVisible(const QSet&)), + SIGNAL(newTilesVisible(QSet)), map_, - SLOT(evaluateCopyrights(const QSet))); + SLOT(evaluateCopyrights(QSet))); } QGeoTiledMapDataPrivate::~QGeoTiledMapDataPrivate() diff --git a/src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.cpp b/src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.cpp index cbdf98f2..ff0360e4 100644 --- a/src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.cpp +++ b/src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.cpp @@ -239,9 +239,9 @@ QGeoCodeReply *QGeoCodingManagerEngineNokia::geocode(QString requestString, SLOT(placesFinished())); connect(reply, - SIGNAL(error(QGeoCodeReply::Error, QString)), + SIGNAL(error(QGeoCodeReply::Error,QString)), this, - SLOT(placesError(QGeoCodeReply::Error, QString))); + SLOT(placesError(QGeoCodeReply::Error,QString))); return reply; } @@ -280,7 +280,7 @@ void QGeoCodingManagerEngineNokia::placesError(QGeoCodeReply::Error error, const if (!reply) return; - if (receivers(SIGNAL(error(QGeoCodeReply *, QGeoCodeReply::Error, QString))) == 0) { + if (receivers(SIGNAL(error(QGeoCodeReply*,QGeoCodeReply::Error,QString))) == 0) { reply->deleteLater(); return; } diff --git a/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp b/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp index 4380494a..d0fb5b93 100644 --- a/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp +++ b/src/plugins/geoservices/nokia/qgeoroutingmanagerengine_nokia.cpp @@ -141,9 +141,9 @@ QGeoRouteReply *QGeoRoutingManagerEngineNokia::calculateRoute(const QGeoRouteReq SLOT(routeFinished())); connect(reply, - SIGNAL(error(QGeoRouteReply::Error, QString)), + SIGNAL(error(QGeoRouteReply::Error,QString)), this, - SLOT(routeError(QGeoRouteReply::Error, QString))); + SLOT(routeError(QGeoRouteReply::Error,QString))); return reply; } @@ -172,9 +172,9 @@ QGeoRouteReply *QGeoRoutingManagerEngineNokia::updateRoute(const QGeoRoute &rout SLOT(routeFinished())); connect(reply, - SIGNAL(error(QGeoRouteReply::Error, QString)), + SIGNAL(error(QGeoRouteReply::Error,QString)), this, - SLOT(routeError(QGeoRouteReply::Error, QString))); + SLOT(routeError(QGeoRouteReply::Error,QString))); return reply; } @@ -495,7 +495,7 @@ void QGeoRoutingManagerEngineNokia::routeError(QGeoRouteReply::Error error, cons if (!reply) return; - if (receivers(SIGNAL(error(QGeoRouteReply*, QGeoRouteReply::Error, QString))) == 0) { + if (receivers(SIGNAL(error(QGeoRouteReply*,QGeoRouteReply::Error,QString))) == 0) { reply->deleteLater(); return; } diff --git a/src/plugins/geoservices/nokia/qgeouriprovider.cpp b/src/plugins/geoservices/nokia/qgeouriprovider.cpp index 77c47b03..c55b67bb 100644 --- a/src/plugins/geoservices/nokia/qgeouriprovider.cpp +++ b/src/plugins/geoservices/nokia/qgeouriprovider.cpp @@ -82,7 +82,7 @@ QGeoUriProvider::QGeoUriProvider( , m_maxSubdomains(0) { #ifdef USE_CHINA_NETWORK_REGISTRATION - QObject::connect(m_networkInfo, SIGNAL(currentMobileCountryCodeChanged(int, const QString&)), this, SLOT(mobileCountryCodeChanged(int, const QString &))); + QObject::connect(m_networkInfo, SIGNAL(currentMobileCountryCodeChanged(int,QString)), this, SLOT(mobileCountryCodeChanged(int,QString))); #endif setCurrentHost(isInternationalNetwork() || m_localizedHost.isEmpty() ? m_internationalHost : m_localizedHost); } diff --git a/src/plugins/geoservices/osm/qgeoroutingmanagerengineosm.cpp b/src/plugins/geoservices/osm/qgeoroutingmanagerengineosm.cpp index 077c55ba..8ed827a7 100644 --- a/src/plugins/geoservices/osm/qgeoroutingmanagerengineosm.cpp +++ b/src/plugins/geoservices/osm/qgeoroutingmanagerengineosm.cpp @@ -87,7 +87,7 @@ QGeoRouteReply* QGeoRoutingManagerEngineOsm::calculateRoute(const QGeoRouteReque QGeoRouteReplyOsm *routeReply = new QGeoRouteReplyOsm(reply, request, this); connect(routeReply, SIGNAL(finished()), this, SLOT(replyFinished())); - connect(routeReply, SIGNAL(error(QGeoRouteReply::Error, QString)), + connect(routeReply, SIGNAL(error(QGeoRouteReply::Error,QString)), this, SLOT(replyError(QGeoRouteReply::Error,QString))); return routeReply; -- cgit v1.2.1