Reformat actions' UI: display a style's caption, not name
SourceFormatterStyle::name() is used as a KConfig key and never appears in the UI. The names of user-defined styles are particularly uninformative, e.g. "User4". SourceFormatterStyle::caption() is consistently shown in the UI everywhere else. Unfortunately, SourceFormatterController::styleForUrl() returns a SourceFormatterStyle with only the name filled-in for predefined styles. Retrieving the real caption of a predefined style requires moving CustomScriptPlugin::predefinedStyle() to the base formatter class - ISourceFormatter. Rename AStylePlugin's helper function predefinedStyle() => createPredefinedStyle(). The old name coincided with the name of base class ISourceFormatter's newly added member function. Make the renamed function static: not used outside of the file it is defined in.
parent
d8ab45cc
Please register or sign in to comment