From d12c41f23240f488202b83ffda3bbb94f5c4311b Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Tue, 3 Jan 2017 19:37:07 +0100 Subject: [PATCH] Don't add default actions multiple times Fix #16013 --- src/app/qgsattributeactiondialog.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/qgsattributeactiondialog.cpp b/src/app/qgsattributeactiondialog.cpp index 43bc8343507..a15360c5bad 100644 --- a/src/app/qgsattributeactiondialog.cpp +++ b/src/app/qgsattributeactiondialog.cpp @@ -150,7 +150,8 @@ void QgsAttributeActionDialog::insertRow( int row, const QgsAction& action ) void QgsAttributeActionDialog::insertRow( int row, QgsAction::ActionType type, const QString& name, const QString& actionText, const QString& iconPath, bool capture, const QString& shortTitle, const QSet& actionScopes ) { - insertRow( row, QgsAction( type, name, actionText, iconPath, capture, shortTitle, actionScopes ) ); + if ( uniqueName( name ) == name ) + insertRow( row, QgsAction( type, name, actionText, iconPath, capture, shortTitle, actionScopes ) ); } void QgsAttributeActionDialog::moveUp() @@ -356,7 +357,7 @@ QString QgsAttributeActionDialog::uniqueName( QString name ) for ( int i = 0; i < pos; ++i ) { - if ( mAttributeActionTable->item( i, 0 )->text() == name ) + if ( mAttributeActionTable->item( i, Description )->text() == name ) unique = false; }