Allow for ampersand characters in configuration names

Ampersand characters  have special significance in  action names, they
indicate the following character is an accelerator. This change allows
single   ampersand  characters   but   filters  them   out  from   the
MultiSettings::configuration_name_changed  signal.  Double  ampersands
may be used to escape a single ampersand.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7338 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville 2016-11-27 01:34:35 +00:00
parent 869d62aae1
commit c9fb8ab89f
2 changed files with 2 additions and 2 deletions

View File

@ -408,7 +408,7 @@ void MultiSettings::impl::create_menu_actions (QMainWindow * main_window, QMenu
if (name_change_emit_pending_)
{
Q_EMIT parent_->configurationNameChanged (current_);
Q_EMIT parent_->configurationNameChanged (current_.replace (QRegularExpression {R"(&([^&]))"}, R"(\1)").replace ("&&", "&"));
name_change_emit_pending_ = false;
}
}

View File

@ -91,7 +91,7 @@ public:
bool exit ();
// emitted when the name of the current configuration changes
Q_SIGNAL void configurationNameChanged (QString const& name) const;
Q_SIGNAL void configurationNameChanged (QString name) const;
private:
class impl;