Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions app/attributes/attributecontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,16 @@ void AttributeController::prefillRelationReferenceField()
const QList<QgsRelation::FieldPair> fieldPairs = mLinkedRelation.fieldPairs();
for ( const QgsRelation::FieldPair &fieldPair : fieldPairs )
{
QMap<QUuid, std::shared_ptr<FormItem>>::iterator formItemsIterator = mFormItems.begin();
while ( formItemsIterator != mFormItems.end() )
QVariant foreignKey = mParentController->featureLayerPair().feature().attribute( fieldPair.referencedField() );
QString referencingField = fieldPair.referencingField();
QgsVectorLayer *childLayer = mLinkedRelation.referencingLayer();
if ( childLayer )
{
std::shared_ptr<FormItem> itemData = formItemsIterator.value();
if ( itemData->field().name() == fieldPair.referencingField() )
int fieldIndex = childLayer->fields().lookupField( referencingField );
if ( fieldIndex != -1 )
{
QVariant fk = mParentController->featureLayerPair().feature().attribute( fieldPair.referencedField() );
setFormValue( itemData->id(), fk );
break;
mFeatureLayerPair.featureRef().setAttribute( fieldIndex, foreignKey );
}
++formItemsIterator;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/attributes/rememberattributescontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ bool RememberAttributesController::shouldRememberValue( const QgsVectorLayer *la
return from.attributeFilter.at( fieldIndex );
}

bool RememberAttributesController::setShouldRememberValue( const QgsVectorLayer *layer, int fieldIndex, bool shouldRemember )
bool RememberAttributesController::setShouldRememberValue( const QgsVectorLayer *layer, int fieldIndex, bool shouldRemember ) const
{
// global switch off of the functionality
if ( !mRememberValuesAllowed )
Expand Down
2 changes: 1 addition & 1 deletion app/attributes/rememberattributescontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class RememberAttributesController : public QObject
bool shouldRememberValue( const QgsVectorLayer *layer, int fieldIndex ) const;

// Returns whether value was changed
bool setShouldRememberValue( const QgsVectorLayer *layer, int fieldIndex, bool shouldRemember );
bool setShouldRememberValue( const QgsVectorLayer *layer, int fieldIndex, bool shouldRemember ) const;

signals:
void rememberValuesAllowedChanged();
Expand Down
2 changes: 1 addition & 1 deletion app/fieldsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ bool FieldsModel::setData( const QModelIndex &index, const QVariant &value, int
return false;
}

bool FieldsModel::contains( const QString &name )
bool FieldsModel::contains( const QString &name ) const
{
for ( int i = 0; i < mFields.count(); ++i )
{
Expand Down
2 changes: 1 addition & 1 deletion app/fieldsmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class FieldsModel: public QAbstractListModel
QList<FieldConfiguration> mFields;


bool contains( const QString &name );
bool contains( const QString &name ) const;
};

#endif // FIELDSMODEL_H
2 changes: 1 addition & 1 deletion core/credentialstore.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class CredentialStore : public QObject
const QString &password,
const QString &token,
const QDateTime &tokenExpiration,
int method = 0 );
int method = 0 ) const;

//! Reads authentication data from keychain and emits a signal with all auth values
void readAuthData();
Expand Down
2 changes: 1 addition & 1 deletion core/credentialstoreplaintext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void CredentialStore::writeAuthData
const QString &password,
const QString &token,
const QDateTime &tokenExpiration,
int method )
int method ) const
{
QSettings settings;
settings.beginGroup( KEYCHAIN_GROUP );
Expand Down
Loading