Skip to content

Commit b34cf3b

Browse files
committed
Infrastructure: remove dead messages from dlgTriggerEditor class
#### Brief overview of PR changes/additions As spotted by Greptile in #9274 (comment) and also by myself, this removes some messages that are created but never used. As it happens some of them also remark about a quantity of items to delete but instead of using the `%n` parameter to enable the translation to be correctly pluralised they merely insert that value as a normal `%1` parameter to be replaced by the number! #### Motivation for adding to Mudlet Correcting something that Greptile spotted and removing cruft from a class. #### Other info (issues closed, discussion etc) This should produce no detectable changes to the operation of Mudlet. Greptile should be prompted to re-review #9274 after this PR is merged! Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
1 parent f8f51c5 commit b34cf3b

1 file changed

Lines changed: 0 additions & 56 deletions

File tree

src/dlgTriggerEditor.cpp

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -2932,14 +2932,6 @@ void dlgTriggerEditor::delete_alias()
29322932
return;
29332933
}
29342934

2935-
// Show confirmation dialog for multiple items
2936-
QString message;
2937-
if (aliasesToDelete.size() == 1) {
2938-
message = tr("Do you really want to delete alias \"%1\"?").arg(itemNames.first());
2939-
} else {
2940-
message = tr("Do you really want to delete %1 aliases?\n\nItems to be deleted:\n%2").arg(aliasesToDelete.size()).arg(itemNames.join(", "));
2941-
}
2942-
29432935
// Capture state of all items BEFORE deletion for undo
29442936
QList<EditorDeleteItemCommand::DeletedItemInfo> deletedItems;
29452937

@@ -3102,14 +3094,6 @@ void dlgTriggerEditor::delete_action()
31023094
return;
31033095
}
31043096

3105-
// Show confirmation dialog for multiple items
3106-
QString message;
3107-
if (actionsToDelete.size() == 1) {
3108-
message = tr("Do you really want to delete button \"%1\"?").arg(itemNames.first());
3109-
} else {
3110-
message = tr("Do you really want to delete %1 buttons?\n\nItems to be deleted:\n%2").arg(actionsToDelete.size()).arg(itemNames.join(", "));
3111-
}
3112-
31133097
// Capture state of all items BEFORE deletion for undo
31143098
QList<EditorDeleteItemCommand::DeletedItemInfo> deletedItems;
31153099

@@ -3253,14 +3237,6 @@ void dlgTriggerEditor::delete_variable()
32533237
return;
32543238
}
32553239

3256-
// Show confirmation dialog for multiple items
3257-
QString message;
3258-
if (varsToDelete.size() == 1) {
3259-
message = tr("Do you really want to delete variable \"%1\"?").arg(itemNames.first());
3260-
} else {
3261-
message = tr("Do you really want to delete %1 variables?\n\nItems to be deleted:\n%2").arg(varsToDelete.size()).arg(itemNames.join(", "));
3262-
}
3263-
32643240
// Sort items by their position in tree (top to bottom) to delete correctly
32653241
std::sort(selectedItems.begin(), selectedItems.end(), [this](QTreeWidgetItem* a, QTreeWidgetItem* b) {
32663242
QModelIndex indexA = treeWidget_variables->indexFromItem(a);
@@ -3327,14 +3303,6 @@ void dlgTriggerEditor::delete_script()
33273303
return;
33283304
}
33293305

3330-
// Show confirmation dialog for multiple items
3331-
QString message;
3332-
if (scriptsToDelete.size() == 1) {
3333-
message = tr("Do you really want to delete script \"%1\"?").arg(itemNames.first());
3334-
} else {
3335-
message = tr("Do you really want to delete %1 scripts?\n\nItems to be deleted:\n%2").arg(scriptsToDelete.size()).arg(itemNames.join(", "));
3336-
}
3337-
33383306
// Capture state of all items BEFORE deletion for undo
33393307
QList<EditorDeleteItemCommand::DeletedItemInfo> deletedItems;
33403308

@@ -3469,14 +3437,6 @@ void dlgTriggerEditor::delete_key()
34693437
return;
34703438
}
34713439

3472-
// Show confirmation dialog for multiple items
3473-
QString message;
3474-
if (keysToDelete.size() == 1) {
3475-
message = tr("Do you really want to delete key \"%1\"?").arg(itemNames.first());
3476-
} else {
3477-
message = tr("Do you really want to delete %1 keys?\n\nItems to be deleted:\n%2").arg(keysToDelete.size()).arg(itemNames.join(", "));
3478-
}
3479-
34803440
// Capture state of all items BEFORE deletion for undo
34813441
QList<EditorDeleteItemCommand::DeletedItemInfo> deletedItems;
34823442

@@ -3611,14 +3571,6 @@ void dlgTriggerEditor::delete_trigger()
36113571
return;
36123572
}
36133573

3614-
// Show confirmation dialog for multiple items
3615-
QString message;
3616-
if (triggersToDelete.size() == 1) {
3617-
message = tr("Do you really want to delete trigger \"%1\"?").arg(itemNames.first());
3618-
} else {
3619-
message = tr("Do you really want to delete %1 triggers?\n\nItems to be deleted:\n%2").arg(triggersToDelete.size()).arg(itemNames.join(", "));
3620-
}
3621-
36223574
// Capture state of all items BEFORE deletion for undo
36233575
QList<EditorDeleteItemCommand::DeletedItemInfo> deletedItems;
36243576

@@ -3758,14 +3710,6 @@ void dlgTriggerEditor::delete_timer()
37583710
return;
37593711
}
37603712

3761-
// Show confirmation dialog for multiple items
3762-
QString message;
3763-
if (timersToDelete.size() == 1) {
3764-
message = tr("Do you really want to delete timer \"%1\"?").arg(itemNames.first());
3765-
} else {
3766-
message = tr("Do you really want to delete %1 timers?\n\nItems to be deleted:\n%2").arg(timersToDelete.size()).arg(itemNames.join(", "));
3767-
}
3768-
37693713
// Capture state of all items BEFORE deletion for undo
37703714
QList<EditorDeleteItemCommand::DeletedItemInfo> deletedItems;
37713715

0 commit comments

Comments
 (0)