Skip to content

Commit d12c41f

Browse files
committedJan 3, 2017
Don't add default actions multiple times
Fix #16013
1 parent 9fd65a2 commit d12c41f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎src/app/qgsattributeactiondialog.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ void QgsAttributeActionDialog::insertRow( int row, const QgsAction& action )
150150

151151
void QgsAttributeActionDialog::insertRow( int row, QgsAction::ActionType type, const QString& name, const QString& actionText, const QString& iconPath, bool capture, const QString& shortTitle, const QSet<QString>& actionScopes )
152152
{
153-
insertRow( row, QgsAction( type, name, actionText, iconPath, capture, shortTitle, actionScopes ) );
153+
if ( uniqueName( name ) == name )
154+
insertRow( row, QgsAction( type, name, actionText, iconPath, capture, shortTitle, actionScopes ) );
154155
}
155156

156157
void QgsAttributeActionDialog::moveUp()
@@ -356,7 +357,7 @@ QString QgsAttributeActionDialog::uniqueName( QString name )
356357

357358
for ( int i = 0; i < pos; ++i )
358359
{
359-
if ( mAttributeActionTable->item( i, 0 )->text() == name )
360+
if ( mAttributeActionTable->item( i, Description )->text() == name )
360361
unique = false;
361362
}
362363

0 commit comments

Comments
 (0)