Skip to content

Commit

Permalink
QtLocationPlugin: Move Providers To Separate Folder
Browse files Browse the repository at this point in the history
  • Loading branch information
HTRamsey committed Sep 19, 2024
1 parent 5b1b6aa commit 95ace95
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 34 deletions.
30 changes: 15 additions & 15 deletions src/QtLocationPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ find_package(Qt6 REQUIRED COMPONENTS Core Location Network Positioning Qml Sql)
qt_add_plugin(QGCLocation STATIC
CLASS_NAME QGeoServiceProviderFactoryQGC
OUTPUT_TARGETS QGCLocation_targets
BingMapProvider.cpp
BingMapProvider.h
ElevationMapProvider.cpp
ElevationMapProvider.h
EsriMapProvider.cpp
EsriMapProvider.h
GenericMapProvider.cpp
GenericMapProvider.h
GoogleMapProvider.cpp
GoogleMapProvider.h
MapboxMapProvider.cpp
MapboxMapProvider.h
MapProvider.cpp
MapProvider.h
Providers/BingMapProvider.cpp
Providers/BingMapProvider.h
Providers/ElevationMapProvider.cpp
Providers/ElevationMapProvider.h
Providers/EsriMapProvider.cpp
Providers/EsriMapProvider.h
Providers/GenericMapProvider.cpp
Providers/GenericMapProvider.h
Providers/GoogleMapProvider.cpp
Providers/GoogleMapProvider.h
Providers/MapboxMapProvider.cpp
Providers/MapboxMapProvider.h
Providers/MapProvider.cpp
Providers/MapProvider.h
QGCCachedTileSet.cpp
QGCCachedTileSet.h
QGCCacheTile.h
Expand Down Expand Up @@ -45,7 +45,6 @@ qt_add_plugin(QGCLocation STATIC
QMLControl/QGCMapEngineManager.h
)

target_compile_definitions(QGCLocation PRIVATE CMAKE_LOCATION_PLUGIN)
if(IOS)
target_compile_definitions(QGCLocation PRIVATE QGC_NO_GOOGLE_MAPS)
endif()
Expand All @@ -68,6 +67,7 @@ target_link_libraries(QGCLocation
target_include_directories(QGCLocation
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
Providers
QMLControl
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 2 additions & 17 deletions src/QtLocationPlugin/QGeoServiceProviderPluginQGC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,8 @@

QGC_LOGGING_CATEGORY(QGeoServiceProviderFactoryQGCLog, "qgc.qtlocationplugin.qgeoserviceproviderfactoryqgc")

#ifndef CMAKE_LOCATION_PLUGIN
extern "C" Q_DECL_EXPORT QT_PREPEND_NAMESPACE(QPluginMetaData) qt_plugin_query_metadata_v2();
extern "C" Q_DECL_EXPORT QT_PREPEND_NAMESPACE(QObject) *qt_plugin_instance();

const QT_PREPEND_NAMESPACE(QStaticPlugin) qt_static_plugin_QGeoServiceProviderFactoryQGC()
{
QT_PREPEND_NAMESPACE(QStaticPlugin) plugin = { qt_plugin_instance, qt_plugin_query_metadata_v2};
return plugin;
}
#endif

QGeoServiceProviderFactoryQGC::QGeoServiceProviderFactoryQGC()
QGeoServiceProviderFactoryQGC::QGeoServiceProviderFactoryQGC(QObject *parent)
: QObject(parent)
{
qCDebug(QGeoServiceProviderFactoryQGCLog) << Q_FUNC_INFO << this;
}
Expand Down Expand Up @@ -76,8 +66,3 @@ QPlaceManagerEngine* QGeoServiceProviderFactoryQGC::createPlaceManagerEngine(
}
return nullptr;
}

void QGeoServiceProviderFactoryQGC::setQmlEngine(QQmlEngine *engine)
{
m_engine = engine;
}
4 changes: 2 additions & 2 deletions src/QtLocationPlugin/QGeoServiceProviderPluginQGC.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ class QGeoServiceProviderFactoryQGC: public QObject, public QGeoServiceProviderF
Q_PLUGIN_METADATA(IID "org.qt-project.qt.geoservice.serviceproviderfactory/6.0" FILE "qgc_maps_plugin.json")

public:
QGeoServiceProviderFactoryQGC();
QGeoServiceProviderFactoryQGC(QObject *parent = nullptr);
~QGeoServiceProviderFactoryQGC();

QGeoCodingManagerEngine* createGeocodingManagerEngine(const QVariantMap &parameters, QGeoServiceProvider::Error *error, QString *errorString) const final;
QGeoMappingManagerEngine* createMappingManagerEngine(const QVariantMap &parameters, QGeoServiceProvider::Error *error, QString *errorString) const final;
QGeoRoutingManagerEngine* createRoutingManagerEngine(const QVariantMap &parameters, QGeoServiceProvider::Error *error, QString *errorString) const final;
QPlaceManagerEngine* createPlaceManagerEngine(const QVariantMap &parameters, QGeoServiceProvider::Error *error, QString *errorString) const final;

void setQmlEngine(QQmlEngine* engine) final;
void setQmlEngine(QQmlEngine* engine) final { m_engine = engine; }

private:
QQmlEngine* m_engine = nullptr;
Expand Down

0 comments on commit 95ace95

Please sign in to comment.