File tree 1 file changed +7
-8
lines changed
1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -1327,10 +1327,13 @@ void QgsStyleV2ManagerDialog::listitemsContextMenu( const QPoint& point )
1327
1327
// Clear all actions and create new actions for every group
1328
1328
mGroupListMenu ->clear ();
1329
1329
1330
- QStringList groups = mStyle ->groupNames ();
1331
- Q_FOREACH ( const QString& group, groups )
1330
+ QAction* a;
1331
+ QList<int > groupIds = mStyle ->groupIds ();
1332
+ Q_FOREACH ( int groupId, groupIds )
1332
1333
{
1333
- mGroupListMenu ->addAction ( new QAction ( group, mGroupListMenu ) );
1334
+ a = new QAction ( mStyle ->groupName ( groupId ), mGroupListMenu );
1335
+ a->setData ( groupId );
1336
+ mGroupListMenu ->addAction ( a );
1334
1337
}
1335
1338
1336
1339
QAction* selectedItem = mGroupMenu ->exec ( globalPos );
@@ -1343,11 +1346,7 @@ void QgsStyleV2ManagerDialog::listitemsContextMenu( const QPoint& point )
1343
1346
QgsDebugMsg ( " unknow entity type" );
1344
1347
return ;
1345
1348
}
1346
- int groupId = 0 ;
1347
- if ( selectedItem->text () != tr ( " Un-group" ) )
1348
- {
1349
- groupId = mStyle ->groupId ( selectedItem->text () );
1350
- }
1349
+ int groupId = selectedItem->data ().toInt ();
1351
1350
QModelIndexList indexes = listItems->selectionModel ()->selectedIndexes ();
1352
1351
Q_FOREACH ( const QModelIndex& index , indexes )
1353
1352
{
You can’t perform that action at this time.
0 commit comments