diff --git a/images/images.qrc b/images/images.qrc
index f8baa88fd4a..bf9c695ff9a 100644
--- a/images/images.qrc
+++ b/images/images.qrc
@@ -563,6 +563,7 @@
themes/default/mActionMapSettings.svg
themes/default/mActionLockExtent.svg
icons/qgis_icon.svg
+ themes/default/mGeoPackage.png
qgis_tips/symbol_levels.png
diff --git a/images/themes/default/mGeoPackage.png b/images/themes/default/mGeoPackage.png
new file mode 100644
index 00000000000..17bf308b4c2
Binary files /dev/null and b/images/themes/default/mGeoPackage.png differ
diff --git a/python/core/qgsdataitem.sip b/python/core/qgsdataitem.sip
index fe47058b798..f2264f8fa2b 100644
--- a/python/core/qgsdataitem.sip
+++ b/python/core/qgsdataitem.sip
@@ -361,6 +361,7 @@ class QgsLayerItem : QgsDataItem
Plugin
};
+
QgsLayerItem( QgsDataItem *parent, const QString &name, const QString &path, const QString &uri, LayerType layerType, const QString &providerKey );
@@ -410,6 +411,13 @@ Returns provider key
:rtype: str
%End
+ static QString layerTypeAsString( const LayerType &layerType );
+%Docstring
+ Returns the string representatio of the given ``layerType``
+.. versionadded:: 3
+ :rtype: str
+%End
+
protected:
diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp
index c004d2c4408..47891bbe770 100644
--- a/src/app/qgisapp.cpp
+++ b/src/app/qgisapp.cpp
@@ -4488,6 +4488,7 @@ void QgisApp::askUserForOGRSublayers( QgsVectorLayer *layer )
}
}
+ // Check if the current layer uri contains the
// We initialize a selection dialog and display it.
QgsSublayersDialog chooseSublayersDialog( QgsSublayersDialog::Ogr, QStringLiteral( "ogr" ), this );
@@ -9807,7 +9808,7 @@ QgsVectorLayer *QgisApp::addVectorLayer( const QString &vectorLayerPath, const Q
// If the newly created layer has more than 1 layer of data available, we show the
// sublayers selection dialog so the user can select the sublayers to actually load.
- if ( sublayers.count() > 1 )
+ if ( sublayers.count() > 1 && ! vectorLayerPath.contains( QStringLiteral( "layerid=" ) ) )
{
askUserForOGRSublayers( layer );
diff --git a/src/core/qgsdataitem.cpp b/src/core/qgsdataitem.cpp
index 4c34c833ac8..0cd568065a6 100644
--- a/src/core/qgsdataitem.cpp
+++ b/src/core/qgsdataitem.cpp
@@ -581,6 +581,12 @@ QgsMapLayer::LayerType QgsLayerItem::mapLayerType() const
return QgsMapLayer::VectorLayer;
}
+QString QgsLayerItem::layerTypeAsString( const QgsLayerItem::LayerType &layerType )
+{
+ static int enumIdx = staticMetaObject.indexOfEnumerator( "LayerType" );
+ return staticMetaObject.enumerator( enumIdx ).valueToKey( layerType );
+}
+
bool QgsLayerItem::equal( const QgsDataItem *other )
{
//QgsDebugMsg ( mPath + " x " + other->mPath );
diff --git a/src/core/qgsdataitem.h b/src/core/qgsdataitem.h
index aa398aa3224..683c3c78bc2 100644
--- a/src/core/qgsdataitem.h
+++ b/src/core/qgsdataitem.h
@@ -328,6 +328,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS( QgsDataItem::Capabilities )
class CORE_EXPORT QgsLayerItem : public QgsDataItem
{
Q_OBJECT
+ Q_ENUMS( LayerType )
public:
enum LayerType
{
@@ -343,6 +344,8 @@ class CORE_EXPORT QgsLayerItem : public QgsDataItem
Plugin //!< Added in 2.10
};
+ Q_ENUMS( LayerType )
+
QgsLayerItem( QgsDataItem *parent, const QString &name, const QString &path, const QString &uri, LayerType layerType, const QString &providerKey );
// --- reimplemented from QgsDataItem ---
@@ -379,6 +382,11 @@ class CORE_EXPORT QgsLayerItem : public QgsDataItem
*/
virtual QString comments() const { return QString(); }
+ /** Returns the string representatio of the given \a layerType
+ * \since QGIS 3
+ */
+ static QString layerTypeAsString( const LayerType &layerType );
+
protected:
//! The provider key
diff --git a/src/providers/ogr/CMakeLists.txt b/src/providers/ogr/CMakeLists.txt
index 46f09b87840..ec54f820426 100644
--- a/src/providers/ogr/CMakeLists.txt
+++ b/src/providers/ogr/CMakeLists.txt
@@ -6,6 +6,8 @@ SET (OGR_SRCS
qgsogrconnpool.cpp
qgsogrexpressioncompiler.cpp
qgsogrsourceselect.cpp
+ qgsgeopackagedataitems.cpp
+ qgsgeopackageconnection.cpp
)
SET(OGR_MOC_HDRS
@@ -13,6 +15,8 @@ SET(OGR_MOC_HDRS
qgsogrdataitems.h
qgsogrconnpool.h
qgsogrsourceselect.h
+ qgsgeopackagedataitems.h
+ qgsgeopackageconnection.h
)
########################################################
diff --git a/src/providers/ogr/qgsgeopackageconnection.cpp b/src/providers/ogr/qgsgeopackageconnection.cpp
new file mode 100644
index 00000000000..d2e1d9bc5ea
--- /dev/null
+++ b/src/providers/ogr/qgsgeopackageconnection.cpp
@@ -0,0 +1,89 @@
+/***************************************************************************
+ qgsgeopackageconnection.cpp - selector for geopackage
+ -------------------
+ begin : August 2017
+ copyright : (C) 2017 by Alessandro Pasotti
+ email : apasotti at boundlessgeo dot com
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "qgis.h"
+#include "qgsdatasourceuri.h"
+#include "qgssettings.h"
+#include "qgsgeopackageconnection.h"
+#include "qgslogger.h"
+#include
+#include
+
+const QString QgsGeoPackageConnection::SETTINGS_PREFIX = QStringLiteral( "providers/geopackage" );
+
+
+QgsGeoPackageConnection::QgsGeoPackageConnection( const QString &connName )
+ : mConnName( connName )
+{
+ QgsSettings settings;
+
+ QString key = QStringLiteral( "%1/%2/path" ).arg( connectionsPath( ), mConnName );
+ mPath = settings.value( key ).toString();
+}
+
+QgsGeoPackageConnection::~QgsGeoPackageConnection()
+{
+
+}
+
+QgsDataSourceUri QgsGeoPackageConnection::uri()
+{
+ QgsDataSourceUri uri;
+ uri.setEncodedUri( mPath );
+ return uri;
+}
+
+void QgsGeoPackageConnection::setPath( QString &path )
+{
+ mPath = path;
+}
+
+void QgsGeoPackageConnection::save( )
+{
+ QgsSettings settings;
+ settings.setValue( QStringLiteral( "%1/%2/path" ).arg( connectionsPath( ), mConnName ), mPath );
+}
+
+QString QgsGeoPackageConnection::connectionsPath()
+{
+ return QStringLiteral( "%1/connections" ).arg( SETTINGS_PREFIX );
+}
+
+QStringList QgsGeoPackageConnection::connectionList()
+{
+ QgsSettings settings;
+ settings.beginGroup( connectionsPath( ) );
+ return settings.childGroups();
+}
+
+QString QgsGeoPackageConnection::selectedConnection()
+{
+ QgsSettings settings;
+ return settings.value( QStringLiteral( "%1/selected" ).arg( SETTINGS_PREFIX ) ).toString();
+}
+
+void QgsGeoPackageConnection::setSelectedConnection( const QString &name )
+{
+ QgsSettings settings;
+ settings.setValue( QStringLiteral( "%1/selected" ).arg( SETTINGS_PREFIX ), name );
+}
+
+void QgsGeoPackageConnection::deleteConnection( const QString &name )
+{
+ QgsSettings settings;
+ settings.remove( QStringLiteral( "%1/%2" ).arg( connectionsPath(), name ) );
+}
diff --git a/src/providers/ogr/qgsgeopackageconnection.h b/src/providers/ogr/qgsgeopackageconnection.h
new file mode 100644
index 00000000000..6e15534b100
--- /dev/null
+++ b/src/providers/ogr/qgsgeopackageconnection.h
@@ -0,0 +1,67 @@
+/***************************************************************************
+ qgsgeopackageconnection.h - GeoPackage connection
+ -------------------
+ begin : August 2017
+ copyright : (C) 2017 by Alessandro Pasotti
+ email : apasotti at boundlessgeo dot com
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef QGSGEOPACKAGECONNECTION_H
+#define QGSGEOPACKAGECONNECTION_H
+
+#include "qgsdatasourceuri.h"
+
+#include
+
+/*!
+ * \brief Connections management
+ */
+class QgsGeoPackageConnection : public QObject
+{
+ Q_OBJECT
+
+ public:
+ //! Constructor
+ explicit QgsGeoPackageConnection( const QString &connName );
+
+ ~QgsGeoPackageConnection();
+
+ static QStringList connectionList();
+
+ static void deleteConnection( const QString &name );
+
+ static QString selectedConnection();
+ static void setSelectedConnection( const QString &name );
+
+ public:
+ //! Return the uri
+ //! \see QgsDataSourceUri
+ QgsDataSourceUri uri();
+ //! Return the path
+ QString path( ) { return mPath; }
+ //! Returns the connection name
+ QString name() { return mConnName; }
+ //! Set the \a path fo the connection
+ void setPath( QString &path );
+ //! Store the connection data in the settings
+ void save();
+ const static QString SETTINGS_PREFIX;
+
+ private:
+
+ static QString connectionsPath( );
+ QString mConnName;
+ QString mPath;
+
+};
+
+#endif // QGSGEOPACKAGECONNECTION_H
diff --git a/src/providers/ogr/qgsgeopackagedataitems.cpp b/src/providers/ogr/qgsgeopackagedataitems.cpp
new file mode 100644
index 00000000000..987f36e74a2
--- /dev/null
+++ b/src/providers/ogr/qgsgeopackagedataitems.cpp
@@ -0,0 +1,234 @@
+/***************************************************************************
+ qgsgeopackagedataitems.h
+ ---------------------
+ begin : August 2017
+ copyright : (C) 2017 by Alessandro Pasotti
+ email : apasotti at boundlessgeo dot com
+ ***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "qgsgeopackagedataitems.h"
+#include "qgsgeopackageconnection.h"
+#include "qgslogger.h"
+#include "qgssettings.h"
+#include "qgsvectorlayer.h"
+
+#include
+#include
+#include
+#include
+
+QgsDataItem *QgsGeoPackageDataItemProvider::createDataItem( const QString &path, QgsDataItem *parentItem )
+{
+ QgsDebugMsg( "path = " + path );
+ if ( path.isEmpty() )
+ {
+ return new QgsGeoPackageRootItem( parentItem, QStringLiteral( "GeoPackage" ), QStringLiteral( "gpkg:" ) );
+ }
+ return nullptr;
+}
+
+QgsGeoPackageRootItem::QgsGeoPackageRootItem( QgsDataItem *parent, QString name, QString path )
+ : QgsDataCollectionItem( parent, name, path )
+{
+ mCapabilities |= Fast;
+ mIconName = QStringLiteral( "mGeoPackage.png" );
+ populate();
+}
+
+QgsGeoPackageRootItem::~QgsGeoPackageRootItem()
+{
+
+}
+
+QVector QgsGeoPackageRootItem::createChildren()
+{
+ QVector connections;
+
+ Q_FOREACH ( const QString &connName, QgsGeoPackageConnection::connectionList() )
+ {
+ QgsGeoPackageConnection connection( connName );
+ QgsDataItem *conn = new QgsGeoPackageConnectionItem( this, connection.name(), connection.uri().encodedUri() );
+
+ connections.append( conn );
+ }
+ return connections;
+}
+
+QList QgsGeoPackageRootItem::actions()
+{
+ QList lst;
+
+ QAction *actionNew = new QAction( tr( "New Connection..." ), this );
+ connect( actionNew, &QAction::triggered, this, &QgsGeoPackageRootItem::newConnection );
+ lst.append( actionNew );
+
+ QAction *actionCreateDatabase = new QAction( tr( "Create Database..." ), this );
+ connect( actionCreateDatabase, &QAction::triggered, this, &QgsGeoPackageRootItem::createDatabase );
+ lst.append( actionCreateDatabase );
+
+ return lst;
+}
+
+QWidget *QgsGeoPackageRootItem::paramWidget()
+{
+ return nullptr;
+}
+
+
+void QgsGeoPackageRootItem::connectionsChanged()
+{
+ refresh();
+}
+
+void QgsGeoPackageRootItem::newConnection()
+{
+ // TODO use QgsFileWidget
+ QString path = QFileDialog::getOpenFileName( nullptr, tr( "Open GeoPackage" ), "", tr( "GeoPackage Database (*.gpkg)" ) );
+ QFileInfo fileInfo( path );
+ QString folder = fileInfo.path();
+ QString connName = fileInfo.fileName();
+ if ( ! path.isEmpty() )
+ {
+ bool ok = true;
+ while ( ok && ! QgsGeoPackageConnection( connName ).path( ).isEmpty( ) )
+ {
+
+ connName = QInputDialog::getText( nullptr, tr( "Cannot add connection '%1'" ).arg( connName ),
+ tr( "A connection with the same name already exists,\nplease provide a new name:" ), QLineEdit::Normal,
+ QLatin1String( "" ), &ok );
+ }
+ if ( ok && ! connName.isEmpty() )
+ {
+ QgsGeoPackageConnection connection( connName );
+ connection.setPath( path );
+ connection.save();
+ refreshConnections();
+ }
+ }
+}
+
+
+void QgsGeoPackageRootItem::createDatabase()
+{
+// TODO
+}
+
+
+QgsGeoPackageConnectionItem::QgsGeoPackageConnectionItem( QgsDataItem *parent, QString name, QString path )
+ : QgsDataCollectionItem( parent, name, path )
+ , mPath( path )
+{
+ mCapabilities |= Collapse;
+}
+
+QVector QgsGeoPackageConnectionItem::createChildren()
+{
+ QVector children;
+
+ QgsVectorLayer layer( mPath, QStringLiteral( "ogr_tmp" ), QStringLiteral( "ogr" ) );
+ if ( ! layer.isValid( ) )
+ {
+ children.append( new QgsErrorItem( this, tr( "Layer is not a valid GeoPackage layer" ), mPath + "/error" ) );
+ }
+ else
+ {
+ Q_FOREACH ( const QString &descriptor, layer.dataProvider()->subLayers( ) )
+ {
+ QStringList pieces = descriptor.split( ':' );
+ QString layerId = pieces[0];
+ QString name = pieces[1];
+ QString featuresCount = pieces[2];
+ QString geometryType = pieces[3];
+ QgsGeoPackageLayerItem::LayerType layerType;
+ layerType = layerTypeFromDb( geometryType );
+ if ( layerType != QgsGeoPackageLayerItem::LayerType::NoType )
+ {
+ // URI: '/path/gdal_sample_v1.2_no_extensions.gpkg|layerid=7|geometrytype=Point'
+ QString uri = QStringLiteral( "%1|layerid=%2|geometrytype=%3" ).arg( mPath, layerId, QgsGeoPackageLayerItem::layerTypeAsString( layerTypeFromDb( geometryType ) ) );
+ QgsGeoPackageLayerItem *item = new QgsGeoPackageLayerItem( this, name, mPath, uri, layerType );
+ QgsDebugMsg( QStringLiteral( "Adding GPKG item %1 %2 %3" ).arg( name, uri, geometryType ) );
+ children.append( item );
+ }
+ else
+ {
+ children.append( new QgsErrorItem( this, tr( "Layer is not a supported GeoPackage layer geometry type: %1" ).arg( geometryType ), mPath + "/error" ) );
+ }
+
+ }
+ }
+ return children;
+
+}
+
+bool QgsGeoPackageConnectionItem::equal( const QgsDataItem *other )
+{
+ if ( type() != other->type() )
+ {
+ return false;
+ }
+ const QgsGeoPackageConnectionItem *o = dynamic_cast( other );
+ return o && mPath == o->mPath && mName == o->mName;
+
+}
+
+#ifdef HAVE_GUI
+
+QList QgsGeoPackageConnectionItem::actions()
+{
+ QList lst;
+
+ QAction *actionRemoveConnection = new QAction( tr( "Remove connection" ), this );
+ // TODO: implement layer deletion
+ // connect( actionDeleteLayer, &QAction::triggered, this, &QgsGeoPackageLayerItem::deleteLayer );
+ lst.append( actionRemoveConnection );
+ return lst;
+}
+#endif
+
+QgsLayerItem::LayerType QgsGeoPackageConnectionItem::layerTypeFromDb( const QString &geometryType )
+{
+ if ( QString::compare( geometryType, QStringLiteral( "Point" ), Qt::CaseInsensitive ) == 0 || QString::compare( geometryType, QStringLiteral( "MultiPoint" ), Qt::CaseInsensitive ) == 0 )
+ {
+ return QgsLayerItem::LayerType::Point;
+ }
+ else if ( QString::compare( geometryType, QStringLiteral( "Polygon" ), Qt::CaseInsensitive ) == 0 || QString::compare( geometryType, QStringLiteral( "MultiPolygon" ), Qt::CaseInsensitive ) == 0 )
+ {
+ return QgsLayerItem::LayerType::Polygon;
+ }
+ else if ( QString::compare( geometryType, QStringLiteral( "LineString" ), Qt::CaseInsensitive ) == 0 || QString::compare( geometryType, QStringLiteral( "MultiLineString" ), Qt::CaseInsensitive ) == 0 )
+ {
+ return QgsLayerItem::LayerType::Line;
+ }
+ // To be moved in a parent class that would also work for gdal and rasters
+ else if ( QString::compare( geometryType, QStringLiteral( "Raster" ), Qt::CaseInsensitive ) == 0 )
+ {
+ return QgsLayerItem::LayerType::Raster;
+ }
+ return QgsLayerItem::LayerType::NoType;
+}
+
+#ifdef HAVE_GUI
+QList QgsGeoPackageLayerItem::actions()
+{
+ QList lst;
+
+ QAction *actionDeleteLayer = new QAction( tr( "Delete Layer" ), this );
+ // TODO connect( actionDeleteLayer, &QAction::triggered, this, &QgsGeoPackageLayerItem::deleteLayer );
+ lst.append( actionDeleteLayer );
+
+ return lst;
+}
+#endif
+
+QgsGeoPackageLayerItem::QgsGeoPackageLayerItem( QgsDataItem *parent, QString name, QString path, QString uri, QgsLayerItem::LayerType layerType )
+ : QgsLayerItem( parent, name, path, uri, layerType, QStringLiteral( "ogr" ) )
+{
+ setState( Populated ); // no children are expected
+}
diff --git a/src/providers/ogr/qgsgeopackagedataitems.h b/src/providers/ogr/qgsgeopackagedataitems.h
new file mode 100644
index 00000000000..79761a65c61
--- /dev/null
+++ b/src/providers/ogr/qgsgeopackagedataitems.h
@@ -0,0 +1,106 @@
+/***************************************************************************
+ qgsgeopackagedataitems.h
+ ---------------------
+ begin : October 2011
+ copyright : (C) 2011 by Martin Dobias
+ email : wonder dot sk at gmail dot com
+ ***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#ifndef QGSGEOPACKAGEDATAITEMS_H
+#define QGSGEOPACKAGEDATAITEMS_H
+
+#include "qgsdataitem.h"
+#include "qgsdataitemprovider.h"
+#include "qgsdataprovider.h"
+
+class QgsGeoPackageLayerItem : public QgsLayerItem
+{
+ Q_OBJECT
+ public:
+ QgsGeoPackageLayerItem( QgsDataItem *parent, QString name, QString path, QString uri, LayerType layerType );
+
+#ifdef HAVE_GUI
+ QList actions() override;
+#endif
+
+ public slots:
+#ifdef HAVE_GUI
+ void deleteLayer();
+#endif
+};
+
+class QgsGeoPackageConnectionItem : public QgsDataCollectionItem
+{
+ Q_OBJECT
+ public:
+ QgsGeoPackageConnectionItem( QgsDataItem *parent, QString name, QString path );
+
+ QVector createChildren() override;
+ virtual bool equal( const QgsDataItem *other ) override;
+
+#ifdef HAVE_GUI
+ virtual QList actions() override;
+#endif
+
+ virtual bool acceptDrop() override { return true; }
+ //virtual bool handleDrop( const QMimeData *data, Qt::DropAction action ) override;
+
+ //! Return the layer type from \a geometryType
+ static QgsLayerItem::LayerType layerTypeFromDb( const QString &geometryType );
+
+ public slots:
+#ifdef HAVE_GUI
+ void editConnection();
+ void deleteConnection();
+
+#endif
+
+ protected:
+ QString mPath;
+};
+
+
+class QgsGeoPackageRootItem : public QgsDataCollectionItem
+{
+ Q_OBJECT
+ public:
+ QgsGeoPackageRootItem( QgsDataItem *parent, QString name, QString path );
+ ~QgsGeoPackageRootItem();
+
+ QVector createChildren() override;
+
+#ifdef HAVE_GUI
+ virtual QList actions() override;
+ virtual QWidget *paramWidget() override;
+#endif
+
+ public slots:
+#ifdef HAVE_GUI
+ void newConnection();
+ void connectionsChanged();
+#endif
+ void createDatabase();
+
+};
+
+
+//! Provider for geopackage root data item
+class QgsGeoPackageDataItemProvider : public QgsDataItemProvider
+{
+ public:
+ virtual QString name() override { return QStringLiteral( "GPKG" ); }
+
+ virtual int capabilities() override { return QgsDataProvider::Database; }
+
+ virtual QgsDataItem *createDataItem( const QString &path, QgsDataItem *parentItem ) override;
+};
+
+
+
+#endif // QGSGEOPACKAGEDATAITEMS_H
diff --git a/src/providers/ogr/qgsogrdataitems.cpp b/src/providers/ogr/qgsogrdataitems.cpp
index d137a45de6b..d0b87793ed5 100644
--- a/src/providers/ogr/qgsogrdataitems.cpp
+++ b/src/providers/ogr/qgsogrdataitems.cpp
@@ -21,6 +21,7 @@
#include
#include
+#include
#include
#include
diff --git a/src/providers/ogr/qgsogrdataitems.h b/src/providers/ogr/qgsogrdataitems.h
index 9475fc1c951..a81ff1ba58d 100644
--- a/src/providers/ogr/qgsogrdataitems.h
+++ b/src/providers/ogr/qgsogrdataitems.h
@@ -18,6 +18,7 @@
#include "qgsdataitem.h"
#include "qgsogrprovider.h"
+#include "qgsdataitemprovider.h"
class QgsOgrLayerItem : public QgsLayerItem
{
@@ -40,4 +41,5 @@ class QgsOgrDataCollectionItem : public QgsDataCollectionItem
QVector createChildren() override;
};
+
#endif // QGSOGRDATAITEMS_H
diff --git a/src/providers/ogr/qgsogrprovider.cpp b/src/providers/ogr/qgsogrprovider.cpp
index 17b5b22f4d0..5ae34902d22 100644
--- a/src/providers/ogr/qgsogrprovider.cpp
+++ b/src/providers/ogr/qgsogrprovider.cpp
@@ -30,6 +30,9 @@ email : sherman at mrcc.com
#include "qgsgeometry.h"
#include "qgscoordinatereferencesystem.h"
#include "qgsvectorlayerexporter.h"
+#include "qgsdataitemprovider.h"
+#include "qgsogrdataitems.h"
+#include "qgsgeopackagedataitems.h"
#include "qgswkbtypes.h"
#include "qgis.h"
@@ -2924,6 +2927,13 @@ QGISEXTERN bool createEmptyDataSource( const QString &uri,
return true;
}
+
+QGISEXTERN QList dataItemProviders()
+{
+ return QList()
+ << new QgsGeoPackageDataItemProvider;
+}
+
QgsCoordinateReferenceSystem QgsOgrProvider::crs() const
{
QgsDebugMsg( "Entering." );
diff --git a/src/providers/wms/qgswmsconnection.cpp b/src/providers/wms/qgswmsconnection.cpp
index b5959fa9e94..18c708f472e 100644
--- a/src/providers/wms/qgswmsconnection.cpp
+++ b/src/providers/wms/qgswmsconnection.cpp
@@ -27,14 +27,6 @@
#include "qgsnetworkaccessmanager.h"
#include "qgssettings.h"
-#include
-#include
-#include
-#include
-
-#include
-#include
-
QgsWMSConnection::QgsWMSConnection( const QString &connName )
: mConnName( connName )
{
diff --git a/src/providers/wms/qgswmsdataitems.cpp b/src/providers/wms/qgswmsdataitems.cpp
index d44c11150e8..9c16753300e 100644
--- a/src/providers/wms/qgswmsdataitems.cpp
+++ b/src/providers/wms/qgswmsdataitems.cpp
@@ -449,7 +449,7 @@ QGISEXTERN QgsWMSSourceSelect *selectWidget( QWidget *parent, Qt::WindowFlags fl
QgsDataItem *QgsWmsDataItemProvider::createDataItem( const QString &path, QgsDataItem *parentItem )
{
- QgsDebugMsg( "thePath = " + path );
+ QgsDebugMsg( "path = " + path );
if ( path.isEmpty() )
{
return new QgsWMSRootItem( parentItem, QStringLiteral( "WMS" ), QStringLiteral( "wms:" ) );