forked from qt-creator/qt-creator
Utils: Remove some unused SavedAction members
Looks like the orginal users in the debugger views context menus prefer to create their entries on the fly nowadays. Change-Id: Ice3ba358b0d746e03e64c3c8b872c69c18bcaba3 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -173,16 +173,6 @@ void SavedAction::setSettingsGroup(const QString &group)
|
||||
m_settingsGroup = group;
|
||||
}
|
||||
|
||||
QString SavedAction::textPattern() const
|
||||
{
|
||||
return m_textPattern;
|
||||
}
|
||||
|
||||
void SavedAction::setTextPattern(const QString &value)
|
||||
{
|
||||
m_textPattern = value;
|
||||
}
|
||||
|
||||
QString SavedAction::toString() const
|
||||
{
|
||||
return QLatin1String("value: ") + m_value.toString()
|
||||
@@ -191,40 +181,6 @@ QString SavedAction::toString() const
|
||||
+ QLatin1Char('/') + m_settingsKey;
|
||||
}
|
||||
|
||||
/*!
|
||||
Adjust the \c text() of the underlying action.
|
||||
|
||||
This can be used to update the item shortly before e.g. a menu is shown.
|
||||
|
||||
If the item's \c textPattern() is empty the \a text will be used
|
||||
verbatim.
|
||||
|
||||
Otherwise, the behaviour depends on \a text: if it is non-empty,
|
||||
\c QString(textPattern()).arg(text), otherwise, \c textPattern()
|
||||
with the "%1" placeholder removed will be used.
|
||||
|
||||
\sa textPattern(), setTextPattern()
|
||||
*/
|
||||
QAction *SavedAction::updatedAction(const QString &text0)
|
||||
{
|
||||
QString text = text0;
|
||||
bool enabled = true;
|
||||
if (!m_textPattern.isEmpty()) {
|
||||
if (text.isEmpty()) {
|
||||
text = m_textPattern;
|
||||
text.remove(QLatin1String("\"%1\""));
|
||||
text.remove(QLatin1String("%1"));
|
||||
enabled = false;
|
||||
} else {
|
||||
text = m_textPattern.arg(text0);
|
||||
}
|
||||
}
|
||||
this->setEnabled(enabled);
|
||||
this->setData(text0);
|
||||
this->setText(text);
|
||||
return this;
|
||||
}
|
||||
|
||||
/*
|
||||
Uses \c settingsGroup() and \c settingsKey() to restore the
|
||||
item from \a settings,
|
||||
|
||||
Reference in New Issue
Block a user