forked from qt-creator/qt-creator
Vcs: Use more FilePath for file paths
Change-Id: I855cde65d034a9647972a7fddf1e8266d7ccfa88 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -92,7 +92,7 @@ FilePath VcsBaseClientImpl::vcsBinary() const
|
||||
return m_baseSettings->binaryPath.filePath();
|
||||
}
|
||||
|
||||
VcsCommand *VcsBaseClientImpl::createCommand(const QString &workingDirectory,
|
||||
VcsCommand *VcsBaseClientImpl::createCommand(const FilePath &workingDirectory,
|
||||
VcsBaseEditorWidget *editor,
|
||||
JobOutputBindMode mode) const
|
||||
{
|
||||
@@ -145,21 +145,14 @@ QString VcsBaseClientImpl::stripLastNewline(const QString &in)
|
||||
}
|
||||
|
||||
void VcsBaseClientImpl::vcsFullySynchronousExec(QtcProcess &proc,
|
||||
const QString &workingDir, const QStringList &args,
|
||||
const FilePath &workingDir, const QStringList &args,
|
||||
unsigned flags, int timeoutS, QTextCodec *codec) const
|
||||
{
|
||||
vcsFullySynchronousExec(proc, workingDir, {vcsBinary(), args}, flags, timeoutS, codec);
|
||||
}
|
||||
|
||||
void VcsBaseClientImpl::vcsFullySynchronousExec(QtcProcess &proc,
|
||||
const FilePath &workingDir, const QStringList &args,
|
||||
unsigned flags, int timeoutS, QTextCodec *codec) const
|
||||
{
|
||||
vcsFullySynchronousExec(proc, workingDir.toString(), {vcsBinary(), args}, flags, timeoutS, codec);
|
||||
}
|
||||
|
||||
void VcsBaseClientImpl::vcsFullySynchronousExec(QtcProcess &proc,
|
||||
const QString &workingDir, const CommandLine &cmdLine,
|
||||
const FilePath &workingDir, const CommandLine &cmdLine,
|
||||
unsigned flags, int timeoutS, QTextCodec *codec) const
|
||||
{
|
||||
VcsCommand command(workingDir, processEnvironment());
|
||||
@@ -175,7 +168,7 @@ void VcsBaseClientImpl::resetCachedVcsInfo(const FilePath &workingDir)
|
||||
Core::VcsManager::resetVersionControlForDirectory(workingDir);
|
||||
}
|
||||
|
||||
void VcsBaseClientImpl::annotateRevisionRequested(const QString &workingDirectory,
|
||||
void VcsBaseClientImpl::annotateRevisionRequested(const FilePath &workingDirectory,
|
||||
const QString &file, const QString &change,
|
||||
int line)
|
||||
{
|
||||
@@ -188,7 +181,7 @@ void VcsBaseClientImpl::annotateRevisionRequested(const QString &workingDirector
|
||||
annotate(workingDirectory, file, changeCopy, line);
|
||||
}
|
||||
|
||||
VcsCommand *VcsBaseClientImpl::vcsExec(const QString &workingDirectory, const QStringList &arguments,
|
||||
VcsCommand *VcsBaseClientImpl::vcsExec(const FilePath &workingDirectory, const QStringList &arguments,
|
||||
VcsBaseEditorWidget *editor, bool useOutputToWindow,
|
||||
unsigned additionalFlags, const QVariant &cookie) const
|
||||
{
|
||||
@@ -202,7 +195,8 @@ VcsCommand *VcsBaseClientImpl::vcsExec(const QString &workingDirectory, const QS
|
||||
return command;
|
||||
}
|
||||
|
||||
void VcsBaseClientImpl::vcsSynchronousExec(QtcProcess &proc, const QString &workingDir,
|
||||
void VcsBaseClientImpl::vcsSynchronousExec(QtcProcess &proc,
|
||||
const FilePath &workingDir,
|
||||
const QStringList &args,
|
||||
unsigned flags,
|
||||
QTextCodec *outputCodec) const
|
||||
@@ -292,17 +286,19 @@ bool VcsBaseClient::synchronousClone(const FilePath &workingDir,
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
bool VcsBaseClient::synchronousAdd(const QString &workingDir, const QString &filename,
|
||||
bool VcsBaseClient::synchronousAdd(const FilePath &workingDir,
|
||||
const QString &relFileName,
|
||||
const QStringList &extraOptions)
|
||||
{
|
||||
QStringList args;
|
||||
args << vcsCommandString(AddCommand) << extraOptions << filename;
|
||||
args << vcsCommandString(AddCommand) << extraOptions << relFileName;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDir, args);
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
bool VcsBaseClient::synchronousRemove(const QString &workingDir, const QString &filename,
|
||||
bool VcsBaseClient::synchronousRemove(const FilePath &workingDir,
|
||||
const QString &filename,
|
||||
const QStringList &extraOptions)
|
||||
{
|
||||
QStringList args;
|
||||
@@ -312,8 +308,9 @@ bool VcsBaseClient::synchronousRemove(const QString &workingDir, const QString &
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
bool VcsBaseClient::synchronousMove(const QString &workingDir,
|
||||
const QString &from, const QString &to,
|
||||
bool VcsBaseClient::synchronousMove(const FilePath &workingDir,
|
||||
const QString &from,
|
||||
const QString &to,
|
||||
const QStringList &extraOptions)
|
||||
{
|
||||
QStringList args;
|
||||
@@ -323,7 +320,7 @@ bool VcsBaseClient::synchronousMove(const QString &workingDir,
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
bool VcsBaseClient::synchronousPull(const QString &workingDir,
|
||||
bool VcsBaseClient::synchronousPull(const FilePath &workingDir,
|
||||
const QString &srcLocation,
|
||||
const QStringList &extraOptions)
|
||||
{
|
||||
@@ -338,11 +335,11 @@ bool VcsBaseClient::synchronousPull(const QString &workingDir,
|
||||
vcsSynchronousExec(proc, workingDir, args, flags);
|
||||
const bool ok = proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
if (ok)
|
||||
emit changed(QVariant(workingDir));
|
||||
emit changed(QVariant(workingDir.toString()));
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool VcsBaseClient::synchronousPush(const QString &workingDir,
|
||||
bool VcsBaseClient::synchronousPush(const FilePath &workingDir,
|
||||
const QString &dstLocation,
|
||||
const QStringList &extraOptions)
|
||||
{
|
||||
@@ -359,7 +356,7 @@ bool VcsBaseClient::synchronousPush(const QString &workingDir,
|
||||
}
|
||||
|
||||
VcsBaseEditorWidget *VcsBaseClient::annotate(
|
||||
const QString &workingDir, const QString &file, const QString &revision /* = QString() */,
|
||||
const FilePath &workingDir, const QString &file, const QString &revision /* = QString() */,
|
||||
int lineNumber /* = -1 */, const QStringList &extraOptions)
|
||||
{
|
||||
const QString vcsCmdString = vcsCommandString(AnnotateCommand);
|
||||
@@ -380,7 +377,7 @@ VcsBaseEditorWidget *VcsBaseClient::annotate(
|
||||
return editor;
|
||||
}
|
||||
|
||||
void VcsBaseClient::diff(const QString &workingDir, const QStringList &files,
|
||||
void VcsBaseClient::diff(const FilePath &workingDir, const QStringList &files,
|
||||
const QStringList &extraOptions)
|
||||
{
|
||||
const QString vcsCmdString = vcsCommandString(DiffCommand);
|
||||
@@ -418,10 +415,11 @@ void VcsBaseClient::diff(const QString &workingDir, const QStringList &files,
|
||||
: VcsBaseEditor::getCodec(source);
|
||||
VcsCommand *command = createCommand(workingDir, editor);
|
||||
command->setCodec(codec);
|
||||
enqueueJob(command, args, workingDir, exitCodeInterpreter(DiffCommand));
|
||||
enqueueJob(command, args, workingDir.toString(), exitCodeInterpreter(DiffCommand));
|
||||
}
|
||||
|
||||
void VcsBaseClient::log(const QString &workingDir, const QStringList &files,
|
||||
void VcsBaseClient::log(const FilePath &workingDir,
|
||||
const QStringList &files,
|
||||
const QStringList &extraOptions,
|
||||
bool enableAnnotationContextMenu)
|
||||
{
|
||||
@@ -457,7 +455,7 @@ void VcsBaseClient::log(const QString &workingDir, const QStringList &files,
|
||||
enqueueJob(createCommand(workingDir, editor), args);
|
||||
}
|
||||
|
||||
void VcsBaseClient::revertFile(const QString &workingDir,
|
||||
void VcsBaseClient::revertFile(const FilePath &workingDir,
|
||||
const QString &file,
|
||||
const QString &revision,
|
||||
const QStringList &extraOptions)
|
||||
@@ -466,29 +464,31 @@ void VcsBaseClient::revertFile(const QString &workingDir,
|
||||
args << revisionSpec(revision) << extraOptions << file;
|
||||
// Indicate repository change or file list
|
||||
VcsCommand *cmd = createCommand(workingDir);
|
||||
cmd->setCookie(QStringList(workingDir + QLatin1Char('/') + file));
|
||||
cmd->setCookie(QStringList(workingDir.pathAppended(file).toString()));
|
||||
connect(cmd, &VcsCommand::success, this, &VcsBaseClient::changed, Qt::QueuedConnection);
|
||||
enqueueJob(cmd, args);
|
||||
}
|
||||
|
||||
void VcsBaseClient::revertAll(const QString &workingDir, const QString &revision,
|
||||
void VcsBaseClient::revertAll(const FilePath &workingDir,
|
||||
const QString &revision,
|
||||
const QStringList &extraOptions)
|
||||
{
|
||||
QStringList args(vcsCommandString(RevertCommand));
|
||||
args << revisionSpec(revision) << extraOptions;
|
||||
// Indicate repository change or file list
|
||||
VcsCommand *cmd = createCommand(workingDir);
|
||||
cmd->setCookie(QStringList(workingDir));
|
||||
cmd->setCookie(QStringList(workingDir.toString()));
|
||||
connect(cmd, &VcsCommand::success, this, &VcsBaseClient::changed, Qt::QueuedConnection);
|
||||
enqueueJob(createCommand(workingDir), args);
|
||||
}
|
||||
|
||||
void VcsBaseClient::status(const QString &workingDir, const QString &file,
|
||||
void VcsBaseClient::status(const FilePath &workingDir,
|
||||
const QString &file,
|
||||
const QStringList &extraOptions)
|
||||
{
|
||||
QStringList args(vcsCommandString(StatusCommand));
|
||||
args << extraOptions << file;
|
||||
VcsOutputWindow::setRepository(workingDir);
|
||||
VcsOutputWindow::setRepository(workingDir.toString());
|
||||
VcsCommand *cmd = createCommand(workingDir, nullptr, VcsWindowOutputBind);
|
||||
connect(cmd, &VcsCommand::finished,
|
||||
VcsOutputWindow::instance(), &VcsOutputWindow::clearRepository,
|
||||
@@ -496,7 +496,7 @@ void VcsBaseClient::status(const QString &workingDir, const QString &file,
|
||||
enqueueJob(cmd, args);
|
||||
}
|
||||
|
||||
void VcsBaseClient::emitParsedStatus(const QString &repository, const QStringList &extraOptions)
|
||||
void VcsBaseClient::emitParsedStatus(const FilePath &repository, const QStringList &extraOptions)
|
||||
{
|
||||
QStringList args(vcsCommandString(StatusCommand));
|
||||
args << extraOptions;
|
||||
@@ -543,7 +543,8 @@ void VcsBaseClient::setLogConfigCreator(ConfigCreator creator)
|
||||
m_logConfigCreator = std::move(creator);
|
||||
}
|
||||
|
||||
void VcsBaseClient::import(const QString &repositoryRoot, const QStringList &files,
|
||||
void VcsBaseClient::import(const FilePath &repositoryRoot,
|
||||
const QStringList &files,
|
||||
const QStringList &extraOptions)
|
||||
{
|
||||
QStringList args(vcsCommandString(ImportCommand));
|
||||
@@ -551,7 +552,8 @@ void VcsBaseClient::import(const QString &repositoryRoot, const QStringList &fil
|
||||
enqueueJob(createCommand(repositoryRoot), args);
|
||||
}
|
||||
|
||||
void VcsBaseClient::view(const QString &source, const QString &id,
|
||||
void VcsBaseClient::view(const QString &source,
|
||||
const QString &id,
|
||||
const QStringList &extraOptions)
|
||||
{
|
||||
QStringList args;
|
||||
@@ -563,22 +565,22 @@ void VcsBaseClient::view(const QString &source, const QString &id,
|
||||
VcsBaseEditor::getCodec(source), "view", id);
|
||||
|
||||
const QFileInfo fi(source);
|
||||
const QString workingDirPath = fi.isFile() ? fi.absolutePath() : source;
|
||||
const FilePath workingDirPath = FilePath::fromString(fi.isFile() ? fi.absolutePath() : source);
|
||||
enqueueJob(createCommand(workingDirPath, editor), args);
|
||||
}
|
||||
|
||||
void VcsBaseClient::update(const QString &repositoryRoot, const QString &revision,
|
||||
void VcsBaseClient::update(const FilePath &repositoryRoot, const QString &revision,
|
||||
const QStringList &extraOptions)
|
||||
{
|
||||
QStringList args(vcsCommandString(UpdateCommand));
|
||||
args << revisionSpec(revision) << extraOptions;
|
||||
VcsCommand *cmd = createCommand(repositoryRoot);
|
||||
cmd->setCookie(repositoryRoot);
|
||||
cmd->setCookie(repositoryRoot.toString());
|
||||
connect(cmd, &VcsCommand::success, this, &VcsBaseClient::changed, Qt::QueuedConnection);
|
||||
enqueueJob(cmd, args);
|
||||
}
|
||||
|
||||
void VcsBaseClient::commit(const QString &repositoryRoot,
|
||||
void VcsBaseClient::commit(const FilePath &repositoryRoot,
|
||||
const QStringList &files,
|
||||
const QString &commitMessageFile,
|
||||
const QStringList &extraOptions)
|
||||
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
const char *registerDynamicProperty,
|
||||
const QString &dynamicPropertyValue) const;
|
||||
|
||||
VcsCommand *createCommand(const QString &workingDirectory,
|
||||
VcsCommand *createCommand(const Utils::FilePath &workingDirectory,
|
||||
VcsBaseEditorWidget *editor = nullptr,
|
||||
JobOutputBindMode mode = NoOutputBind) const;
|
||||
|
||||
@@ -86,40 +86,38 @@ public:
|
||||
virtual Utils::Environment processEnvironment() const;
|
||||
|
||||
// VCS functionality:
|
||||
virtual VcsBaseEditorWidget *annotate(
|
||||
const QString &workingDir, const QString &file, const QString &revision = QString(),
|
||||
int lineNumber = -1, const QStringList &extraOptions = QStringList()) = 0;
|
||||
virtual VcsBaseEditorWidget *annotate(const Utils::FilePath &workingDir,
|
||||
const QString &file,
|
||||
const QString &revision = {},
|
||||
int lineNumber = -1,
|
||||
const QStringList &extraOptions = {}) = 0;
|
||||
|
||||
static QStringList splitLines(const QString &s);
|
||||
|
||||
static QString stripLastNewline(const QString &in);
|
||||
|
||||
// Fully synchronous VCS execution (QProcess-based)
|
||||
void vcsFullySynchronousExec(Utils::QtcProcess &process,
|
||||
const QString &workingDir, const QStringList &args,
|
||||
unsigned flags = 0, int timeoutS = -1, QTextCodec *codec = nullptr) const;
|
||||
void vcsFullySynchronousExec(Utils::QtcProcess &process,
|
||||
const QString &workingDir, const Utils::CommandLine &cmdLine,
|
||||
unsigned flags = 0, int timeoutS = -1, QTextCodec *codec = nullptr) const;
|
||||
void vcsFullySynchronousExec(Utils::QtcProcess &process,
|
||||
const Utils::FilePath &workingDir, const QStringList &args,
|
||||
unsigned flags = 0, int timeoutS = -1, QTextCodec *codec = nullptr) const;
|
||||
|
||||
void vcsFullySynchronousExec(Utils::QtcProcess &process,
|
||||
const Utils::FilePath &workingDir, const Utils::CommandLine &cmdLine,
|
||||
unsigned flags = 0, int timeoutS = -1, QTextCodec *codec = nullptr) const;
|
||||
|
||||
// Simple helper to execute a single command using createCommand and enqueueJob.
|
||||
VcsCommand *vcsExec(const QString &workingDirectory, const QStringList &arguments,
|
||||
VcsCommand *vcsExec(const Utils::FilePath &workingDirectory, const QStringList &arguments,
|
||||
VcsBaseEditorWidget *editor = nullptr, bool useOutputToWindow = false,
|
||||
unsigned additionalFlags = 0, const QVariant &cookie = QVariant()) const;
|
||||
unsigned additionalFlags = 0, const QVariant &cookie = {}) const;
|
||||
|
||||
protected:
|
||||
void resetCachedVcsInfo(const Utils::FilePath &workingDir);
|
||||
virtual void annotateRevisionRequested(const QString &workingDirectory, const QString &file,
|
||||
virtual void annotateRevisionRequested(const Utils::FilePath &workingDirectory, const QString &file,
|
||||
const QString &change, int line);
|
||||
|
||||
// Synchronous VCS execution using Utils::SynchronousProcess, with
|
||||
// log windows updating (using VcsBasePlugin::runVcs with flags)
|
||||
void vcsSynchronousExec(Utils::QtcProcess &proc,
|
||||
const QString &workingDir,
|
||||
const Utils::FilePath &workingDir,
|
||||
const QStringList &args,
|
||||
unsigned flags = 0,
|
||||
QTextCodec *outputCodec = nullptr) const;
|
||||
@@ -151,43 +149,55 @@ public:
|
||||
const QString &srcLocation,
|
||||
const QString &dstLocation,
|
||||
const QStringList &extraOptions = {});
|
||||
virtual bool synchronousAdd(const QString &workingDir, const QString &fileName,
|
||||
const QStringList &extraOptions = QStringList());
|
||||
virtual bool synchronousRemove(const QString &workingDir, const QString &fileName,
|
||||
const QStringList &extraOptions = QStringList());
|
||||
virtual bool synchronousMove(const QString &workingDir,
|
||||
virtual bool synchronousAdd(const Utils::FilePath &workingDir,
|
||||
const QString &relFileName,
|
||||
const QStringList &extraOptions = {});
|
||||
virtual bool synchronousRemove(const Utils::FilePath &workingDir,
|
||||
const QString &fileName,
|
||||
const QStringList &extraOptions = {});
|
||||
virtual bool synchronousMove(const Utils::FilePath &workingDir,
|
||||
const QString &from, const QString &to,
|
||||
const QStringList &extraOptions = QStringList());
|
||||
virtual bool synchronousPull(const QString &workingDir,
|
||||
const QStringList &extraOptions = {});
|
||||
virtual bool synchronousPull(const Utils::FilePath &workingDir,
|
||||
const QString &srcLocation,
|
||||
const QStringList &extraOptions = QStringList());
|
||||
virtual bool synchronousPush(const QString &workingDir,
|
||||
const QStringList &extraOptions = {});
|
||||
virtual bool synchronousPush(const Utils::FilePath &workingDir,
|
||||
const QString &dstLocation,
|
||||
const QStringList &extraOptions = QStringList());
|
||||
VcsBaseEditorWidget *annotate(
|
||||
const QString &workingDir, const QString &file, const QString &revision = QString(),
|
||||
int lineNumber = -1, const QStringList &extraOptions = QStringList()) override;
|
||||
virtual void diff(const QString &workingDir, const QStringList &files = QStringList(),
|
||||
const QStringList &extraOptions = QStringList());
|
||||
virtual void log(const QString &workingDir, const QStringList &files = QStringList(),
|
||||
const QStringList &extraOptions = QStringList(),
|
||||
const QStringList &extraOptions = {});
|
||||
VcsBaseEditorWidget *annotate(const Utils::FilePath &workingDir,
|
||||
const QString &file,
|
||||
const QString &revision = {},
|
||||
int lineNumber = -1,
|
||||
const QStringList &extraOptions = {}) override;
|
||||
virtual void diff(const Utils::FilePath &workingDir,
|
||||
const QStringList &files = {},
|
||||
const QStringList &extraOptions = {});
|
||||
virtual void log(const Utils::FilePath &workingDir,
|
||||
const QStringList &files = {},
|
||||
const QStringList &extraOptions = {},
|
||||
bool enableAnnotationContextMenu = false);
|
||||
virtual void status(const QString &workingDir, const QString &file = QString(),
|
||||
const QStringList &extraOptions = QStringList());
|
||||
virtual void emitParsedStatus(const QString &repository,
|
||||
const QStringList &extraOptions = QStringList());
|
||||
virtual void revertFile(const QString &workingDir, const QString &file,
|
||||
const QString &revision = QString(),
|
||||
const QStringList &extraOptions = QStringList());
|
||||
virtual void revertAll(const QString &workingDir, const QString &revision = QString(),
|
||||
const QStringList &extraOptions = QStringList());
|
||||
virtual void import(const QString &repositoryRoot, const QStringList &files,
|
||||
const QStringList &extraOptions = QStringList());
|
||||
virtual void update(const QString &repositoryRoot, const QString &revision = QString(),
|
||||
const QStringList &extraOptions = QStringList());
|
||||
virtual void commit(const QString &repositoryRoot, const QStringList &files,
|
||||
virtual void status(const Utils::FilePath &workingDir,
|
||||
const QString &file = {},
|
||||
const QStringList &extraOptions = {});
|
||||
virtual void emitParsedStatus(const Utils::FilePath &repository,
|
||||
const QStringList &extraOptions = {});
|
||||
virtual void revertFile(const Utils::FilePath &workingDir,
|
||||
const QString &file,
|
||||
const QString &revision = {},
|
||||
const QStringList &extraOptions = {});
|
||||
virtual void revertAll(const Utils::FilePath &workingDir,
|
||||
const QString &revision = {},
|
||||
const QStringList &extraOptions = {});
|
||||
virtual void import(const Utils::FilePath &repositoryRoot,
|
||||
const QStringList &files,
|
||||
const QStringList &extraOptions = {});
|
||||
virtual void update(const Utils::FilePath &repositoryRoot,
|
||||
const QString &revision = {},
|
||||
const QStringList &extraOptions = {});
|
||||
virtual void commit(const Utils::FilePath &repositoryRoot,
|
||||
const QStringList &files,
|
||||
const QString &commitMessageFile,
|
||||
const QStringList &extraOptions = QStringList());
|
||||
const QStringList &extraOptions = {});
|
||||
|
||||
virtual Utils::FilePath findTopLevelForFile(const Utils::FilePath &/*file*/) const { return {}; }
|
||||
|
||||
|
||||
@@ -241,7 +241,7 @@ void VcsBaseDiffEditorController::runCommand(const QList<QStringList> &args, uns
|
||||
// and "Waiting for data..." will be shown.
|
||||
d->cancelReload();
|
||||
|
||||
d->m_command = new VcsCommand(workingDirectory(), d->m_processEnvironment);
|
||||
d->m_command = new VcsCommand(FilePath::fromString(workingDirectory()), d->m_processEnvironment);
|
||||
d->m_command->setDisplayName(d->m_displayName);
|
||||
d->m_command->setCodec(codec ? codec : EditorManager::defaultTextCodec());
|
||||
d->m_commandResultProxy = new VcsCommandResultProxy(d->m_command.data(), d);
|
||||
|
||||
@@ -91,6 +91,7 @@
|
||||
\sa VcsBase::VcsBaseEditorWidget
|
||||
*/
|
||||
|
||||
using namespace Core;
|
||||
using namespace TextEditor;
|
||||
using namespace Utils;
|
||||
|
||||
@@ -836,14 +837,14 @@ void VcsBaseEditorWidget::setHighlightingEnabled(bool e)
|
||||
dh->setEnabled(e);
|
||||
}
|
||||
|
||||
QString VcsBaseEditorWidget::workingDirectory() const
|
||||
FilePath VcsBaseEditorWidget::workingDirectory() const
|
||||
{
|
||||
return d->m_workingDirectory;
|
||||
return FilePath::fromString(d->m_workingDirectory);
|
||||
}
|
||||
|
||||
void VcsBaseEditorWidget::setWorkingDirectory(const QString &wd)
|
||||
void VcsBaseEditorWidget::setWorkingDirectory(const FilePath &wd)
|
||||
{
|
||||
d->m_workingDirectory = wd;
|
||||
d->m_workingDirectory = wd.toString();
|
||||
}
|
||||
|
||||
QTextCodec *VcsBaseEditorWidget::codec() const
|
||||
@@ -1297,6 +1298,11 @@ QTextCodec *VcsBaseEditor::getCodec(const QString &source)
|
||||
return sys;
|
||||
}
|
||||
|
||||
QTextCodec *VcsBaseEditor::getCodec(const FilePath &workingDirectory, const QStringList &files)
|
||||
{
|
||||
return getCodec(workingDirectory.toString(), files);
|
||||
}
|
||||
|
||||
QTextCodec *VcsBaseEditor::getCodec(const QString &workingDirectory, const QStringList &files)
|
||||
{
|
||||
if (files.empty())
|
||||
@@ -1349,13 +1355,12 @@ bool VcsBaseEditor::gotoLineOfEditor(Core::IEditor *e, int lineNumber)
|
||||
|
||||
// Return source file or directory string depending on parameters
|
||||
// ('git diff XX' -> 'XX' , 'git diff XX file' -> 'XX/file').
|
||||
QString VcsBaseEditor::getSource(const QString &workingDirectory,
|
||||
const QString &fileName)
|
||||
QString VcsBaseEditor::getSource(const FilePath &workingDirectory, const QString &fileName)
|
||||
{
|
||||
if (fileName.isEmpty())
|
||||
return workingDirectory;
|
||||
return workingDirectory.toString();
|
||||
|
||||
QString rc = workingDirectory;
|
||||
QString rc = workingDirectory.toString();
|
||||
const QChar slash = QLatin1Char('/');
|
||||
if (!rc.isEmpty() && !(rc.endsWith(slash) || rc.endsWith(QLatin1Char('\\'))))
|
||||
rc += slash;
|
||||
@@ -1363,15 +1368,14 @@ QString VcsBaseEditor::getSource(const QString &workingDirectory,
|
||||
return rc;
|
||||
}
|
||||
|
||||
QString VcsBaseEditor::getSource(const QString &workingDirectory,
|
||||
const QStringList &fileNames)
|
||||
QString VcsBaseEditor::getSource(const FilePath &workingDirectory, const QStringList &fileNames)
|
||||
{
|
||||
return fileNames.size() == 1 ?
|
||||
getSource(workingDirectory, fileNames.front()) :
|
||||
workingDirectory;
|
||||
return fileNames.size() == 1
|
||||
? getSource(workingDirectory, fileNames.front())
|
||||
: workingDirectory.toString();
|
||||
}
|
||||
|
||||
QString VcsBaseEditor::getTitleId(const QString &workingDirectory,
|
||||
QString VcsBaseEditor::getTitleId(const FilePath &workingDirectory,
|
||||
const QStringList &fileNames,
|
||||
const QString &revision)
|
||||
{
|
||||
@@ -1384,7 +1388,7 @@ QString VcsBaseEditor::getTitleId(const QString &workingDirectory,
|
||||
QString rc;
|
||||
switch (nonEmptyFileNames.size()) {
|
||||
case 0:
|
||||
rc = workingDirectory;
|
||||
rc = workingDirectory.toString();
|
||||
break;
|
||||
case 1:
|
||||
rc = nonEmptyFileNames.front();
|
||||
@@ -1454,13 +1458,14 @@ QString VcsBaseEditorWidget::findDiffFile(const QString &f) const
|
||||
if (sourceFileInfo.isFile())
|
||||
return sourceFileInfo.absoluteFilePath();
|
||||
|
||||
const QString topLevel = Core::VcsManager::findTopLevelForDirectory(sourceDir);
|
||||
const FilePath topLevel =
|
||||
VcsManager::findTopLevelForDirectory(FilePath::fromString(sourceDir));
|
||||
if (topLevel.isEmpty())
|
||||
return QString();
|
||||
|
||||
const QFileInfo topLevelFileInfo(topLevel + slash + f);
|
||||
if (topLevelFileInfo.isFile())
|
||||
return topLevelFileInfo.absoluteFilePath();
|
||||
const FilePath topLevelFile = topLevel.pathAppended(f);
|
||||
if (topLevelFile.isFile())
|
||||
return topLevelFile.absoluteFilePath().toString();
|
||||
}
|
||||
|
||||
// 3) Try working directory
|
||||
@@ -1488,7 +1493,7 @@ void VcsBaseEditorWidget::slotAnnotateRevision()
|
||||
QString workingDirectory = d->m_workingDirectory;
|
||||
if (workingDirectory.isEmpty())
|
||||
workingDirectory = QFileInfo(fileName).absolutePath();
|
||||
emit annotateRevisionRequested(workingDirectory,
|
||||
emit annotateRevisionRequested(FilePath::fromString(workingDirectory),
|
||||
QDir(workingDirectory).relativeFilePath(fileName),
|
||||
a->data().toString(), currentLine);
|
||||
}
|
||||
|
||||
@@ -93,7 +93,8 @@ public:
|
||||
// The codec should be set on editors displaying diff or annotation
|
||||
// output.
|
||||
static QTextCodec *getCodec(const QString &source);
|
||||
static QTextCodec *getCodec(const QString &workingDirectory, const QStringList &files);
|
||||
static QTextCodec *getCodec(const Utils::FilePath &workingDirectory, const QStringList &files);
|
||||
static QTextCodec *getCodec(const QString &workingDirectory, const QStringList &files); // FIXME: Remove
|
||||
|
||||
// Utility to return the widget from the IEditor returned by the editor
|
||||
// manager which is a BaseTextEditor.
|
||||
@@ -111,13 +112,13 @@ public:
|
||||
// Convenience functions to determine the source to pass on to a diff
|
||||
// editor if one has a call consisting of working directory and file arguments.
|
||||
// ('git diff XX' -> 'XX' , 'git diff XX file' -> 'XX/file').
|
||||
static QString getSource(const QString &workingDirectory, const QString &fileName);
|
||||
static QString getSource(const QString &workingDirectory, const QStringList &fileNames);
|
||||
static QString getSource(const Utils::FilePath &workingDirectory, const QString &fileName);
|
||||
static QString getSource(const Utils::FilePath &workingDirectory, const QStringList &fileNames);
|
||||
// Convenience functions to determine an title/id to identify the editor
|
||||
// from the arguments (','-joined arguments or directory) + revision.
|
||||
static QString getTitleId(const QString &workingDirectory,
|
||||
static QString getTitleId(const Utils::FilePath &workingDirectory,
|
||||
const QStringList &fileNames,
|
||||
const QString &revision = QString());
|
||||
const QString &revision = {});
|
||||
|
||||
/* Tagging editors: Sometimes, an editor should be re-used, for example, when showing
|
||||
* a diff of the same file with different diff-options. In order to be able to find
|
||||
@@ -132,7 +133,7 @@ public:
|
||||
class VCSBASE_EXPORT VcsBaseEditorWidget : public TextEditor::TextEditorWidget
|
||||
{
|
||||
Q_PROPERTY(QString source READ source WRITE setSource)
|
||||
Q_PROPERTY(QString workingDirectory READ workingDirectory WRITE setWorkingDirectory)
|
||||
Q_PROPERTY(Utils::FilePath workingDirectory READ workingDirectory WRITE setWorkingDirectory)
|
||||
Q_PROPERTY(QTextCodec *codec READ codec WRITE setCodec)
|
||||
Q_PROPERTY(QString annotateRevisionTextFormat READ annotateRevisionTextFormat WRITE setAnnotateRevisionTextFormat)
|
||||
Q_PROPERTY(bool isFileLogAnnotateEnabled READ isFileLogAnnotateEnabled WRITE setFileLogAnnotateEnabled)
|
||||
@@ -198,8 +199,8 @@ public:
|
||||
void setCodec(QTextCodec *);
|
||||
|
||||
// Base directory for diff views
|
||||
QString workingDirectory() const;
|
||||
void setWorkingDirectory(const QString &wd);
|
||||
Utils::FilePath workingDirectory() const;
|
||||
void setWorkingDirectory(const Utils::FilePath &wd);
|
||||
|
||||
int firstLineNumber() const;
|
||||
void setFirstLineNumber(int firstLineNumber);
|
||||
@@ -220,7 +221,7 @@ signals:
|
||||
// handled by the editor manager for convenience. They are emitted
|
||||
// for LogOutput/AnnotateOutput content types.
|
||||
void describeRequested(const Utils::FilePath &source, const QString &change);
|
||||
void annotateRevisionRequested(const QString &workingDirectory, const QString &file,
|
||||
void annotateRevisionRequested(const Utils::FilePath &workingDirectory, const QString &file,
|
||||
const QString &change, int lineNumber);
|
||||
void diffChunkApplied(const VcsBase::DiffChunk &dc);
|
||||
void diffChunkReverted(const VcsBase::DiffChunk &dc);
|
||||
|
||||
@@ -227,14 +227,14 @@ StateListener::StateListener(QObject *parent) : QObject(parent)
|
||||
|
||||
QString StateListener::windowTitleVcsTopic(const QString &filePath)
|
||||
{
|
||||
QString searchPath;
|
||||
FilePath searchPath;
|
||||
if (!filePath.isEmpty()) {
|
||||
searchPath = QFileInfo(filePath).absolutePath();
|
||||
searchPath = FilePath::fromString(filePath).absolutePath();
|
||||
} else {
|
||||
// use single project's information if there is only one loaded.
|
||||
const QList<Project *> projects = SessionManager::projects();
|
||||
if (projects.size() == 1)
|
||||
searchPath = projects.first()->projectDirectory().toString();
|
||||
searchPath = projects.first()->projectDirectory();
|
||||
}
|
||||
if (searchPath.isEmpty())
|
||||
return QString();
|
||||
@@ -291,8 +291,8 @@ void StateListener::slotStateChanged()
|
||||
state.currentFileDirectory = currentFi.absolutePath();
|
||||
state.currentFileName = currentFi.fileName();
|
||||
}
|
||||
fileControl = VcsManager::findVersionControlForDirectory(state.currentFileDirectory,
|
||||
&state.currentFileTopLevel);
|
||||
fileControl = VcsManager::findVersionControlForDirectory(
|
||||
FilePath::fromString(state.currentFileDirectory), &state.currentFileTopLevel);
|
||||
}
|
||||
|
||||
if (!fileControl)
|
||||
@@ -308,8 +308,8 @@ void StateListener::slotStateChanged()
|
||||
if (currentProject) {
|
||||
state.currentProjectPath = currentProject->projectDirectory().toString();
|
||||
state.currentProjectName = currentProject->displayName();
|
||||
projectControl = VcsManager::findVersionControlForDirectory(state.currentProjectPath,
|
||||
&state.currentProjectTopLevel);
|
||||
projectControl = VcsManager::findVersionControlForDirectory(
|
||||
FilePath::fromString(state.currentProjectPath), &state.currentProjectTopLevel);
|
||||
if (projectControl) {
|
||||
// If we have both, let the file's one take preference
|
||||
if (fileControl && projectControl != fileControl)
|
||||
@@ -381,14 +381,14 @@ QString VcsBasePluginState::currentFileName() const
|
||||
return data->m_state.currentFileName;
|
||||
}
|
||||
|
||||
QString VcsBasePluginState::currentFileTopLevel() const
|
||||
FilePath VcsBasePluginState::currentFileTopLevel() const
|
||||
{
|
||||
return data->m_state.currentFileTopLevel;
|
||||
return FilePath::fromString(data->m_state.currentFileTopLevel);
|
||||
}
|
||||
|
||||
QString VcsBasePluginState::currentFileDirectory() const
|
||||
FilePath VcsBasePluginState::currentFileDirectory() const
|
||||
{
|
||||
return data->m_state.currentFileDirectory;
|
||||
return FilePath::fromString(data->m_state.currentFileDirectory);
|
||||
}
|
||||
|
||||
QString VcsBasePluginState::relativeCurrentFile() const
|
||||
@@ -407,9 +407,9 @@ QString VcsBasePluginState::currentPatchFileDisplayName() const
|
||||
return data->m_state.currentPatchFileDisplayName;
|
||||
}
|
||||
|
||||
QString VcsBasePluginState::currentProjectPath() const
|
||||
FilePath VcsBasePluginState::currentProjectPath() const
|
||||
{
|
||||
return data->m_state.currentProjectPath;
|
||||
return FilePath::fromString(data->m_state.currentProjectPath);
|
||||
}
|
||||
|
||||
QString VcsBasePluginState::currentProjectName() const
|
||||
@@ -417,9 +417,9 @@ QString VcsBasePluginState::currentProjectName() const
|
||||
return data->m_state.currentProjectName;
|
||||
}
|
||||
|
||||
QString VcsBasePluginState::currentProjectTopLevel() const
|
||||
FilePath VcsBasePluginState::currentProjectTopLevel() const
|
||||
{
|
||||
return data->m_state.currentProjectTopLevel;
|
||||
return FilePath::fromString(data->m_state.currentProjectTopLevel);
|
||||
}
|
||||
|
||||
QString VcsBasePluginState::relativeCurrentProject() const
|
||||
@@ -435,9 +435,9 @@ bool VcsBasePluginState::hasTopLevel() const
|
||||
return data->m_state.hasFile() || data->m_state.hasProject();
|
||||
}
|
||||
|
||||
QString VcsBasePluginState::topLevel() const
|
||||
FilePath VcsBasePluginState::topLevel() const
|
||||
{
|
||||
return hasFile() ? data->m_state.currentFileTopLevel : data->m_state.currentProjectTopLevel;
|
||||
return FilePath::fromString(hasFile() ? data->m_state.currentFileTopLevel : data->m_state.currentProjectTopLevel);
|
||||
}
|
||||
|
||||
bool VcsBasePluginState::equals(const Internal::State &rhs) const
|
||||
@@ -638,27 +638,28 @@ void VcsBasePluginPrivate::createRepository()
|
||||
{
|
||||
QTC_ASSERT(supportsOperation(IVersionControl::CreateRepositoryOperation), return);
|
||||
// Find current starting directory
|
||||
QString directory;
|
||||
FilePath directory;
|
||||
if (const Project *currentProject = ProjectTree::currentProject())
|
||||
directory = currentProject->projectFilePath().absolutePath().toString();
|
||||
directory = currentProject->projectFilePath().absolutePath();
|
||||
// Prompt for a directory that is not under version control yet
|
||||
QWidget *mw = ICore::dialogParent();
|
||||
do {
|
||||
directory = QFileDialog::getExistingDirectory(mw, tr("Choose Repository Directory"), directory);
|
||||
directory = FileUtils::getExistingDirectory(tr("Choose Repository Directory"), directory);
|
||||
if (directory.isEmpty())
|
||||
return;
|
||||
const IVersionControl *managingControl = VcsManager::findVersionControlForDirectory(directory);
|
||||
if (managingControl == nullptr)
|
||||
break;
|
||||
const QString question = tr("The directory \"%1\" is already managed by a version control system (%2)."
|
||||
" Would you like to specify another directory?").arg(directory, managingControl->displayName());
|
||||
" Would you like to specify another directory?")
|
||||
.arg(directory.toUserOutput(), managingControl->displayName());
|
||||
|
||||
if (!ask(mw, tr("Repository already under version control"), question))
|
||||
return;
|
||||
} while (true);
|
||||
// Create
|
||||
const bool rc = vcsCreateRepository(FilePath::fromString(directory));
|
||||
const QString nativeDir = QDir::toNativeSeparators(directory);
|
||||
const bool rc = vcsCreateRepository(directory);
|
||||
const QString nativeDir = directory.toUserOutput();
|
||||
if (rc) {
|
||||
QMessageBox::information(mw, tr("Repository Created"),
|
||||
tr("A version control repository has been created in %1.").
|
||||
|
||||
@@ -79,8 +79,8 @@ public:
|
||||
// Current file.
|
||||
QString currentFile() const;
|
||||
QString currentFileName() const;
|
||||
QString currentFileDirectory() const;
|
||||
QString currentFileTopLevel() const;
|
||||
Utils::FilePath currentFileDirectory() const;
|
||||
Utils::FilePath currentFileTopLevel() const;
|
||||
// Convenience: Returns file relative to top level.
|
||||
QString relativeCurrentFile() const;
|
||||
|
||||
@@ -90,9 +90,9 @@ public:
|
||||
QString currentPatchFileDisplayName() const;
|
||||
|
||||
// Current project.
|
||||
QString currentProjectPath() const;
|
||||
Utils::FilePath currentProjectPath() const;
|
||||
QString currentProjectName() const;
|
||||
QString currentProjectTopLevel() const;
|
||||
Utils::FilePath currentProjectTopLevel() const;
|
||||
/* Convenience: Returns project path relative to top level if it
|
||||
* differs from top level (else empty string) as an argument list to do
|
||||
* eg a 'vcs diff <args>' */
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
|
||||
// Top level directory for actions on the top level. Preferably
|
||||
// the file one.
|
||||
QString topLevel() const;
|
||||
Utils::FilePath topLevel() const;
|
||||
|
||||
bool equals(const VcsBasePluginState &rhs) const;
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ public:
|
||||
QToolBar *m_toolWidget = nullptr;
|
||||
VcsBaseSubmitEditorParameters m_parameters;
|
||||
QString m_displayName;
|
||||
QString m_checkScriptWorkingDirectory;
|
||||
FilePath m_checkScriptWorkingDirectory;
|
||||
SubmitEditorFile m_file;
|
||||
|
||||
QPointer<QAction> m_diffAction;
|
||||
@@ -352,10 +352,10 @@ Core::IDocument *VcsBaseSubmitEditor::document() const
|
||||
|
||||
QString VcsBaseSubmitEditor::checkScriptWorkingDirectory() const
|
||||
{
|
||||
return d->m_checkScriptWorkingDirectory;
|
||||
return d->m_checkScriptWorkingDirectory.toString();
|
||||
}
|
||||
|
||||
void VcsBaseSubmitEditor::setCheckScriptWorkingDirectory(const QString &s)
|
||||
void VcsBaseSubmitEditor::setCheckScriptWorkingDirectory(const FilePath &s)
|
||||
{
|
||||
d->m_checkScriptWorkingDirectory = s;
|
||||
}
|
||||
@@ -638,13 +638,13 @@ bool VcsBaseSubmitEditor::checkSubmitMessage(QString *errorMessage) const
|
||||
return rc;
|
||||
}
|
||||
|
||||
static inline QString msgCheckScript(const QString &workingDir, const QString &cmd)
|
||||
static QString msgCheckScript(const FilePath &workingDir, const QString &cmd)
|
||||
{
|
||||
const QString nativeCmd = QDir::toNativeSeparators(cmd);
|
||||
return workingDir.isEmpty() ?
|
||||
VcsBaseSubmitEditor::tr("Executing %1").arg(nativeCmd) :
|
||||
VcsBaseSubmitEditor::tr("Executing [%1] %2").
|
||||
arg(QDir::toNativeSeparators(workingDir), nativeCmd);
|
||||
arg(workingDir.toUserOutput(), nativeCmd);
|
||||
}
|
||||
|
||||
bool VcsBaseSubmitEditor::runSubmitMessageCheckScript(const QString &checkScript, QString *errorMessage) const
|
||||
|
||||
@@ -66,7 +66,6 @@ class VCSBASE_EXPORT VcsBaseSubmitEditor : public Core::IEditor
|
||||
Q_PROPERTY(QAbstractItemView::SelectionMode fileListSelectionMode READ fileListSelectionMode WRITE setFileListSelectionMode DESIGNABLE true)
|
||||
Q_PROPERTY(bool lineWrap READ lineWrap WRITE setLineWrap DESIGNABLE true)
|
||||
Q_PROPERTY(int lineWrapWidth READ lineWrapWidth WRITE setLineWrapWidth DESIGNABLE true)
|
||||
Q_PROPERTY(QString checkScriptWorkingDirectory READ checkScriptWorkingDirectory WRITE setCheckScriptWorkingDirectory DESIGNABLE true)
|
||||
Q_PROPERTY(bool emptyFileListEnabled READ isEmptyFileListEnabled WRITE setEmptyFileListEnabled DESIGNABLE true)
|
||||
|
||||
protected:
|
||||
@@ -106,7 +105,7 @@ public:
|
||||
void setLineWrapWidth(int);
|
||||
|
||||
QString checkScriptWorkingDirectory() const;
|
||||
void setCheckScriptWorkingDirectory(const QString &);
|
||||
void setCheckScriptWorkingDirectory(const Utils::FilePath &);
|
||||
|
||||
Core::IDocument *document() const override;
|
||||
|
||||
|
||||
@@ -37,11 +37,11 @@ using namespace Utils;
|
||||
|
||||
namespace VcsBase {
|
||||
|
||||
VcsCommand::VcsCommand(const QString &workingDirectory, const Environment &environment) :
|
||||
Core::ShellCommand(workingDirectory, environment),
|
||||
VcsCommand::VcsCommand(const FilePath &workingDirectory, const Environment &environment) :
|
||||
Core::ShellCommand(workingDirectory.toString(), environment),
|
||||
m_preventRepositoryChanged(false)
|
||||
{
|
||||
VcsOutputWindow::setRepository(workingDirectory);
|
||||
VcsOutputWindow::setRepository(workingDirectory.toString());
|
||||
setDisableUnixTerminal();
|
||||
m_sshPrompt = VcsBase::sshPrompt();
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
ExpectRepoChanges = 0x2000, // Expect changes in repository by the command
|
||||
};
|
||||
|
||||
VcsCommand(const QString &defaultWorkingDirectory, const Utils::Environment &environment);
|
||||
VcsCommand(const Utils::FilePath &defaultWorkingDirectory, const Utils::Environment &environment);
|
||||
|
||||
const Utils::Environment processEnvironment() const override;
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ Utils::OutputLineParser::Result VcsOutputLineParser::handleLine(const QString &t
|
||||
return {Status::Done, linkSpecs};
|
||||
}
|
||||
|
||||
bool VcsOutputLineParser::handleVcsLink(const QString &workingDirectory, const QString &href)
|
||||
bool VcsOutputLineParser::handleVcsLink(const FilePath &workingDirectory, const QString &href)
|
||||
{
|
||||
using namespace Core;
|
||||
QTC_ASSERT(!href.isEmpty(), return false);
|
||||
@@ -75,12 +75,12 @@ bool VcsOutputLineParser::handleVcsLink(const QString &workingDirectory, const Q
|
||||
return true;
|
||||
}
|
||||
if (IVersionControl *vcs = VcsManager::findVersionControlForDirectory(workingDirectory))
|
||||
return vcs->handleLink(FilePath::fromString(workingDirectory), href);
|
||||
return vcs->handleLink(workingDirectory, href);
|
||||
return false;
|
||||
}
|
||||
|
||||
void VcsOutputLineParser::fillLinkContextMenu(
|
||||
QMenu *menu, const QString &workingDirectory, const QString &href)
|
||||
QMenu *menu, const FilePath &workingDirectory, const QString &href)
|
||||
{
|
||||
QTC_ASSERT(!href.isEmpty(), return);
|
||||
if (href.startsWith("http://") || href.startsWith("https://")) {
|
||||
@@ -91,7 +91,7 @@ void VcsOutputLineParser::fillLinkContextMenu(
|
||||
return;
|
||||
}
|
||||
if (Core::IVersionControl *vcs = Core::VcsManager::findVersionControlForDirectory(workingDirectory))
|
||||
vcs->fillLinkContextMenu(menu, FilePath::fromString(workingDirectory), href);
|
||||
vcs->fillLinkContextMenu(menu, workingDirectory, href);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ class VcsOutputLineParser : public Utils::OutputLineParser
|
||||
Q_OBJECT
|
||||
public:
|
||||
VcsOutputLineParser();
|
||||
void fillLinkContextMenu(QMenu *menu, const QString &workingDirectory, const QString &href);
|
||||
bool handleVcsLink(const QString &workingDirectory, const QString &href);
|
||||
void fillLinkContextMenu(QMenu *menu, const Utils::FilePath &workingDirectory, const QString &href);
|
||||
bool handleVcsLink(const Utils::FilePath &workingDirectory, const QString &href);
|
||||
|
||||
private:
|
||||
Result handleLine(const QString &text, Utils::OutputFormat format) override;
|
||||
|
||||
@@ -177,7 +177,7 @@ void OutputWindowPlainTextEdit::contextMenuEvent(QContextMenuEvent *event)
|
||||
if (!repository.isEmpty()) {
|
||||
if (VcsOutputLineParser * const p = parser()) {
|
||||
if (!href.isEmpty())
|
||||
p->fillLinkContextMenu(menu, repository, href);
|
||||
p->fillLinkContextMenu(menu, FilePath::fromString(repository), href);
|
||||
}
|
||||
}
|
||||
QAction *openAction = nullptr;
|
||||
@@ -229,7 +229,7 @@ void OutputWindowPlainTextEdit::handleLink(const QPoint &pos)
|
||||
if (outputFormatter()->handleFileLink(href))
|
||||
return;
|
||||
if (VcsOutputLineParser * const p = parser())
|
||||
p->handleVcsLink(repository, href);
|
||||
p->handleVcsLink(FilePath::fromString(repository), href);
|
||||
}
|
||||
|
||||
void OutputWindowPlainTextEdit::appendLines(const QString &s, const QString &repository)
|
||||
|
||||
@@ -112,7 +112,7 @@ bool VcsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
[]() -> QString {
|
||||
IVersionControl *vc = nullptr;
|
||||
if (Project *project = ProjectTree::currentProject())
|
||||
vc = VcsManager::findVersionControlForDirectory(project->projectDirectory().toString());
|
||||
vc = VcsManager::findVersionControlForDirectory(project->projectDirectory());
|
||||
return vc ? vc->displayName() : QString();
|
||||
});
|
||||
|
||||
@@ -122,7 +122,7 @@ bool VcsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
IVersionControl *vc = nullptr;
|
||||
QString topLevel;
|
||||
if (Project *project = ProjectTree::currentProject())
|
||||
vc = VcsManager::findVersionControlForDirectory(project->projectDirectory().toString(), &topLevel);
|
||||
vc = VcsManager::findVersionControlForDirectory(project->projectDirectory(), &topLevel);
|
||||
return vc ? vc->vcsTopic(FilePath::fromString(topLevel)) : QString();
|
||||
});
|
||||
|
||||
@@ -130,7 +130,7 @@ bool VcsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
tr("The top level path to the repository the current project is in."),
|
||||
[]() -> QString {
|
||||
if (Project *project = ProjectTree::currentProject())
|
||||
return VcsManager::findTopLevelForDirectory(project->projectDirectory().toString());
|
||||
return VcsManager::findTopLevelForDirectory(project->projectDirectory()).toString();
|
||||
return QString();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user