Skip to content
Permalink
Browse files
Condense more code
  • Loading branch information
nyalldawson committed Jul 12, 2021
1 parent 218dded commit 86518bb9ee0a0969a41a776166a27a3eba5737b6
Showing with 3 additions and 11 deletions.
  1. +3 −7 src/app/qgisapp.cpp
  2. +0 −4 src/app/qgisapp.h
@@ -15742,14 +15742,9 @@ void QgisApp::renameView()
}
}

QgsRasterLayer *QgisApp::addRasterLayerPrivate( const QString &uri, const QString &name, const QString &providerKey, bool guiWarning )
{
return addLayerPrivate< QgsRasterLayer >( QgsMapLayerType::RasterLayer, uri, shortName, providerKey, guiWarning );
}

QgsRasterLayer *QgisApp::addRasterLayer( QString const &uri, QString const &baseName, QString const &providerKey )
{
return addRasterLayerPrivate( uri, baseName, providerKey, true );
return addLayerPrivate< QgsRasterLayer >( QgsMapLayerType::RasterLayer, uri, baseName, providerKey, true );
}

bool QgisApp::addRasterLayers( QStringList const &fileNameQStringList, bool guiWarning )
@@ -15797,7 +15792,8 @@ bool QgisApp::addRasterLayers( QStringList const &fileNameQStringList, bool guiW
}

// try to create the layer
QgsRasterLayer *layer = addRasterLayerPrivate( src, layerName, QString(), guiWarning );
QgsRasterLayer *layer = addLayerPrivate< QgsRasterLayer >( QgsMapLayerType::RasterLayer, src, layerName, QString(), guiWarning );

if ( layer && layer->isValid() )
{
//only allow one copy of a ai grid file to be loaded at a
@@ -2087,10 +2087,6 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow

QgsMapLayer *addSublayers( const QList< QgsProviderSublayerDetails> &layers, const QString &baseName, const QString &groupName );

//! Open a raster layer - this is the generic function which takes all parameters
QgsRasterLayer *addRasterLayerPrivate( const QString &uri, const QString &baseName,
const QString &providerKey, bool guiWarning );

void postProcessAddedLayer( QgsMapLayer *layer );

//! Open a vector tile layer - this is the generic function which takes all parameters

0 comments on commit 86518bb

Please sign in to comment.