Skip to content
Permalink
Browse files

Small refactoring to silence clang warnings plus changed name to GPKG…

… source select dialog provider

... to make it different than the other OGR s.s. dialog
  • Loading branch information
elpaso committed Oct 17, 2018
1 parent 7e3b5f4 commit f2c262bc99415bdc1538108f1a5a400c71ed72ec
Showing with 15 additions and 8 deletions.
  1. +15 −8 src/providers/ogr/qgsogrprovider.cpp
@@ -6323,10 +6323,7 @@ class QgsOgrVectorSourceSelectProvider : public QgsSourceSelectProvider
QString text() const override { return QObject::tr( "Vector" ); }
int ordering() const override { return QgsSourceSelectProvider::OrderLocalProvider + 10; }
QIcon icon() const override { return QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddOgrLayer.svg" ) ); }
QgsAbstractDataSourceWidget *createDataSourceWidget( QWidget *parent = nullptr, Qt::WindowFlags fl = Qt::Widget, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::Embedded ) const override
{
return new QgsOgrSourceSelect( parent, fl, widgetMode );
}
QgsAbstractDataSourceWidget *createDataSourceWidget( QWidget *parent = nullptr, Qt::WindowFlags fl = Qt::Widget, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::Embedded ) const override;
};


@@ -6335,14 +6332,12 @@ class QgsGeoPackageSourceSelectProvider : public QgsSourceSelectProvider
{
public:

virtual QString name() const override;
QString providerKey() const override { return QStringLiteral( "ogr" ); }
QString text() const override { return QObject::tr( "GeoPackage" ); }
int ordering() const override { return QgsSourceSelectProvider::OrderLocalProvider + 45; }
QIcon icon() const override { return QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddGeoPackageLayer.svg" ) ); }
QgsAbstractDataSourceWidget *createDataSourceWidget( QWidget *parent = nullptr, Qt::WindowFlags fl = Qt::Widget, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::Embedded ) const override
{
return new QgsOgrDbSourceSelect( QStringLiteral( "GPKG" ), QObject::tr( "GeoPackage" ), QObject::tr( "GeoPackage Database (*.gpkg)" ), parent, fl, widgetMode );
}
QgsAbstractDataSourceWidget *createDataSourceWidget( QWidget *parent = nullptr, Qt::WindowFlags fl = Qt::Widget, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::Embedded ) const override;
};


@@ -6395,3 +6390,15 @@ QGISEXTERN QgsTransaction *createTransaction( const QString &connString )

return new QgsOgrTransaction( connString, ds );
}

QString QgsGeoPackageSourceSelectProvider::name() const { return QStringLiteral( "GeoPackage" ); }

QgsAbstractDataSourceWidget *QgsGeoPackageSourceSelectProvider::createDataSourceWidget( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode ) const
{
return new QgsOgrDbSourceSelect( QStringLiteral( "GPKG" ), QObject::tr( "GeoPackage" ), QObject::tr( "GeoPackage Database (*.gpkg)" ), parent, fl, widgetMode );
}

QgsAbstractDataSourceWidget *QgsOgrVectorSourceSelectProvider::createDataSourceWidget( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode ) const
{
return new QgsOgrSourceSelect( parent, fl, widgetMode );
}

0 comments on commit f2c262b

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