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:
@@ -136,7 +136,7 @@ void FetchContext::show()
|
||||
{
|
||||
const QString title = QString::number(m_change->number) + '/'
|
||||
+ QString::number(m_change->currentPatchSet.patchSetNumber);
|
||||
GitClient::instance()->show(m_repository.toString(), "FETCH_HEAD", title);
|
||||
GitClient::instance()->show(m_repository, "FETCH_HEAD", title);
|
||||
}
|
||||
|
||||
void FetchContext::cherryPick()
|
||||
|
||||
@@ -462,7 +462,7 @@ ShowController::ShowController(IDocument *document, const QString &id)
|
||||
Storage(storage),
|
||||
Storage(diffInputStorage),
|
||||
parallel,
|
||||
OnGroupSetup([this] { setStartupFile(VcsBase::source(this->document())); }),
|
||||
OnGroupSetup([this] { setStartupFile(VcsBase::source(this->document()).toString()); }),
|
||||
Group {
|
||||
optional,
|
||||
Process(setupDescription, onDescriptionDone),
|
||||
@@ -823,10 +823,8 @@ FilePaths GitClient::unmanagedFiles(const FilePaths &filePaths) const
|
||||
|
||||
QTextCodec *GitClient::codecFor(GitClient::CodecType codecType, const FilePath &source) const
|
||||
{
|
||||
if (codecType == CodecSource) {
|
||||
return source.isFile() ? VcsBaseEditor::getCodec(source.toString())
|
||||
: encoding(source, "gui.encoding");
|
||||
}
|
||||
if (codecType == CodecSource)
|
||||
return source.isFile() ? VcsBaseEditor::getCodec(source) : encoding(source, "gui.encoding");
|
||||
if (codecType == CodecLogOutput)
|
||||
return encoding(source, "i18n.logOutputEncoding");
|
||||
return nullptr;
|
||||
@@ -921,12 +919,12 @@ void GitClient::stage(DiffEditor::DiffEditorController *diffController,
|
||||
}
|
||||
}
|
||||
|
||||
void GitClient::requestReload(const QString &documentId, const QString &source,
|
||||
void GitClient::requestReload(const QString &documentId, const FilePath &source,
|
||||
const QString &title, const FilePath &workingDirectory,
|
||||
std::function<GitBaseDiffEditorController *(IDocument *)> factory) const
|
||||
{
|
||||
// Creating document might change the referenced source. Store a copy and use it.
|
||||
const QString sourceCopy = source;
|
||||
const FilePath sourceCopy = source;
|
||||
|
||||
IDocument *document = DiffEditorController::findOrCreateDocument(documentId, title);
|
||||
QTC_ASSERT(document, return);
|
||||
@@ -954,7 +952,7 @@ void GitClient::diffFiles(const FilePath &workingDirectory,
|
||||
const QString documentId = QLatin1String(Constants::GIT_PLUGIN)
|
||||
+ QLatin1String(".DiffFiles.") + workingDirectory.toString();
|
||||
requestReload(documentId,
|
||||
workingDirectory.toString(), Tr::tr("Git Diff Files"), workingDirectory,
|
||||
workingDirectory, Tr::tr("Git Diff Files"), workingDirectory,
|
||||
[stagedFileNames, unstagedFileNames](IDocument *doc) {
|
||||
return new FileListDiffController(doc, stagedFileNames, unstagedFileNames);
|
||||
});
|
||||
@@ -965,7 +963,7 @@ void GitClient::diffProject(const FilePath &workingDirectory, const QString &pro
|
||||
const QString documentId = QLatin1String(Constants::GIT_PLUGIN)
|
||||
+ QLatin1String(".DiffProject.") + workingDirectory.toString();
|
||||
requestReload(documentId,
|
||||
workingDirectory.toString(), Tr::tr("Git Diff Project"), workingDirectory,
|
||||
workingDirectory, Tr::tr("Git Diff Project"), workingDirectory,
|
||||
[projectDirectory](IDocument *doc){
|
||||
return new GitDiffEditorController(doc, {}, {}, {"--", projectDirectory});
|
||||
});
|
||||
@@ -977,7 +975,7 @@ void GitClient::diffRepository(const FilePath &workingDirectory,
|
||||
{
|
||||
const QString documentId = QLatin1String(Constants::GIT_PLUGIN)
|
||||
+ QLatin1String(".DiffRepository.") + workingDirectory.toString();
|
||||
requestReload(documentId, workingDirectory.toString(), Tr::tr("Git Diff Repository"), workingDirectory,
|
||||
requestReload(documentId, workingDirectory, Tr::tr("Git Diff Repository"), workingDirectory,
|
||||
[&leftCommit, &rightCommit](IDocument *doc) {
|
||||
return new GitDiffEditorController(doc, leftCommit, rightCommit, {});
|
||||
});
|
||||
@@ -986,9 +984,9 @@ void GitClient::diffRepository(const FilePath &workingDirectory,
|
||||
void GitClient::diffFile(const FilePath &workingDirectory, const QString &fileName) const
|
||||
{
|
||||
const QString title = Tr::tr("Git Diff \"%1\"").arg(fileName);
|
||||
const QString sourceFile = VcsBaseEditor::getSource(workingDirectory, fileName);
|
||||
const FilePath sourceFile = VcsBaseEditor::getSource(workingDirectory, fileName);
|
||||
const QString documentId = QLatin1String(Constants::GIT_PLUGIN)
|
||||
+ QLatin1String(".DifFile.") + sourceFile;
|
||||
+ QLatin1String(".DifFile.") + sourceFile.toString();
|
||||
requestReload(documentId, sourceFile, title, workingDirectory,
|
||||
[&fileName](IDocument *doc) {
|
||||
return new GitDiffEditorController(doc, {}, {}, {"--", fileName});
|
||||
@@ -1000,7 +998,7 @@ void GitClient::diffBranch(const FilePath &workingDirectory, const QString &bran
|
||||
const QString title = Tr::tr("Git Diff Branch \"%1\"").arg(branchName);
|
||||
const QString documentId = QLatin1String(Constants::GIT_PLUGIN)
|
||||
+ QLatin1String(".DiffBranch.") + branchName;
|
||||
requestReload(documentId, workingDirectory.toString(), title, workingDirectory,
|
||||
requestReload(documentId, workingDirectory, title, workingDirectory,
|
||||
[branchName](IDocument *doc) {
|
||||
return new GitDiffEditorController(doc, branchName, {}, {});
|
||||
});
|
||||
@@ -1056,7 +1054,7 @@ void GitClient::log(const FilePath &workingDirectory, const QString &fileName,
|
||||
const FilePath workingDir = workingDirectory;
|
||||
const QString title = Tr::tr("Git Log \"%1\"").arg(msgArg);
|
||||
const Id editorId = Git::Constants::GIT_LOG_EDITOR_ID;
|
||||
const QString sourceFile = VcsBaseEditor::getSource(workingDir, fileName);
|
||||
const FilePath sourceFile = VcsBaseEditor::getSource(workingDir, fileName);
|
||||
GitEditorWidget *editor = static_cast<GitEditorWidget *>(
|
||||
createVcsEditor(editorId, title, sourceFile,
|
||||
codecFor(CodecLogOutput), "logTitle", msgArg));
|
||||
@@ -1114,7 +1112,7 @@ void GitClient::reflog(const FilePath &workingDirectory, const QString &ref)
|
||||
// Creating document might change the referenced workingDirectory. Store a copy and use it.
|
||||
const FilePath workingDir = workingDirectory;
|
||||
GitEditorWidget *editor = static_cast<GitEditorWidget *>(
|
||||
createVcsEditor(editorId, title, workingDir.toString(), codecFor(CodecLogOutput),
|
||||
createVcsEditor(editorId, title, workingDir, codecFor(CodecLogOutput),
|
||||
"reflogRepository", workingDir.toString()));
|
||||
VcsBaseEditorConfig *argWidget = editor->editorConfig();
|
||||
if (!argWidget) {
|
||||
@@ -1147,7 +1145,7 @@ static inline QString msgCannotShow(const QString &sha)
|
||||
return Tr::tr("Cannot describe \"%1\".").arg(sha);
|
||||
}
|
||||
|
||||
void GitClient::show(const QString &source, const QString &id, const QString &name)
|
||||
void GitClient::show(const FilePath &source, const QString &id, const QString &name)
|
||||
{
|
||||
if (!canShow(id)) {
|
||||
VcsOutputWindow::appendError(msgCannotShow(id));
|
||||
@@ -1155,9 +1153,8 @@ void GitClient::show(const QString &source, const QString &id, const QString &na
|
||||
}
|
||||
|
||||
const QString title = Tr::tr("Git Show \"%1\"").arg(name.isEmpty() ? id : name);
|
||||
const QFileInfo sourceFi(source);
|
||||
FilePath workingDirectory = FilePath::fromString(
|
||||
sourceFi.isDir() ? sourceFi.absoluteFilePath() : sourceFi.absolutePath());
|
||||
FilePath workingDirectory =
|
||||
source.isDir() ? source.absoluteFilePath() : source.absolutePath();
|
||||
const FilePath repoDirectory = VcsManager::findTopLevelForDirectory(workingDirectory);
|
||||
if (!repoDirectory.isEmpty())
|
||||
workingDirectory = repoDirectory;
|
||||
@@ -1225,10 +1222,10 @@ void GitClient::annotate(const Utils::FilePath &workingDir, const QString &file,
|
||||
const Id editorId = Git::Constants::GIT_BLAME_EDITOR_ID;
|
||||
const QString id = VcsBaseEditor::getTitleId(workingDir, {file}, revision);
|
||||
const QString title = Tr::tr("Git Blame \"%1\"").arg(id);
|
||||
const QString sourceFile = VcsBaseEditor::getSource(workingDir, file);
|
||||
const FilePath sourceFile = VcsBaseEditor::getSource(workingDir, file);
|
||||
|
||||
VcsBaseEditorWidget *editor = createVcsEditor(editorId, title, sourceFile,
|
||||
codecFor(CodecSource, FilePath::fromString(sourceFile)), "blameFileName", id);
|
||||
codecFor(CodecSource, sourceFile), "blameFileName", id);
|
||||
VcsBaseEditorConfig *argWidget = editor->editorConfig();
|
||||
if (!argWidget) {
|
||||
argWidget = new GitBlameArgumentsWidget(settings(), editor->toolBar());
|
||||
@@ -3131,9 +3128,9 @@ void GitClient::subversionLog(const FilePath &workingDirectory) const
|
||||
// Create a command editor, no highlighting or interaction.
|
||||
const QString title = Tr::tr("Git SVN Log");
|
||||
const Id editorId = Git::Constants::GIT_SVN_LOG_EDITOR_ID;
|
||||
const QString sourceFile = VcsBaseEditor::getSource(workingDirectory, QStringList());
|
||||
const FilePath sourceFile = VcsBaseEditor::getSource(workingDirectory, QStringList());
|
||||
VcsBaseEditorWidget *editor = createVcsEditor(editorId, title, sourceFile, codecFor(CodecNone),
|
||||
"svnLog", sourceFile);
|
||||
"svnLog", sourceFile.toString());
|
||||
editor->setWorkingDirectory(workingDirectory);
|
||||
vcsExecWithEditor(workingDirectory, arguments, editor);
|
||||
}
|
||||
@@ -3638,7 +3635,7 @@ QString GitClient::suggestedLocalBranchName(
|
||||
return suggestedName;
|
||||
}
|
||||
|
||||
void GitClient::addChangeActions(QMenu *menu, const QString &source, const QString &change)
|
||||
void GitClient::addChangeActions(QMenu *menu, const FilePath &source, const QString &change)
|
||||
{
|
||||
QTC_ASSERT(!change.isEmpty(), return);
|
||||
const FilePath &workingDir = fileWorkingDirectory(source);
|
||||
@@ -3664,7 +3661,7 @@ void GitClient::addChangeActions(QMenu *menu, const QString &source, const QStri
|
||||
if (isRange) {
|
||||
menu->setDefaultAction(logAction);
|
||||
} else {
|
||||
const FilePath filePath = FilePath::fromString(source);
|
||||
const FilePath filePath = source;
|
||||
if (!filePath.isDir()) {
|
||||
menu->addAction(Tr::tr("Sh&ow file \"%1\" on revision %2").arg(filePath.fileName(), change),
|
||||
[workingDir, change, source] {
|
||||
@@ -3717,9 +3714,9 @@ void GitClient::addChangeActions(QMenu *menu, const QString &source, const QStri
|
||||
}
|
||||
}
|
||||
|
||||
FilePath GitClient::fileWorkingDirectory(const QString &file)
|
||||
FilePath GitClient::fileWorkingDirectory(const Utils::FilePath &file)
|
||||
{
|
||||
Utils::FilePath path = Utils::FilePath::fromString(file);
|
||||
Utils::FilePath path = file;
|
||||
if (!path.isEmpty() && !path.isDir())
|
||||
path = path.parentDir();
|
||||
while (!path.isEmpty() && !path.exists())
|
||||
@@ -3728,17 +3725,17 @@ FilePath GitClient::fileWorkingDirectory(const QString &file)
|
||||
}
|
||||
|
||||
IEditor *GitClient::openShowEditor(const FilePath &workingDirectory, const QString &ref,
|
||||
const QString &path, ShowEditor showSetting)
|
||||
const FilePath &path, ShowEditor showSetting)
|
||||
{
|
||||
const FilePath topLevel = VcsManager::findTopLevelForDirectory(workingDirectory);
|
||||
const QString topLevelString = topLevel.toString();
|
||||
const QString relativePath = QDir(topLevelString).relativeFilePath(path);
|
||||
const QString relativePath = QDir(topLevelString).relativeFilePath(path.toString());
|
||||
const QByteArray content = synchronousShow(topLevel, ref + ":" + relativePath);
|
||||
if (showSetting == ShowEditor::OnlyIfDifferent) {
|
||||
if (content.isEmpty())
|
||||
return nullptr;
|
||||
QByteArray fileContent;
|
||||
if (TextFileFormat::readFileUTF8(Utils::FilePath::fromString(path),
|
||||
if (TextFileFormat::readFileUTF8(path,
|
||||
nullptr,
|
||||
&fileContent,
|
||||
nullptr)
|
||||
@@ -3755,6 +3752,7 @@ IEditor *GitClient::openShowEditor(const FilePath &workingDirectory, const QStri
|
||||
IEditor *editor = EditorManager::openEditorWithContents(Id(), &title, content, documentId,
|
||||
EditorManager::DoNotSwitchToDesignMode);
|
||||
editor->document()->setTemporary(true);
|
||||
// FIXME: Check should that be relative
|
||||
VcsBase::setSource(editor->document(), path);
|
||||
return editor;
|
||||
}
|
||||
|
||||
@@ -331,18 +331,18 @@ public:
|
||||
|
||||
static QString msgNoChangedFiles();
|
||||
static QString msgNoCommits(bool includeRemote);
|
||||
void show(const QString &source, const QString &id, const QString &name = {});
|
||||
void show(const Utils::FilePath &source, const QString &id, const QString &name = {});
|
||||
void archive(const Utils::FilePath &workingDirectory, QString commit);
|
||||
|
||||
enum class BranchTargetType { Remote, Commit };
|
||||
static QString suggestedLocalBranchName(
|
||||
const Utils::FilePath &workingDirectory, const QStringList &existingLocalNames,
|
||||
const QString &target, BranchTargetType targetType);
|
||||
static void addChangeActions(QMenu *menu, const QString &source, const QString &change);
|
||||
static Utils::FilePath fileWorkingDirectory(const QString &file);
|
||||
static void addChangeActions(QMenu *menu, const Utils::FilePath &source, const QString &change);
|
||||
static Utils::FilePath fileWorkingDirectory(const Utils::FilePath &file);
|
||||
enum class ShowEditor { OnlyIfDifferent, Always };
|
||||
Core::IEditor *openShowEditor(const Utils::FilePath &workingDirectory, const QString &ref,
|
||||
const QString &path, ShowEditor showSetting = ShowEditor::Always);
|
||||
const Utils::FilePath &path, ShowEditor showSetting = ShowEditor::Always);
|
||||
|
||||
Author getAuthor(const Utils::FilePath &workingDirectory);
|
||||
private:
|
||||
@@ -357,8 +357,8 @@ private:
|
||||
enum CodecType { CodecSource, CodecLogOutput, CodecNone };
|
||||
QTextCodec *codecFor(CodecType codecType, const Utils::FilePath &source = {}) const;
|
||||
|
||||
void requestReload(const QString &documentId, const QString &source, const QString &title,
|
||||
const Utils::FilePath &workingDirectory,
|
||||
void requestReload(const QString &documentId, const Utils::FilePath &source,
|
||||
const QString &title, const Utils::FilePath &workingDirectory,
|
||||
std::function<GitBaseDiffEditorController *(Core::IDocument *)> factory) const;
|
||||
|
||||
QString readOneLine(const Utils::FilePath &workingDirectory, const QStringList &arguments) const;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ private:
|
||||
void addChangeActions(QMenu *menu, const QString &change) override;
|
||||
QString revisionSubject(const QTextBlock &inBlock) const override;
|
||||
bool supportChangeLinks() const override;
|
||||
QString fileNameForLine(int line) const override;
|
||||
Utils::FilePath fileNameForLine(int line) const override;
|
||||
Utils::FilePath sourceWorkingDirectory() const;
|
||||
|
||||
const QRegularExpression m_changeNumberPattern;
|
||||
|
||||
@@ -285,7 +285,7 @@ IEditor *GitGrep::openEditor(const SearchResultItem &item,
|
||||
const QStringList &itemPath = item.path();
|
||||
if (params.ref.isEmpty() || itemPath.isEmpty())
|
||||
return nullptr;
|
||||
const QString path = QDir::fromNativeSeparators(itemPath.first());
|
||||
const FilePath path = FilePath::fromUserInput(itemPath.first());
|
||||
const FilePath topLevel = FilePath::fromString(parameters.additionalParameters.toString());
|
||||
IEditor *editor = m_client->openShowEditor(topLevel, params.ref, path,
|
||||
GitClient::ShowEditor::OnlyIfDifferent);
|
||||
|
||||
@@ -188,7 +188,7 @@ public:
|
||||
QString authorMail;
|
||||
QDateTime authorTime;
|
||||
QString summary;
|
||||
QString fileName;
|
||||
FilePath filePath;
|
||||
};
|
||||
|
||||
class BlameMark : public TextEditor::TextMark
|
||||
@@ -216,7 +216,7 @@ public:
|
||||
showAction->setIcon(Utils::Icons::ZOOM.icon());
|
||||
showAction->setToolTip(TextEditor::Tr::tr("Show Commit %1").arg(info.sha1.left(8)));
|
||||
QObject::connect(showAction, &QAction::triggered, [info] {
|
||||
GitClient::instance()->show(info.fileName, info.sha1);
|
||||
GitClient::instance()->show(info.filePath, info.sha1);
|
||||
});
|
||||
return QList<QAction *>{copyToClipboardAction, showAction};
|
||||
});
|
||||
@@ -267,7 +267,7 @@ public:
|
||||
bool vcsCreateRepository(const FilePath &directory) final;
|
||||
|
||||
void vcsAnnotate(const FilePath &filePath, int line) final;
|
||||
void vcsDescribe(const FilePath &source, const QString &id) final { m_gitClient.show(source.toString(), id); };
|
||||
void vcsDescribe(const FilePath &source, const QString &id) final { m_gitClient.show(source, id); };
|
||||
QString vcsTopic(const FilePath &directory) final;
|
||||
|
||||
VcsCommand *createInitialCheckoutCommand(const QString &url,
|
||||
@@ -284,7 +284,7 @@ public:
|
||||
QAction *action = menu->addAction(Tr::tr("&Describe Change %1").arg(reference),
|
||||
[=] { vcsDescribe(workingDirectory, reference); });
|
||||
menu->setDefaultAction(action);
|
||||
GitClient::addChangeActions(menu, workingDirectory.toString(), reference);
|
||||
GitClient::addChangeActions(menu, workingDirectory, reference);
|
||||
}
|
||||
|
||||
bool handleLink(const FilePath &workingDirectory, const QString &reference) final
|
||||
@@ -292,7 +292,7 @@ public:
|
||||
if (reference.contains(".."))
|
||||
GitClient::instance()->log(workingDirectory, {}, false, {reference});
|
||||
else
|
||||
GitClient::instance()->show(workingDirectory.toString(), reference);
|
||||
GitClient::instance()->show(workingDirectory, reference);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1132,7 +1132,7 @@ void GitPluginPrivate::blameFile()
|
||||
}
|
||||
}
|
||||
}
|
||||
const FilePath fileName = FilePath::fromString(state.currentFile()).canonicalPath();
|
||||
const FilePath fileName = state.currentFile().canonicalPath();
|
||||
FilePath topLevel;
|
||||
VcsManager::findVersionControlForDirectory(fileName.parentDir(), &topLevel);
|
||||
m_gitClient.annotate(topLevel, fileName.relativeChildPath(topLevel).toString(),
|
||||
@@ -1168,8 +1168,8 @@ void GitPluginPrivate::undoFileChanges(bool revertStaging)
|
||||
}
|
||||
const VcsBasePluginState state = currentState();
|
||||
QTC_ASSERT(state.hasFile(), return);
|
||||
FileChangeBlocker fcb(FilePath::fromString(state.currentFile()));
|
||||
m_gitClient.revertFiles({state.currentFile()}, revertStaging);
|
||||
FileChangeBlocker fcb(state.currentFile());
|
||||
m_gitClient.revertFiles({state.currentFile().toString()}, revertStaging);
|
||||
}
|
||||
|
||||
class ResetItemDelegate : public LogItemDelegate
|
||||
@@ -1273,10 +1273,10 @@ void GitPluginPrivate::startChangeRelatedAction(const Id &id)
|
||||
if (dialog.command() == Show) {
|
||||
const int colon = change.indexOf(':');
|
||||
if (colon > 0) {
|
||||
const QString path = QDir(workingDirectory.toString()).absoluteFilePath(change.mid(colon + 1));
|
||||
const FilePath path = workingDirectory.resolvePath(change.mid(colon + 1));
|
||||
m_gitClient.openShowEditor(workingDirectory, change.left(colon), path);
|
||||
} else {
|
||||
m_gitClient.show(workingDirectory.toString(), change);
|
||||
m_gitClient.show(workingDirectory, change);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1514,7 +1514,7 @@ CommitInfo parseBlameOutput(const QStringList &blame, const Utils::FilePath &fil
|
||||
const uint timeStamp = blame.at(3).mid(12).toUInt();
|
||||
result.authorTime = QDateTime::fromSecsSinceEpoch(timeStamp);
|
||||
result.summary = blame.at(9).mid(8);
|
||||
result.fileName = filePath.toString();
|
||||
result.filePath = filePath;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1615,7 +1615,7 @@ IEditor *GitPluginPrivate::openSubmitEditor(const QString &fileName, const Commi
|
||||
}
|
||||
IDocument *document = submitEditor->document();
|
||||
document->setPreferredDisplayName(title);
|
||||
VcsBase::setSource(document, m_submitRepository.toString());
|
||||
VcsBase::setSource(document, m_submitRepository);
|
||||
return editor;
|
||||
}
|
||||
|
||||
@@ -1985,7 +1985,7 @@ QObject *GitPlugin::remoteCommand(const QStringList &options, const QString &wor
|
||||
return nullptr;
|
||||
|
||||
if (options.first() == "-git-show")
|
||||
dd->m_gitClient.show(workingDirectory, options.at(1));
|
||||
dd->m_gitClient.show(FilePath::fromUserInput(workingDirectory), options.at(1));
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ void GitSubmitEditor::slotDiffSelected(const QList<int> &rows)
|
||||
void GitSubmitEditor::showCommit(const QString &commit)
|
||||
{
|
||||
if (!m_workingDirectory.isEmpty())
|
||||
GitClient::instance()->show(m_workingDirectory.toString(), commit);
|
||||
GitClient::instance()->show(m_workingDirectory, commit);
|
||||
}
|
||||
|
||||
void GitSubmitEditor::updateFileModel()
|
||||
|
||||
@@ -215,7 +215,7 @@ void StashDialog::showCurrent()
|
||||
{
|
||||
const int index = currentRow();
|
||||
QTC_ASSERT(index >= 0, return);
|
||||
GitClient::instance()->show(m_repository.toString(), QString(m_model->at(index).name));
|
||||
GitClient::instance()->show(m_repository, QString(m_model->at(index).name));
|
||||
}
|
||||
|
||||
// Suggest Branch name to restore 'stash@{0}' -> 'stash0-date'
|
||||
|
||||
Reference in New Issue
Block a user