Two separators collapse into one

It seems guaranteed by the Qt docs that two menu separators collapse into
one. This allows this little simplification.
This commit is contained in:
Guillaume Munch 2017-01-11 21:03:47 +01:00
parent fd14b6f5a3
commit bd1ce03b40

View File

@ -1786,7 +1786,6 @@ void MenuDefinition::expandQuotes(BufferView const * bv)
add(MenuItem(MenuItem::Separator)); add(MenuItem(MenuItem::Separator));
bool have_section = false;
bool display_static = false; bool display_static = false;
// ... then potentially items to reset to the defaults and to dynamic style ... // ... then potentially items to reset to the defaults and to dynamic style ...
if (!main_dynamic_qs && globalqsc != 'x') { if (!main_dynamic_qs && globalqsc != 'x') {
@ -1794,7 +1793,6 @@ void MenuDefinition::expandQuotes(BufferView const * bv)
docstring const desc = bformat(_("Use dynamic quotes (%1$s)|d"), docstring const desc = bformat(_("Use dynamic quotes (%1$s)|d"),
quoteparams.getGuiLabel(globalqs)); quoteparams.getGuiLabel(globalqs));
add(MenuItem(MenuItem::Command, toqstr(desc), cmd)); add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
have_section = true;
display_static = true; display_static = true;
} }
if (!main_global_qs && langdefqs != globalqs) { if (!main_global_qs && langdefqs != globalqs) {
@ -1803,7 +1801,6 @@ void MenuDefinition::expandQuotes(BufferView const * bv)
docstring const desc = bformat(_("Reset to document default (%1$s, %2$s)|o"), docstring const desc = bformat(_("Reset to document default (%1$s, %2$s)|o"),
quoteparams.getGuiLabel(globalqs), variant); quoteparams.getGuiLabel(globalqs), variant);
add(MenuItem(MenuItem::Command, toqstr(desc), cmd)); add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
have_section = true;
} }
if (!main_langdef_qs) { if (!main_langdef_qs) {
FuncRequest cmd = FuncRequest(LFUN_INSET_MODIFY, subcmd + globalqsc + wildcards); FuncRequest cmd = FuncRequest(LFUN_INSET_MODIFY, subcmd + globalqsc + wildcards);
@ -1813,10 +1810,8 @@ void MenuDefinition::expandQuotes(BufferView const * bv)
: bformat(_("Reset to language default (%1$s)|l"), : bformat(_("Reset to language default (%1$s)|l"),
quoteparams.getGuiLabel(langdefqs)); quoteparams.getGuiLabel(langdefqs));
add(MenuItem(MenuItem::Command, toqstr(desc), cmd)); add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
have_section = true;
} }
if (have_section)
add(MenuItem(MenuItem::Separator)); add(MenuItem(MenuItem::Separator));
// ... and a subitem with the rest // ... and a subitem with the rest