Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Auxiliary storage can be used on non spatial layer
  • Loading branch information
pblottiere committed Oct 9, 2017
1 parent 94fde11 commit b6752df
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions src/app/qgsvectorlayerproperties.cpp
Expand Up @@ -1545,9 +1545,7 @@ void QgsVectorLayerProperties::updateAuxiliaryStoragePage( bool reset )
mAuxiliaryLayerActionClear->setEnabled( false );
mAuxiliaryLayerActionDelete->setEnabled( false );
mAuxiliaryLayerActionExport->setEnabled( false );

if ( mLayer->isSpatial() )
mAuxiliaryLayerActionNew->setEnabled( true );
mAuxiliaryLayerActionNew->setEnabled( true );

mAuxiliaryStorageFieldsTree->clear();
mAuxiliaryStorageKeyLineEdit->setText( QString() );
Expand All @@ -1565,7 +1563,7 @@ void QgsVectorLayerProperties::onAuxiliaryLayerNew()
{
QgsAuxiliaryLayer *alayer = mLayer->auxiliaryLayer();

if ( alayer || !mLayer->isSpatial() )
if ( alayer )
return;

QgsNewAuxiliaryLayerDialog dlg( mLayer, this );
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsauxiliarystorage.cpp
Expand Up @@ -480,7 +480,7 @@ QgsAuxiliaryLayer *QgsAuxiliaryStorage::createAuxiliaryLayer( const QgsField &fi
{
QgsAuxiliaryLayer *alayer = nullptr;

if ( mValid && layer && layer->isSpatial() )
if ( mValid && layer )
{
const QString table( layer->id() );
sqlite3 *handler = openDB( currentFileName() );
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsproject.cpp
Expand Up @@ -2252,7 +2252,7 @@ QList<QgsMapLayer *> QgsProject::addMapLayers(
continue;

QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( mlayer );
if ( vl && vl->isSpatial() )
if ( vl )
{
vl->loadAuxiliaryLayer( *mAuxiliaryStorage.get() );
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayer.cpp
Expand Up @@ -4273,7 +4273,7 @@ bool QgsVectorLayer::loadAuxiliaryLayer( const QgsAuxiliaryStorage &storage )
{
bool rc = false;

if ( isSpatial() && storage.isValid() && !mAuxiliaryLayerKey.isEmpty() )
if ( storage.isValid() && !mAuxiliaryLayerKey.isEmpty() )
{
QgsAuxiliaryLayer *alayer = nullptr;

Expand Down

0 comments on commit b6752df

Please sign in to comment.