forked from qt-creator/qt-creator
VcsBase: Proliferate use of FilePath
... and update user code. Change-Id: I52c08e9e07238536d31fc72f97312ac582a1e32f Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -244,7 +244,7 @@ void GitEditorWidget::init()
|
||||
const bool isRebaseEditor = editorId == Git::Constants::GIT_REBASE_EDITOR_ID;
|
||||
if (!isCommitEditor && !isRebaseEditor)
|
||||
return;
|
||||
const QChar commentChar = GitClient::instance()->commentChar(FilePath::fromString(source()));
|
||||
const QChar commentChar = GitClient::instance()->commentChar(source());
|
||||
if (isCommitEditor)
|
||||
textDocument()->setSyntaxHighlighter(new GitSubmitHighlighter(commentChar));
|
||||
else if (isRebaseEditor)
|
||||
@@ -273,7 +273,7 @@ void GitEditorWidget::aboutToOpen(const FilePath &filePath, const FilePath &real
|
||||
if (editorId == Git::Constants::GIT_COMMIT_TEXT_EDITOR_ID
|
||||
|| editorId == Git::Constants::GIT_REBASE_EDITOR_ID) {
|
||||
const FilePath gitPath = filePath.absolutePath();
|
||||
setSource(gitPath.toString());
|
||||
setSource(gitPath);
|
||||
textDocument()->setCodec(
|
||||
GitClient::instance()->encoding(gitPath, "i18n.commitEncoding"));
|
||||
}
|
||||
@@ -328,7 +328,7 @@ bool GitEditorWidget::supportChangeLinks() const
|
||||
|| (textDocument()->id() == Git::Constants::GIT_REBASE_EDITOR_ID);
|
||||
}
|
||||
|
||||
QString GitEditorWidget::fileNameForLine(int line) const
|
||||
FilePath GitEditorWidget::fileNameForLine(int line) const
|
||||
{
|
||||
// 7971b6e7 share/qtcreator/dumper/dumper.py (hjk
|
||||
QTextBlock block = document()->findBlockByLineNumber(line - 1);
|
||||
@@ -338,7 +338,7 @@ QString GitEditorWidget::fileNameForLine(int line) const
|
||||
if (match.hasMatch()) {
|
||||
const QString fileName = match.captured(1).trimmed();
|
||||
if (!fileName.isEmpty())
|
||||
return fileName;
|
||||
return FilePath::fromString(fileName);
|
||||
}
|
||||
return source();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user