Locator on Linux/Mac: Show ~ instead of $HOME in paths.

With this, you will see more of the "relevant" path.

Change-Id: I03c4c7bd2bdaa9148c70a68678306e259f9c7204
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
Nikolai Kosjar
2012-08-24 15:00:44 +02:00
parent ce9b7bf123
commit 9483408fec
6 changed files with 36 additions and 6 deletions

View File

@@ -33,10 +33,12 @@
#include <texteditor/itexteditor.h>
#include <texteditor/basetexteditor.h>
#include <utils/fileutils.h>
#include <QStringMatcher>
using namespace CppTools::Internal;
using namespace Utils;
CppLocatorFilter::CppLocatorFilter(CppModelManager *manager)
: m_manager(manager),
@@ -103,10 +105,12 @@ QList<Locator::FilterEntry> CppLocatorFilter::matchesFor(QFutureInterface<Locato
QVariant id = qVariantFromValue(info);
Locator::FilterEntry filterEntry(this, info.symbolName, id, info.icon);
if (! info.symbolType.isEmpty())
if (! info.symbolType.isEmpty()) {
filterEntry.extraInfo = info.symbolType;
else
filterEntry.extraInfo = info.fileName;
} else {
filterEntry.extraInfo = FileUtils::shortNativePath(
FileName::fromString(info.fileName));
}
if (info.symbolName.startsWith(entry))
betterEntries.append(filterEntry);