Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
e3267222
Commit
e3267222
authored
May 31, 2015
by
dogmaphobic
Browse files
Adding some Qt version checks
parent
fe015311
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/QtLocationPlugin/qgeotiledmappingmanagerengineqgc.cpp
View file @
e3267222
...
...
@@ -46,7 +46,11 @@
#include
<QtLocation/private/qgeocameracapabilities_p.h>
#include
<QtLocation/private/qgeomaptype_p.h>
#if QT_VERSION < 0x050500
#include
<QtLocation/private/qgeotiledmapdata_p.h>
#else
#include
<QtLocation/private/qgeotiledmap_p.h>
#endif
#include
<QDir>
#include
<QStandardPaths>
...
...
@@ -54,6 +58,14 @@
#include
"qgeotilefetcherqgc.h"
#include
"OpenPilotMaps.h"
#if QT_VERSION >= 0x050500
QGeoTiledMapQGC
::
QGeoTiledMapQGC
(
QGeoTiledMappingManagerEngine
*
engine
,
QObject
*
parent
)
:
QGeoTiledMap
(
engine
,
parent
)
{
}
#endif
QGeoTiledMappingManagerEngineQGC
::
QGeoTiledMappingManagerEngineQGC
(
const
QVariantMap
&
parameters
,
QGeoServiceProvider
::
Error
*
error
,
QString
*
errorString
)
:
QGeoTiledMappingManagerEngine
()
{
...
...
@@ -151,13 +163,34 @@ QGeoTiledMappingManagerEngineQGC::QGeoTiledMappingManagerEngineQGC(const QVarian
*
error
=
QGeoServiceProvider
::
NoError
;
errorString
->
clear
();
#if QT_VERSION >= 0x050500
if
(
parameters
.
contains
(
QStringLiteral
(
"mapping.copyright"
)))
m_customCopyright
=
parameters
.
value
(
QStringLiteral
(
"mapping.copyright"
)).
toString
().
toLatin1
();
#endif
}
QGeoTiledMappingManagerEngineQGC
::~
QGeoTiledMappingManagerEngineQGC
()
{
}
#if QT_VERSION < 0x050500
QGeoMapData
*
QGeoTiledMappingManagerEngineQGC
::
createMapData
()
{
return
new
QGeoTiledMapData
(
this
,
0
);
}
#else
QGeoMap
*
QGeoTiledMappingManagerEngineQGC
::
createMap
()
{
return
new
QGeoTiledMapQGC
(
this
);
}
QString
QGeoTiledMappingManagerEngineQGC
::
customCopyright
()
const
{
return
m_customCopyright
;
}
#endif
src/QtLocationPlugin/qgeotiledmappingmanagerengineqgc.h
View file @
e3267222
...
...
@@ -48,15 +48,36 @@
#define QGEOTILEDMAPPINGMANAGERENGINEGOOGLE_H
#include
<QtLocation/QGeoServiceProvider>
#if QT_VERSION >= 0x050500
#include
<QtLocation/private/qgeotiledmap_p.h>
#endif
#include
<QtLocation/private/qgeotiledmappingmanagerengine_p.h>
#if QT_VERSION >= 0x050500
class
QGeoTiledMapQGC
:
public
QGeoTiledMap
{
Q_OBJECT
public:
QGeoTiledMapQGC
(
QGeoTiledMappingManagerEngine
*
engine
,
QObject
*
parent
=
0
);
};
#endif
class
QGeoTiledMappingManagerEngineQGC
:
public
QGeoTiledMappingManagerEngine
{
Q_OBJECT
public:
QGeoTiledMappingManagerEngineQGC
(
const
QVariantMap
&
parameters
,
QGeoServiceProvider
::
Error
*
error
,
QString
*
errorString
);
~
QGeoTiledMappingManagerEngineQGC
();
#if QT_VERSION < 0x050500
QGeoMapData
*
createMapData
();
#else
QGeoMap
*
createMap
();
QString
customCopyright
()
const
;
#endif
private:
#if QT_VERSION >= 0x050500
QString
m_customCopyright
;
#endif
};
#endif // QGEOTILEDMAPPINGMANAGERENGINEGOOGLE_H
src/main.cc
View file @
e3267222
...
...
@@ -87,9 +87,11 @@ int main(int argc, char *argv[])
{
#ifdef Q_OS_MAC
#ifndef __ios__
// Prevent Apple's app nap from screwing us over
// tip: the domain can be cross-checked on the command line with <defaults domains>
QProcess
::
execute
(
"defaults write org.qgroundcontrol.qgroundcontrol NSAppSleepDisabled -bool YES"
);
#endif
#endif
// install the message handler
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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