MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / validatePrimaryDebuggerViews

Method validatePrimaryDebuggerViews

pcsx2-qt/Debugger/Docking/DockLayout.cpp:831–858  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

829}
830
831void DockLayout::validatePrimaryDebuggerViews()
832{
833 std::map<std::string, std::vector<DebuggerView*>> type_to_widgets;
834 for (const auto& [unique_name, widget] : m_widgets)
835 type_to_widgets[widget->metaObject()->className()].emplace_back(widget.get());
836
837 for (auto& [type, widgets] : type_to_widgets)
838 {
839 u32 primary_widgets = 0;
840
841 // Make sure at most one widget is marked as primary.
842 for (DebuggerView* widget : widgets)
843 {
844 if (widget->isPrimary())
845 {
846 if (primary_widgets != 0)
847 widget->setPrimary(false);
848
849 primary_widgets++;
850 }
851 }
852
853 // If none of the widgets were marked as primary, just set the first one
854 // as the primary one.
855 if (primary_widgets == 0)
856 widgets[0]->setPrimary(true);
857 }
858}
859
860void DockLayout::setupDefaultLayout()
861{

Callers

nothing calls this directly

Calls 3

isPrimaryMethod · 0.80
setPrimaryMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected