Commit a4570dec authored by Eike Ziller's avatar Eike Ziller
Browse files

Fix displayed file name when searching directory ending with '/'.

Task-number: QTCREATORBUG-6119

Change-Id: I894da0f77e484fe0785ece8039f46233e05c5c91
Reviewed-on: http://codereview.qt-project.org/5063

Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarRobert Löhning <robert.loehning@nokia.com>
parent d52d4ccd
......@@ -124,6 +124,7 @@ QString AllProjectsFind::label() const
QString AllProjectsFind::toolTip() const
{
// %2 is filled by BaseFileFind::runNewSearch
return tr("Filter: %1\n%2").arg(fileNameFilters().join(QLatin1String(",")));
}
......
......@@ -84,6 +84,7 @@ QString FindInCurrentFile::label() const
QString FindInCurrentFile::toolTip() const
{
// %2 is filled by BaseFileFind::runNewSearch
return tr("File path: %1\n%2").arg(QDir::toNativeSeparators(m_currentFile->fileName()));
}
......
......@@ -70,19 +70,24 @@ void FindInFiles::findAll(const QString &txt, Find::FindFlags findFlags)
Utils::FileIterator *FindInFiles::files() const
{
return new Utils::SubDirFileIterator(QStringList() << m_directory->currentText(),
return new Utils::SubDirFileIterator(QStringList() << QDir::fromNativeSeparators(m_directory->currentText()),
fileNameFilters(),
Core::EditorManager::instance()->defaultTextCodec());
}
QString FindInFiles::label() const
{
return tr("Directory '%1':").arg(QFileInfo(m_directory->currentText()).fileName());
const QStringList &nonEmptyComponents = QDir::cleanPath(
QFileInfo(QDir::fromNativeSeparators(m_directory->currentText())).absoluteFilePath())
.split(QLatin1Char('/'), QString::SkipEmptyParts);
return tr("Directory '%1':").arg(nonEmptyComponents.isEmpty() ? "/" : nonEmptyComponents.last());
}
QString FindInFiles::toolTip() const
{
return tr("Path: %1\nFilter: %2\n%3").arg(QFileInfo(m_directory->currentText()).absoluteFilePath())
// %3 is filled by BaseFileFind::runNewSearch
return tr("Path: %1\nFilter: %2\n%3")
.arg(QDir::toNativeSeparators(QFileInfo(m_directory->currentText()).absoluteFilePath()))
.arg(fileNameFilters().join(QLatin1String(",")));
}
......
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