Cleanup: UI_alert, pass const references to strings

This commit is contained in:
Campbell Barton
2025-09-06 14:22:49 +10:00
parent c69ef385fc
commit 5dd70079ad
2 changed files with 10 additions and 2 deletions

View File

@@ -296,4 +296,8 @@ blender::ui::AbstractTreeView *UI_block_add_view(
blender::StringRef idname,
std::unique_ptr<blender::ui::AbstractTreeView> tree_view);
void UI_alert(bContext *C, std::string title, std::string message, eAlertIcon icon, bool compact);
void UI_alert(bContext *C,
const std::string &title,
const std::string &message,
eAlertIcon icon,
bool compact);

View File

@@ -1123,7 +1123,11 @@ static uiBlock *ui_alert_create(bContext *C, ARegion *region, void *user_data)
return block;
}
void UI_alert(bContext *C, std::string title, std::string message, eAlertIcon icon, bool compact)
void UI_alert(bContext *C,
const std::string &title,
const std::string &message,
const eAlertIcon icon,
const bool compact)
{
uiAlertData *data = MEM_new<uiAlertData>(__func__);
data->title = title;