Commit 3affbed2 authored by Alessandro Portale's avatar Alessandro Portale
Browse files

Android: Fix parameters for the Ant script file dialog



Making sure that the file name field has "ant.bat" set, and
that the filtering really works.

This patch also ensures that native file separators are shown.

Task-Number: QTCREATORBUG-11628
Change-Id: Ibab8c145d0b832e5ad2e2ff62a81818e4044f13e
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 93e97432
...@@ -414,19 +414,19 @@ void AndroidSettingsWidget::browseNDKLocation() ...@@ -414,19 +414,19 @@ void AndroidSettingsWidget::browseNDKLocation()
void AndroidSettingsWidget::browseAntLocation() void AndroidSettingsWidget::browseAntLocation()
{ {
QString dir; QString dir;
QString antApp; QString filter;
if (Utils::HostOsInfo::isWindowsHost()) { if (Utils::HostOsInfo::isWindowsHost()) {
dir = QDir::homePath(); dir = QDir::homePath() + QLatin1String("/ant.bat");
antApp = QLatin1String("ant.bat"); filter = QLatin1String("ant (ant.bat)");
} else { } else {
dir = QLatin1String("/usr/bin/ant"); dir = QLatin1String("/usr/bin/ant");
antApp = QLatin1String("ant"); filter = QLatin1String("ant (ant)");
} }
const QString file = const QString file =
QFileDialog::getOpenFileName(this, tr("Select ant Script"), dir, antApp); QFileDialog::getOpenFileName(this, tr("Select ant Script"), dir, filter);
if (!file.length()) if (!file.length())
return; return;
m_ui->AntLocationLineEdit->setText(file); m_ui->AntLocationLineEdit->setText(QDir::toNativeSeparators(file));
antLocationEditingFinished(); antLocationEditingFinished();
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment