Skip to content
Permalink
Browse files

fix windows build (extern "C" can returns pointers, but not C++ conta…

…iners)
  • Loading branch information
jef-n committed Aug 10, 2017
1 parent 65092d1 commit 6186c0f0ff68f16ebc17160d671282a7548769c7
@@ -37,7 +37,7 @@

SET(SIP_INCLUDES)
SET(SIP_TAGS)
SET(SIP_CONCAT_PARTS 10)
SET(SIP_CONCAT_PARTS 16)
SET(SIP_DISABLE_FEATURES)
SET(SIP_EXTRA_OPTIONS)
SET(SIP_EXTRA_OBJECTS)
@@ -21,7 +21,7 @@
#include "qgslogger.h"
#include "qgsproviderregistry.h"

typedef QList<QgsDataItemProvider *> dataItemProviders_t();
typedef QList<QgsDataItemProvider *> *dataItemProviders_t();


/**
@@ -71,8 +71,10 @@ QgsDataItemProviderRegistry::QgsDataItemProviderRegistry()
dataItemProviders_t *dataItemProvidersFn = reinterpret_cast< dataItemProviders_t * >( cast_to_fptr( library->resolve( "dataItemProviders" ) ) );
if ( dataItemProvidersFn )
{
QList<QgsDataItemProvider *> *providerList = dataItemProvidersFn();
// the function is a factory - we keep ownership of the returned providers
mProviders << dataItemProvidersFn();
mProviders << *providerList;
delete providerList;
}

// legacy support - using dataItem() and dataCapabilities() methods
@@ -2928,10 +2928,11 @@ QGISEXTERN bool createEmptyDataSource( const QString &uri,
}


QGISEXTERN QList<QgsDataItemProvider *> dataItemProviders()
QGISEXTERN QList< QgsDataItemProvider * > *dataItemProviders()
{
return QList<QgsDataItemProvider *>()
<< new QgsGeoPackageDataItemProvider;
QList< QgsDataItemProvider * > *providers = new QList< QgsDataItemProvider * >();
*providers << new QgsGeoPackageDataItemProvider;
return providers;
}

QgsCoordinateReferenceSystem QgsOgrProvider::crs() const
@@ -469,11 +469,15 @@ QgsDataItem *QgsWmsDataItemProvider::createDataItem( const QString &path, QgsDat
return nullptr;
}

QGISEXTERN QList<QgsDataItemProvider *> dataItemProviders()
QGISEXTERN QList<QgsDataItemProvider *> *dataItemProviders()
{
return QList<QgsDataItemProvider *>()
<< new QgsWmsDataItemProvider
<< new QgsXyzTileDataItemProvider;
QList<QgsDataItemProvider *> *providers = new QList<QgsDataItemProvider *>();

*providers
<< new QgsWmsDataItemProvider
<< new QgsXyzTileDataItemProvider;

return providers;
}

// ---------------------------------------------------------------------------

0 comments on commit 6186c0f

Please sign in to comment.
You can’t perform that action at this time.