Auxiliary storage can be used on non spatial layer

This commit is contained in:
Blottiere Paul 2017-09-05 09:19:18 +01:00
parent 94fde118a5
commit b6752df628
4 changed files with 5 additions and 7 deletions

View File

@ -1545,8 +1545,6 @@ void QgsVectorLayerProperties::updateAuxiliaryStoragePage( bool reset )
mAuxiliaryLayerActionClear->setEnabled( false );
mAuxiliaryLayerActionDelete->setEnabled( false );
mAuxiliaryLayerActionExport->setEnabled( false );
if ( mLayer->isSpatial() )
mAuxiliaryLayerActionNew->setEnabled( true );
mAuxiliaryStorageFieldsTree->clear();
@ -1565,7 +1563,7 @@ void QgsVectorLayerProperties::onAuxiliaryLayerNew()
{
QgsAuxiliaryLayer *alayer = mLayer->auxiliaryLayer();
if ( alayer || !mLayer->isSpatial() )
if ( alayer )
return;
QgsNewAuxiliaryLayerDialog dlg( mLayer, this );

View File

@ -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() );

View File

@ -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() );
}

View File

@ -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;