Skip to content

Commit

Permalink
Add cacheSize as a QSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Dec 13, 2017
1 parent 5d52066 commit fd7fc94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/app/qgsoptions.cpp
Expand Up @@ -928,7 +928,8 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl )
mVariableEditor->reloadContext();
mVariableEditor->setEditableScopeIndex( 0 );


const QString key = "/QgsRelationReferenceWidget/cacheSize";
mSettings->setValue( key, mSettings->value( key, 200000 ) );

mAdvancedSettingsEditor->setSettingsObject( mSettings );

Expand Down
3 changes: 2 additions & 1 deletion src/gui/editorwidgets/qgsrelationreferencewidget.cpp
Expand Up @@ -479,7 +479,8 @@ void QgsRelationReferenceWidget::init()

QSet<QString> requestedAttrs;

QgsVectorLayerCache* layerCache = new QgsVectorLayerCache( mReferencedLayer, 200000, this );
const int cacheSize = QSettings().value( "/QgsRelationReferenceWidget/cacheSize" ).toInt();
QgsVectorLayerCache* layerCache = new QgsVectorLayerCache( mReferencedLayer, cacheSize, this );

if ( !mFilterFields.isEmpty() )
{
Expand Down

0 comments on commit fd7fc94

Please sign in to comment.