# HG changeset patch # User Mike Miller # Date 1523335963 25200 # Node ID 8cc3213f788f2a93e9689cddf4c00ba85649a95d # Parent 09ddb785359ebf8bfe154681c7eba2ed14d0bc2a clean up variable editor method for style and compiler warnings (bug #53443) * variable-editor.cc (variable_editor::tab_to_front): Avoid C-style cast to silence compiler warning from -Wold-style-cast. Delete unnecessary braces and use correct indentation. diff -r 09ddb785359e -r 8cc3213f788f libgui/src/variable-editor.cc --- a/libgui/src/variable-editor.cc Mon Apr 09 17:51:39 2018 -0700 +++ b/libgui/src/variable-editor.cc Mon Apr 09 21:52:43 2018 -0700 @@ -1197,18 +1197,15 @@ if (parent () != nullptr) { QList barlist = main_win ()->findChildren (); + QVariant this_value (reinterpret_cast (this)); foreach (QTabBar *tbar, barlist) - { - for (int i=0; i < tbar->count (); i++) + for (int i = 0; i < tbar->count (); i++) + if (tbar->tabData (i) == this_value) { - if ((QWidget *) tbar->tabData (i).toULongLong () == this) - { - tbar->setCurrentIndex (i); - return; - } + tbar->setCurrentIndex (i); + return; } - } } }