VCS: Fix diff viewer for paths with spaces

Task-number: QTCREATORBUG-8330
Change-Id: I25c8f7172f38716ab625705c4969a7685d373e4e
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Tobias Hunger
2012-12-13 14:14:46 +01:00
parent a9ea71c26f
commit 9f3bc4ddc4

View File

@@ -1382,6 +1382,12 @@ QString VcsBaseEditorWidget::findDiffFile(const QString &f) const
if (in.isFile())
return in.absoluteFilePath();
// 4) remove trailing tab char and try again: At least git appends \t when the
// filename contains spaces. Since the diff commend does use \t all of a sudden,
// too, when seeing spaces in a filename, I expect the same behavior in other VCS.
if (f.endsWith(QLatin1Char('\t')))
return findDiffFile(f.left(f.length() - 1));
return QString();
}