forked from qt-creator/qt-creator
Beautifier: Fix usage of static function
Do not use derived method from base class by accident. Change-Id: Ic715d4ce92c50e001b4280234dcd6949862f192b Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -50,7 +50,7 @@ namespace Beautifier::Internal {
|
|||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
|
|
||||||
static QString displayName() { return Tr::tr("Artistic Style"); }
|
static QString asDisplayName() { return Tr::tr("Artistic Style"); }
|
||||||
|
|
||||||
const char SETTINGS_NAME[] = "artisticstyle";
|
const char SETTINGS_NAME[] = "artisticstyle";
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ public:
|
|||||||
setVersionRegExp(QRegularExpression("([2-9]{1})\\.([0-9]{1,2})(\\.[1-9]{1})?$"));
|
setVersionRegExp(QRegularExpression("([2-9]{1})\\.([0-9]{1,2})(\\.[1-9]{1})?$"));
|
||||||
command.setLabelText(Tr::tr("Artistic Style command:"));
|
command.setLabelText(Tr::tr("Artistic Style command:"));
|
||||||
command.setDefaultValue("astyle");
|
command.setDefaultValue("astyle");
|
||||||
command.setPromptDialogTitle(BeautifierTool::msgCommandPromptDialogTitle(displayName()));
|
command.setPromptDialogTitle(BeautifierTool::msgCommandPromptDialogTitle(asDisplayName()));
|
||||||
|
|
||||||
useOtherFiles.setSettingsKey("useOtherFiles");
|
useOtherFiles.setSettingsKey("useOtherFiles");
|
||||||
useOtherFiles.setLabelText(Tr::tr("Use file *.astylerc defined in project files"));
|
useOtherFiles.setLabelText(Tr::tr("Use file *.astylerc defined in project files"));
|
||||||
@@ -238,7 +238,7 @@ public:
|
|||||||
ArtisticStyleOptionsPage()
|
ArtisticStyleOptionsPage()
|
||||||
{
|
{
|
||||||
setId("ArtisticStyle");
|
setId("ArtisticStyle");
|
||||||
setDisplayName(displayName());
|
setDisplayName(asDisplayName());
|
||||||
setCategory(Constants::OPTION_CATEGORY);
|
setCategory(Constants::OPTION_CATEGORY);
|
||||||
setWidgetCreator([] { return new ArtisticStyleOptionsPageWidget; });
|
setWidgetCreator([] { return new ArtisticStyleOptionsPageWidget; });
|
||||||
}
|
}
|
||||||
@@ -278,7 +278,7 @@ void ArtisticStyle::formatFile()
|
|||||||
{
|
{
|
||||||
const QString cfgFileName = configurationFile();
|
const QString cfgFileName = configurationFile();
|
||||||
if (cfgFileName.isEmpty())
|
if (cfgFileName.isEmpty())
|
||||||
showError(msgCannotGetConfigurationFile(displayName()));
|
showError(BeautifierTool::msgCannotGetConfigurationFile(asDisplayName()));
|
||||||
else
|
else
|
||||||
formatCurrentFile(command(cfgFileName));
|
formatCurrentFile(command(cfgFileName));
|
||||||
}
|
}
|
||||||
|
@@ -51,7 +51,7 @@ namespace Beautifier::Internal {
|
|||||||
|
|
||||||
const char SETTINGS_NAME[] = "uncrustify";
|
const char SETTINGS_NAME[] = "uncrustify";
|
||||||
|
|
||||||
static QString displayName() { return Tr::tr("Uncrustify"); }
|
static QString uDisplayName() { return Tr::tr("Uncrustify"); }
|
||||||
|
|
||||||
class UncrustifySettings : public AbstractSettings
|
class UncrustifySettings : public AbstractSettings
|
||||||
{
|
{
|
||||||
@@ -63,7 +63,7 @@ public:
|
|||||||
|
|
||||||
command.setDefaultValue("uncrustify");
|
command.setDefaultValue("uncrustify");
|
||||||
command.setLabelText(Tr::tr("Uncrustify command:"));
|
command.setLabelText(Tr::tr("Uncrustify command:"));
|
||||||
command.setPromptDialogTitle(BeautifierTool::msgCommandPromptDialogTitle(displayName()));
|
command.setPromptDialogTitle(BeautifierTool::msgCommandPromptDialogTitle(uDisplayName()));
|
||||||
|
|
||||||
useOtherFiles.setSettingsKey("useOtherFiles");
|
useOtherFiles.setSettingsKey("useOtherFiles");
|
||||||
useOtherFiles.setDefaultValue(true);
|
useOtherFiles.setDefaultValue(true);
|
||||||
@@ -233,7 +233,7 @@ public:
|
|||||||
UncrustifyOptionsPage()
|
UncrustifyOptionsPage()
|
||||||
{
|
{
|
||||||
setId("Uncrustify");
|
setId("Uncrustify");
|
||||||
setDisplayName(Tr::tr("Uncrustify"));
|
setDisplayName(uDisplayName());
|
||||||
setCategory(Constants::OPTION_CATEGORY);
|
setCategory(Constants::OPTION_CATEGORY);
|
||||||
setWidgetCreator([] { return new UncrustifyOptionsPageWidget; });
|
setWidgetCreator([] { return new UncrustifyOptionsPageWidget; });
|
||||||
}
|
}
|
||||||
@@ -282,7 +282,7 @@ void Uncrustify::formatFile()
|
|||||||
{
|
{
|
||||||
const FilePath cfgFileName = configurationFile();
|
const FilePath cfgFileName = configurationFile();
|
||||||
if (cfgFileName.isEmpty())
|
if (cfgFileName.isEmpty())
|
||||||
showError(msgCannotGetConfigurationFile(displayName()));
|
showError(msgCannotGetConfigurationFile(uDisplayName()));
|
||||||
else
|
else
|
||||||
formatCurrentFile(command(cfgFileName));
|
formatCurrentFile(command(cfgFileName));
|
||||||
}
|
}
|
||||||
@@ -291,7 +291,7 @@ void Uncrustify::formatSelectedText()
|
|||||||
{
|
{
|
||||||
const FilePath cfgFileName = configurationFile();
|
const FilePath cfgFileName = configurationFile();
|
||||||
if (cfgFileName.isEmpty()) {
|
if (cfgFileName.isEmpty()) {
|
||||||
showError(msgCannotGetConfigurationFile(displayName()));
|
showError(msgCannotGetConfigurationFile(uDisplayName()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user