GUI: fix results if there is problem only in header and not in file0.

This commit is contained in:
Daniel Marjamäki 2016-09-18 21:32:53 +02:00
parent 2f39ed6f88
commit 997a3cd9ca
1 changed files with 4 additions and 4 deletions

View File

@ -493,18 +493,18 @@ void ResultsTree::RefreshTree()
QStandardItem *ResultsTree::EnsureFileItem(const QString &fullpath, const QString &file0, bool hide) QStandardItem *ResultsTree::EnsureFileItem(const QString &fullpath, const QString &file0, bool hide)
{ {
QString name = StripPath(fullpath, false); QString name0 = QDir::toNativeSeparators(StripPath(file0, false));
QString name = QDir::toNativeSeparators(StripPath(fullpath, false));
// Since item has path with native separators we must use path with // Since item has path with native separators we must use path with
// native separators to find it. // native separators to find it.
QStandardItem *item = FindFileItem(QDir::toNativeSeparators(name)); QStandardItem *item = FindFileItem(name0);
if (item) { if (item) {
return item; return item;
} }
// Ensure shown path is with native separators // Ensure shown path is with native separators
name = QDir::toNativeSeparators(name); item = CreateNormalItem(name0);
item = CreateNormalItem(name);
item->setIcon(QIcon(":images/text-x-generic.png")); item->setIcon(QIcon(":images/text-x-generic.png"));
//Add user data to that item //Add user data to that item