From c89b7596ec78a09f0ffbbcfd392a9403afaac1a3 Mon Sep 17 00:00:00 2001 From: "Ignacio R. Morelle" Date: Tue, 20 Sep 2016 22:47:22 -0300 Subject: [PATCH] gui2/tfile_dialog: Avoid redundant grid pointer retrieval --- src/gui/dialogs/file_dialog.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gui/dialogs/file_dialog.cpp b/src/gui/dialogs/file_dialog.cpp index 634bc5175959..07aa6980b649 100644 --- a/src/gui/dialogs/file_dialog.cpp +++ b/src/gui/dialogs/file_dialog.cpp @@ -425,18 +425,16 @@ void tfile_dialog::push_fileview_row(tlistbox& filelist, const std::string& name std::map data; data["icon"]["label"] = icon; data["file"]["label"] = label; - filelist.add_row(data); + tgrid& last_grid = filelist.add_row(data); const unsigned last_pos = filelist.get_item_count() - 1; - tgrid* const last_grid = filelist.get_row_grid(last_pos); - assert(last_grid); // // Crummy hack around the lack of an option to hook into row double click // events for all rows using the GUI2 listbox API. Assign a special retval to // each row that triggers a special check during dialog exit. // - find_widget(last_grid, "item_panel", false) + find_widget(&last_grid, "item_panel", false) .set_retval(FILE_DIALOG_ITEM_RETVAL); if(check_selection && name == current_entry_) {