# HG changeset patch # User John W. Eaton # Date 1572931523 18000 # Node ID d16336646e1819e044b2f5bcb047b85bf4e5a870 # Parent dc319e1ea4a3f842760be3c6b44073ff34fc061f return pointer to file_editor_tab from file_editor::find_tab_widget * file-editor.h, file-editor.cc (file_editor::find_tab_widget): Return pointer to file_editor_tab instead of QWidget. Change all uses. diff -r dc319e1ea4a3 -r d16336646e18 libgui/src/m-editor/file-editor.cc --- a/libgui/src/m-editor/file-editor.cc Tue Nov 05 00:14:14 2019 -0500 +++ b/libgui/src/m-editor/file-editor.cc Tue Nov 05 00:25:23 2019 -0500 @@ -922,7 +922,7 @@ bool remove_on_success) { // Check whether this file is already open in the editor. - QWidget *tab = find_tab_widget (saveFileName); + file_editor_tab *tab = find_tab_widget (saveFileName); if (tab) { @@ -990,7 +990,7 @@ if (! file.isEmpty ()) { // Check whether this file is already open in the editor. - QWidget *tab = find_tab_widget (file); + file_editor_tab *tab = find_tab_widget (file); if (tab) { @@ -1054,8 +1054,7 @@ else { // It is a single file. Is it open? - file_editor_tab *editor_tab - = static_cast (find_tab_widget (old_names.at (i))); + file_editor_tab *editor_tab = find_tab_widget (old_names.at (i)); if (editor_tab) { @@ -1409,7 +1408,7 @@ else { // Check whether this file is already open in the editor. - QWidget *tab = find_tab_widget (openFileName); + file_editor_tab *tab = find_tab_widget (openFileName); if (tab) { @@ -1447,7 +1446,7 @@ tab = find_tab_widget (""); if (tab) { - fileEditorTab = static_cast(tab); + fileEditorTab = tab; if (fileEditorTab->qsci_edit_area ()->isModified ()) fileEditorTab = nullptr; else @@ -2601,7 +2600,7 @@ } // Check whether this file is already open in the editor. - QWidget * file_editor::find_tab_widget (const QString& file) + file_editor_tab * file_editor::find_tab_widget (const QString& file) { std::string std_file = file.toStdString (); diff -r dc319e1ea4a3 -r d16336646e18 libgui/src/m-editor/file-editor.h --- a/libgui/src/m-editor/file-editor.h Tue Nov 05 00:14:14 2019 -0500 +++ b/libgui/src/m-editor/file-editor.h Tue Nov 05 00:25:23 2019 -0500 @@ -339,7 +339,7 @@ bool editor_tab_has_focus (void); - QWidget * find_tab_widget (const QString& openFileName); + file_editor_tab * find_tab_widget (const QString& openFileName); QAction * add_action (QMenu *menu, const QString& text, const char *member, QWidget *receiver = nullptr); QAction * add_action (QMenu *menu, const QIcon& icon, const QString& text,