Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
14b95ce3
Commit
14b95ce3
authored
Jun 08, 2020
by
Patrick José Pereira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QGCLocationPlugin: Remove tests for older Qt versions
Signed-off-by:
Patrick José Pereira
<
patrickelectric@gmail.com
>
parent
91b4ad84
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
48 deletions
+1
-48
QGeoTiledMappingManagerEngineQGC.cpp
src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp
+0
-38
QGeoTiledMappingManagerEngineQGC.h
src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.h
+1
-10
No files found.
src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp
View file @
14b95ce3
...
...
@@ -50,28 +50,18 @@
#include <QtLocation/private/qgeocameracapabilities_p.h>
#include <QtLocation/private/qgeomaptype_p.h>
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
#include <QtLocation/private/qgeotiledmapdata_p.h>
#else
#include <QtLocation/private/qgeotiledmap_p.h>
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
#include <QtLocation/private/qgeofiletilecache_p.h>
#else
#include <QtLocation/private/qgeotilecache_p.h>
#endif
#endif
#include <QDir>
#include <QStandardPaths>
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
//-----------------------------------------------------------------------------
QGeoTiledMapQGC
::
QGeoTiledMapQGC
(
QGeoTiledMappingManagerEngine
*
engine
,
QObject
*
parent
)
:
QGeoTiledMap
(
engine
,
parent
)
{
}
#endif
//-----------------------------------------------------------------------------
QGeoTiledMappingManagerEngineQGC
::
QGeoTiledMappingManagerEngineQGC
(
const
QVariantMap
&
parameters
,
QGeoServiceProvider
::
Error
*
error
,
QString
*
errorString
)
...
...
@@ -86,15 +76,7 @@ QGeoTiledMappingManagerEngineQGC::QGeoTiledMappingManagerEngineQGC(const QVarian
setTileSize
(
QSize
(
256
,
256
));
// In Qt 5.10 QGeoMapType need QGeoCameraCapabilities as argument
// E.g: https://github.com/qt/qtlocation/blob/2b230b0a10d898979e9d5193f4da2e408b397fe3/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp#L167
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
#define QGCGEOMAPTYPE(a,b,c,d,e,f) QGeoMapType(a,b,c,d,e,f,QByteArray("QGroundControl"), cameraCaps)
#elif QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)
#define QGCGEOMAPTYPE(a,b,c,d,e,f) QGeoMapType(a,b,c,d,e,f,QByteArray("QGroundControl"))
#else
#define QGCGEOMAPTYPE(a,b,c,d,e,f) QGeoMapType(a,b,c,d,e,f)
#endif
/*
* Google and Bing don't seem kosher at all. This was based on original code from OpenPilot and heavily modified to be used in QGC.
...
...
@@ -117,9 +99,7 @@ QGeoTiledMappingManagerEngineQGC::QGeoTiledMappingManagerEngineQGC(const QVarian
getQGCMapEngine
()
->
setUserAgent
(
parameters
.
value
(
QStringLiteral
(
"useragent"
)).
toString
().
toLatin1
());
}
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
_setCache
(
parameters
);
#endif
setTileFetcher
(
new
QGeoTileFetcherQGC
(
this
));
...
...
@@ -132,16 +112,6 @@ QGeoTiledMappingManagerEngineQGC::~QGeoTiledMappingManagerEngineQGC()
{
}
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
//-----------------------------------------------------------------------------
QGeoMapData
*
QGeoTiledMappingManagerEngineQGC
::
createMapData
()
{
return
new
QGeoTiledMapData
(
this
,
0
);
}
#else
//-----------------------------------------------------------------------------
QGeoMap
*
QGeoTiledMappingManagerEngineQGC
::
createMap
()
...
...
@@ -149,9 +119,6 @@ QGeoTiledMappingManagerEngineQGC::createMap()
return
new
QGeoTiledMapQGC
(
this
);
}
#endif
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
//-----------------------------------------------------------------------------
void
QGeoTiledMappingManagerEngineQGC
::
_setCache
(
const
QVariantMap
&
parameters
)
...
...
@@ -194,12 +161,8 @@ QGeoTiledMappingManagerEngineQGC::_setCache(const QVariantMap ¶meters)
if
(
memLimit
>
1024
*
1024
*
1024
)
memLimit
=
1024
*
1024
*
1024
;
//-- Disable Qt's disk cache (sort of)
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
QAbstractGeoTileCache
*
pTileCache
=
new
QGeoFileTileCache
(
cacheDir
);
setTileCache
(
pTileCache
);
#else
QGeoTileCache
*
pTileCache
=
createTileCacheWithDir
(
cacheDir
);
#endif
if
(
pTileCache
)
{
//-- We're basically telling it to use 100k of disk for cache. It doesn't like
...
...
@@ -209,4 +172,3 @@ QGeoTiledMappingManagerEngineQGC::_setCache(const QVariantMap ¶meters)
pTileCache
->
setMaxMemoryUsage
(
memLimit
);
}
}
#endif
src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.h
View file @
14b95ce3
...
...
@@ -48,19 +48,15 @@
#define QGEOTILEDMAPPINGMANAGERENGINEQGC_H
#include <QtLocation/QGeoServiceProvider>
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
#include <QtLocation/private/qgeotiledmap_p.h>
#endif
#include <QtLocation/private/qgeotiledmappingmanagerengine_p.h>
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
class
QGeoTiledMapQGC
:
public
QGeoTiledMap
{
Q_OBJECT
public:
QGeoTiledMapQGC
(
QGeoTiledMappingManagerEngine
*
engine
,
QObject
*
parent
=
0
);
};
#endif
class
QGeoTileFetcherQGC
;
...
...
@@ -70,15 +66,10 @@ class QGeoTiledMappingManagerEngineQGC : public QGeoTiledMappingManagerEngine
public:
QGeoTiledMappingManagerEngineQGC
(
const
QVariantMap
&
parameters
,
QGeoServiceProvider
::
Error
*
error
,
QString
*
errorString
);
~
QGeoTiledMappingManagerEngineQGC
();
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
QGeoMapData
*
createMapData
();
#else
QGeoMap
*
createMap
();
#endif
private:
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
void
_setCache
(
const
QVariantMap
&
parameters
);
#endif
};
#endif // QGEOTILEDMAPPINGMANAGERENGINEQGC_H
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment