Beautifier: Replace $HOME with it's actual value

Instead of having options texts like "Use file $HOME/abc", $HOME is
eliminated in favor of the actual value of QDir::home().

Change-Id: I9ffe27d73e54a9d30e1f0d4a277fbfbb7969ed45
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Lorenz Haas
2014-03-17 19:52:19 +01:00
committed by Orgad Shaneh
parent 6e6599e0b0
commit b8080429fc
4 changed files with 8 additions and 2 deletions

View File

@@ -51,6 +51,9 @@ ArtisticStyleOptionsPageWidget::ArtisticStyleOptionsPageWidget(ArtisticStyleSett
, m_settings(settings) , m_settings(settings)
{ {
ui->setupUi(this); ui->setupUi(this);
ui->useHomeFile->setText(ui->useHomeFile->text().replace(
QLatin1String("HOME"),
QDir::toNativeSeparators(QDir::home().absolutePath())));
ui->command->setExpectedKind(Utils::PathChooser::ExistingCommand); ui->command->setExpectedKind(Utils::PathChooser::ExistingCommand);
ui->command->setPromptDialogTitle(BeautifierPlugin::msgCommandPromptDialogTitle( ui->command->setPromptDialogTitle(BeautifierPlugin::msgCommandPromptDialogTitle(
QLatin1String(Constants::ArtisticStyle::DISPLAY_NAME))); QLatin1String(Constants::ArtisticStyle::DISPLAY_NAME)));

View File

@@ -49,7 +49,7 @@
<item> <item>
<widget class="QCheckBox" name="useHomeFile"> <widget class="QCheckBox" name="useHomeFile">
<property name="text"> <property name="text">
<string>Use $HOME/.astylerc or $HOME/astylerc</string> <string extracomment="HOME is replaced by the user's home directory">Use file .astylerc or astylerc in HOME</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@@ -51,6 +51,9 @@ UncrustifyOptionsPageWidget::UncrustifyOptionsPageWidget(UncrustifySettings *set
, m_settings(settings) , m_settings(settings)
{ {
ui->setupUi(this); ui->setupUi(this);
ui->useHomeFile->setText(ui->useHomeFile->text().replace(
QLatin1String("HOME"),
QDir::toNativeSeparators(QDir::home().absolutePath())));
ui->command->setExpectedKind(Utils::PathChooser::ExistingCommand); ui->command->setExpectedKind(Utils::PathChooser::ExistingCommand);
ui->command->setPromptDialogTitle(BeautifierPlugin::msgCommandPromptDialogTitle( ui->command->setPromptDialogTitle(BeautifierPlugin::msgCommandPromptDialogTitle(
QLatin1String(Constants::Uncrustify::DISPLAY_NAME))); QLatin1String(Constants::Uncrustify::DISPLAY_NAME)));

View File

@@ -49,7 +49,7 @@
<item> <item>
<widget class="QCheckBox" name="useHomeFile"> <widget class="QCheckBox" name="useHomeFile">
<property name="text"> <property name="text">
<string>Use $HOME/uncrustify.cfg</string> <string extracomment="HOME is replaced by the user's home directory">Use file uncrustify.cfg in HOME</string>
</property> </property>
</widget> </widget>
</item> </item>