mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:47:44 +00:00
LibDesktop: Add menu_name() to AppFile
This really just takes the [App].Name config value and removes the ampersands `&` from the name. These ampersands are hotkeys for the system menu. Instead of typing them twice - error prone - use the fact that name is just menu_name without the ampersand. Remove the ampersand to use as the name and use it as is as the menu_name.
This commit is contained in:
parent
f5dec55fd6
commit
6ab315ae69
3 changed files with 11 additions and 2 deletions
|
@ -69,6 +69,13 @@ bool AppFile::validate() const
|
|||
}
|
||||
|
||||
ByteString AppFile::name() const
|
||||
{
|
||||
auto name = m_config->read_entry("App", "Name").trim_whitespace().replace("&"sv, ""sv);
|
||||
VERIFY(!name.is_empty());
|
||||
return name;
|
||||
}
|
||||
|
||||
ByteString AppFile::menu_name() const
|
||||
{
|
||||
auto name = m_config->read_entry("App", "Name").trim_whitespace();
|
||||
VERIFY(!name.is_empty());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue