summaryrefslogtreecommitdiff
path: root/src/location/maps
diff options
context:
space:
mode:
authorAlex Wilson <alex.wilson@nokia.com>2012-05-14 18:37:19 +1000
committerQt by Nokia <qt-info@nokia.com>2012-05-15 07:39:12 +0200
commit285a52a7a02cdf18b95df56cd579c7910ec84949 (patch)
tree6cbf8eaf497f033a959b290e4378d10a6d7de591 /src/location/maps
parent42ca2853c8c91a29899d5cb24c2e854f6c366a55 (diff)
downloadqtlocation-285a52a7a02cdf18b95df56cd579c7910ec84949.tar.gz
Coding style fixes: whitespace crusades
* Single spaces after keywords and before a bracket/brace * Binary operator spacing * Curlies at open of class/function body * Spacing around some type specifiers/declarations Change-Id: Ie516283e7a39c7ce83071ea8125774c76db611f5 Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
Diffstat (limited to 'src/location/maps')
-rw-r--r--src/location/maps/qcache3q_p.h12
-rw-r--r--src/location/maps/qgeocameracapabilities_p.h3
-rw-r--r--src/location/maps/qgeocameratiles.cpp26
-rw-r--r--src/location/maps/qgeomapcontroller_p.h3
-rw-r--r--src/location/maps/qgeomappingmanager.h2
-rw-r--r--src/location/maps/qgeomappingmanagerengine.h2
-rw-r--r--src/location/maps/qgeomapscene.cpp5
-rw-r--r--src/location/maps/qgeoserviceprovider.cpp4
-rw-r--r--src/location/maps/qgeoserviceprovider.h2
-rw-r--r--src/location/maps/qgeotilecache_p.h3
-rw-r--r--src/location/maps/qgeotiledmapdata.cpp4
-rw-r--r--src/location/maps/qgeotiledmapdata_p_p.h2
-rw-r--r--src/location/maps/qgeotiledmappingmanagerengine.cpp2
-rw-r--r--src/location/maps/qgeotiledmappingmanagerengine.h2
-rw-r--r--src/location/maps/qgeotilefetcher.cpp2
-rw-r--r--src/location/maps/qgeotilefetcher.h2
-rw-r--r--src/location/maps/qgeotilerequestmanager.cpp7
17 files changed, 46 insertions, 37 deletions
diff --git a/src/location/maps/qcache3q_p.h b/src/location/maps/qcache3q_p.h
index b744583c..4f8554eb 100644
--- a/src/location/maps/qcache3q_p.h
+++ b/src/location/maps/qcache3q_p.h
@@ -119,7 +119,8 @@ class QCache3Q : public EvPolicy
{
private:
class Queue;
- class Node {
+ class Node
+ {
public:
inline explicit Node() : q(0), n(0), p(0), pop(0), cost(0) {}
@@ -132,7 +133,8 @@ private:
int cost;
};
- class Queue {
+ class Queue
+ {
public:
inline explicit Queue() : f(0), l(0), cost(0), pop(0), size(0) {}
@@ -154,7 +156,7 @@ public:
inline ~QCache3Q() { clear(); delete q1_; delete q2_; delete q3_; delete q1_evicted_; }
inline int maxCost() const { return maxCost_; }
- void setMaxCost(int maxCost, int minRecent=-1, int maxOldPopular=-1);
+ void setMaxCost(int maxCost, int minRecent = -1, int maxOldPopular = -1);
inline int promoteAt() const { return promote_; }
inline void setPromoteAt(int p) { promote_ = p; }
@@ -189,9 +191,9 @@ void QCache3Q<Key,T,EvPolicy>::printStats()
{
qDebug("\n=== cache %p ===", this);
qDebug("hits: %d (%.2f%%)\tmisses: %d\tfill: %.2f%%", hitCount_,
- 100.0 * float(hitCount_)/(float(hitCount_+missCount_)),
+ 100.0 * float(hitCount_) / (float(hitCount_ + missCount_)),
missCount_,
- 100.0 * float(totalCost())/float(maxCost()));
+ 100.0 * float(totalCost()) / float(maxCost()));
qDebug("q1g: size=%d, pop=%llu", q1_evicted_->size, q1_evicted_->pop);
qDebug("q1: cost=%d, size=%d, pop=%llu", q1_->cost, q1_->size, q1_->pop);
qDebug("q2: cost=%d, size=%d, pop=%llu", q2_->cost, q2_->size, q2_->pop);
diff --git a/src/location/maps/qgeocameracapabilities_p.h b/src/location/maps/qgeocameracapabilities_p.h
index c103c37e..b9b17ed7 100644
--- a/src/location/maps/qgeocameracapabilities_p.h
+++ b/src/location/maps/qgeocameracapabilities_p.h
@@ -60,7 +60,8 @@ QT_BEGIN_NAMESPACE
class QGeoCameraCapabilitiesPrivate;
-class Q_LOCATION_EXPORT QGeoCameraCapabilities {
+class Q_LOCATION_EXPORT QGeoCameraCapabilities
+{
public:
QGeoCameraCapabilities();
QGeoCameraCapabilities(const QGeoCameraCapabilities &other);
diff --git a/src/location/maps/qgeocameratiles.cpp b/src/location/maps/qgeocameratiles.cpp
index edef8392..9258661b 100644
--- a/src/location/maps/qgeocameratiles.cpp
+++ b/src/location/maps/qgeocameratiles.cpp
@@ -59,7 +59,8 @@
QT_BEGIN_NAMESPACE
-struct Frustum {
+struct Frustum
+{
QDoubleVector3D topLeftNear;
QDoubleVector3D topLeftFar;
QDoubleVector3D topRightNear;
@@ -72,7 +73,8 @@ struct Frustum {
typedef QVector<QDoubleVector3D> Polygon;
-class QGeoCameraTilesPrivate {
+class QGeoCameraTilesPrivate
+{
public:
QGeoCameraTilesPrivate();
~QGeoCameraTilesPrivate();
@@ -93,10 +95,12 @@ public:
Frustum frustum() const;
- class LengthSorter {
+ class LengthSorter
+ {
public:
QDoubleVector3D base;
- bool operator()(const QDoubleVector3D &lhs, const QDoubleVector3D &rhs) {
+ bool operator()(const QDoubleVector3D &lhs, const QDoubleVector3D &rhs)
+ {
return (lhs - base).lengthSquared() < (rhs - base).lengthSquared();
}
};
@@ -780,16 +784,16 @@ QSet<QGeoTileSpec> QGeoCameraTilesPrivate::tilesFromPolygon(const Polygon &polyg
map.add(x,y);
// top left corner
- int iPrev = (i1 + numPoints - 1 ) % numPoints;
+ int iPrev = (i1 + numPoints - 1) % numPoints;
double xPrevious = polygon.at(iPrev).get(0);
double yPrevious = polygon.at(iPrev).get(1);
bool xPreviousFixed = qFuzzyCompare(xPrevious, x1);
- if ( xIntegral && xPreviousFixed && yIntegral && yFixed){
- if ( (x2 > x1) && (yPrevious > y1) ){
- if ( (x-1) > 0 && (y-1) > 0)
- map.add(x-1,y-1);
- }
- else if ( (x2 < x1) && (yPrevious < y1) ){
+ if (xIntegral && xPreviousFixed && yIntegral && yFixed) {
+ if ((x2 > x1) && (yPrevious > y1)) {
+ if ((x - 1) > 0 && (y - 1) > 0)
+ map.add(x - 1, y - 1);
+ } else if ((x2 < x1) && (yPrevious < y1)) {
+ // what?
}
}
diff --git a/src/location/maps/qgeomapcontroller_p.h b/src/location/maps/qgeomapcontroller_p.h
index 7b650851..e0086f1e 100644
--- a/src/location/maps/qgeomapcontroller_p.h
+++ b/src/location/maps/qgeomapcontroller_p.h
@@ -62,7 +62,8 @@ QT_BEGIN_NAMESPACE
class QGeoMapData;
-class Q_LOCATION_EXPORT AnimatableCoordinate {
+class Q_LOCATION_EXPORT AnimatableCoordinate
+{
public:
AnimatableCoordinate();
AnimatableCoordinate(const QGeoCoordinate &coordinate,
diff --git a/src/location/maps/qgeomappingmanager.h b/src/location/maps/qgeomappingmanager.h
index 197f596b..e563a274 100644
--- a/src/location/maps/qgeomappingmanager.h
+++ b/src/location/maps/qgeomappingmanager.h
@@ -90,7 +90,7 @@ protected:
QGeoMappingManager(QGeoMappingManagerEngine *engine, QObject *parent = 0);
private:
- QGeoMappingManagerPrivate* d_ptr;
+ QGeoMappingManagerPrivate *d_ptr;
Q_DISABLE_COPY(QGeoMappingManager)
friend class QGeoServiceProvider;
diff --git a/src/location/maps/qgeomappingmanagerengine.h b/src/location/maps/qgeomappingmanagerengine.h
index 7c676e1f..45d56e5a 100644
--- a/src/location/maps/qgeomappingmanagerengine.h
+++ b/src/location/maps/qgeomappingmanagerengine.h
@@ -104,7 +104,7 @@ protected:
void engineInitialized();
private:
- QGeoMappingManagerEnginePrivate* d_ptr;
+ QGeoMappingManagerEnginePrivate *d_ptr;
void setManagerName(const QString &managerName);
void setManagerVersion(int managerVersion);
diff --git a/src/location/maps/qgeomapscene.cpp b/src/location/maps/qgeomapscene.cpp
index 665ed789..bb69c814 100644
--- a/src/location/maps/qgeomapscene.cpp
+++ b/src/location/maps/qgeomapscene.cpp
@@ -64,7 +64,8 @@
QT_BEGIN_NAMESPACE
-class QGeoMapScenePrivate {
+class QGeoMapScenePrivate
+{
public:
explicit QGeoMapScenePrivate(QGeoMapScene *scene);
~QGeoMapScenePrivate();
@@ -721,7 +722,7 @@ void QGeoMapScenePrivate::paintGL(QGLPainter *painter)
// do any pending upload/releases
while (!newUploads_.isEmpty()) {
- if (!newUploads_.front()->textureBound){
+ if (!newUploads_.front()->textureBound) {
newUploads_.front()->texture->bind();
newUploads_.front()->texture->clearImage();
newUploads_.front()->textureBound = true;
diff --git a/src/location/maps/qgeoserviceprovider.cpp b/src/location/maps/qgeoserviceprovider.cpp
index 9c438cd1..c38f4ff3 100644
--- a/src/location/maps/qgeoserviceprovider.cpp
+++ b/src/location/maps/qgeoserviceprovider.cpp
@@ -246,7 +246,7 @@ Manager *QGeoServiceProviderPrivate::manager(QGeoServiceProvider::Error *_error,
// make local references just so this method is easier to read
QGeoServiceProvider::Error &error = *_error;
QString &errorString = *_errorString;
- Manager * &manager = *_manager;
+ Manager *&manager = *_manager;
if (!this->factory)
this->loadPlugin(this->parameterMap);
@@ -591,7 +591,7 @@ QHash<QString, QJsonObject> QGeoServiceProviderPrivate::plugins(bool reload)
static QHash<QString, QJsonObject> plugins;
static bool alreadyDiscovered = false;
- if (reload == true)
+ if (reload == true)
alreadyDiscovered = false;
if (!alreadyDiscovered) {
diff --git a/src/location/maps/qgeoserviceprovider.h b/src/location/maps/qgeoserviceprovider.h
index f5ba723b..f3958148 100644
--- a/src/location/maps/qgeoserviceprovider.h
+++ b/src/location/maps/qgeoserviceprovider.h
@@ -160,7 +160,7 @@ public:
void setAllowExperimental(bool allow);
private:
- QGeoServiceProviderPrivate* d_ptr;
+ QGeoServiceProviderPrivate *d_ptr;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QGeoServiceProvider::RoutingFeatures)
diff --git a/src/location/maps/qgeotilecache_p.h b/src/location/maps/qgeotilecache_p.h
index f282e08c..52207a71 100644
--- a/src/location/maps/qgeotilecache_p.h
+++ b/src/location/maps/qgeotilecache_p.h
@@ -90,7 +90,8 @@ public:
};
/* This is also used in the mapgeometry */
-class Q_LOCATION_EXPORT QGeoTileTexture {
+class Q_LOCATION_EXPORT QGeoTileTexture
+{
public:
QGeoTileTexture();
diff --git a/src/location/maps/qgeotiledmapdata.cpp b/src/location/maps/qgeotiledmapdata.cpp
index dbc8bb99..9ecf8539 100644
--- a/src/location/maps/qgeotiledmapdata.cpp
+++ b/src/location/maps/qgeotiledmapdata.cpp
@@ -324,8 +324,8 @@ void QGeoTiledMapDataPrivate::resized(int width, int height)
if (width > 0 && height > 0 && cache_ && cameraTiles_) {
// absolute minimum size: one tile each side of display, 32-bit colour
- int texCacheSize = (width + cameraTiles_->tileSize()*2) *
- (height + cameraTiles_->tileSize()*2) * 4;
+ int texCacheSize = (width + cameraTiles_->tileSize() * 2) *
+ (height + cameraTiles_->tileSize() * 2) * 4;
// multiply by 3 so the 'recent' list in the cache is big enough for
// an entire display of tiles
diff --git a/src/location/maps/qgeotiledmapdata_p_p.h b/src/location/maps/qgeotiledmapdata_p_p.h
index cd6d1591..d1e68e9f 100644
--- a/src/location/maps/qgeotiledmapdata_p_p.h
+++ b/src/location/maps/qgeotiledmapdata_p_p.h
@@ -108,7 +108,7 @@ public:
private:
QGeoTiledMapData *map_;
- QGeoTileCache* cache_;
+ QGeoTileCache *cache_;
QGeoTiledMappingManagerEngine *engine_;
QSet<QGeoTileSpec> visibleTiles_;
diff --git a/src/location/maps/qgeotiledmappingmanagerengine.cpp b/src/location/maps/qgeotiledmappingmanagerengine.cpp
index b42df8e3..6ac65b37 100644
--- a/src/location/maps/qgeotiledmappingmanagerengine.cpp
+++ b/src/location/maps/qgeotiledmappingmanagerengine.cpp
@@ -77,7 +77,7 @@ void QGeoTiledMappingManagerEngine::setTileFetcher(QGeoTileFetcher *fetcher)
d->fetcher_ = fetcher;
d->fetcher_->init();
- d->thread_= new QThread;
+ d->thread_ = new QThread;
qRegisterMetaType<QGeoTileSpec>();
diff --git a/src/location/maps/qgeotiledmappingmanagerengine.h b/src/location/maps/qgeotiledmappingmanagerengine.h
index 7b529c94..ea1433a0 100644
--- a/src/location/maps/qgeotiledmappingmanagerengine.h
+++ b/src/location/maps/qgeotiledmappingmanagerengine.h
@@ -118,7 +118,7 @@ protected:
QGeoTileCache *createTileCacheWithDir(const QString& cacheDirectory);
private:
- QGeoTiledMappingManagerEnginePrivate* d_ptr;
+ QGeoTiledMappingManagerEnginePrivate *d_ptr;
Q_DECLARE_PRIVATE(QGeoTiledMappingManagerEngine)
Q_DISABLE_COPY(QGeoTiledMappingManagerEngine)
diff --git a/src/location/maps/qgeotilefetcher.cpp b/src/location/maps/qgeotilefetcher.cpp
index 5f9fc479..8b83b881 100644
--- a/src/location/maps/qgeotilefetcher.cpp
+++ b/src/location/maps/qgeotilefetcher.cpp
@@ -126,7 +126,7 @@ void QGeoTileFetcher::cancelTileRequests(const QSet<QGeoTileSpec> &tiles)
tile_iter tile = tiles.constBegin();
tile_iter end = tiles.constEnd();
for (; tile != end; ++tile) {
- QGeoTiledMapReply* reply = d->invmap_.value(*tile, 0);
+ QGeoTiledMapReply *reply = d->invmap_.value(*tile, 0);
if (reply) {
d->invmap_.remove(*tile);
reply->abort();
diff --git a/src/location/maps/qgeotilefetcher.h b/src/location/maps/qgeotilefetcher.h
index bfb85921..5e996b26 100644
--- a/src/location/maps/qgeotilefetcher.h
+++ b/src/location/maps/qgeotilefetcher.h
@@ -85,7 +85,7 @@ protected:
QGeoTiledMappingManagerEngine::CacheAreas cacheHint() const;
private:
- QGeoTileFetcherPrivate* d_ptr;
+ QGeoTileFetcherPrivate *d_ptr;
virtual QGeoTiledMapReply* getTileImage(const QGeoTileSpec &spec) = 0;
void handleReply(QGeoTiledMapReply *reply, const QGeoTileSpec &spec);
diff --git a/src/location/maps/qgeotilerequestmanager.cpp b/src/location/maps/qgeotilerequestmanager.cpp
index 73400f29..dca33cb0 100644
--- a/src/location/maps/qgeotilerequestmanager.cpp
+++ b/src/location/maps/qgeotilerequestmanager.cpp
@@ -121,7 +121,7 @@ QList<QSharedPointer<QGeoTileTexture> > QGeoTileRequestManagerPrivate::requestTi
static_cast<QGeoTiledMappingManagerEngine*>(map_->engine()) : 0;
// remove tiles in cache from request tiles
- if (engine){
+ if (engine) {
iter i = requestTiles.constBegin();
iter end = requestTiles.constEnd();
for (; i != end; ++i) {
@@ -172,7 +172,7 @@ class RetryFuture : public QObject
{
Q_OBJECT
public:
- RetryFuture(const QGeoTileSpec &tile, QGeoTiledMapData *map, QObject *parent=0);
+ RetryFuture(const QGeoTileSpec &tile, QGeoTiledMapData *map, QObject *parent = 0);
public Q_SLOTS:
void retry();
@@ -191,8 +191,7 @@ void RetryFuture::retry()
QSet<QGeoTileSpec> requestTiles;
QSet<QGeoTileSpec> cancelTiles;
requestTiles.insert(tile_);
- if (map_)
- {
+ if (map_) {
QGeoTiledMappingManagerEngine *engine =
static_cast<QGeoTiledMappingManagerEngine*>(map_->engine());
engine->updateTileRequests(map_, requestTiles, cancelTiles);