Commit 2da85dc6 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

VCS: Rename diffBaseDirectory -> workingDirectory

Can have other usages than diff

Change-Id: Ieb01a88eb95503ac89b2f2c1120eddf404cdce5a
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 7b08d993
......@@ -612,10 +612,10 @@ void ClearCasePlugin::diffCheckInFiles(const QStringList &files)
ccDiffWithPred(m_checkInView, files);
}
static inline void setDiffBaseDirectory(IEditor *editor, const QString &db)
static inline void setWorkingDirectory(IEditor *editor, const QString &wd)
{
if (VcsBase::VcsBaseEditorWidget *ve = qobject_cast<VcsBase::VcsBaseEditorWidget*>(editor->widget()))
ve->setDiffBaseDirectory(db);
ve->setWorkingDirectory(wd);
}
//! retrieve full location of predecessor of \a version
......@@ -934,14 +934,14 @@ void ClearCasePlugin::ccDiffWithPred(const QString &workingDir, const QStringLis
if (IEditor *existingEditor = VcsBase::VcsBaseEditorWidget::locateEditorByTag(tag)) {
existingEditor->document()->setContents(result.toUtf8());
EditorManager::activateEditor(existingEditor);
setDiffBaseDirectory(existingEditor, workingDir);
setWorkingDirectory(existingEditor, workingDir);
return;
}
diffname = QDir::toNativeSeparators(files.first());
}
const QString title = QString::fromLatin1("cc diff %1").arg(diffname);
IEditor *editor = showOutputInEditor(title, result, VcsBase::DiffOutput, source, codec);
setDiffBaseDirectory(editor, workingDir);
setWorkingDirectory(editor, workingDir);
VcsBase::VcsBaseEditorWidget::tagEditor(editor, tag);
ClearCaseEditor *diffEditorWidget = qobject_cast<ClearCaseEditor *>(editor->widget());
QTC_ASSERT(diffEditorWidget, return);
......@@ -1037,7 +1037,7 @@ void ClearCasePlugin::diffActivity()
m_diffPrefix.clear();
const QString title = QString::fromLatin1("%1.patch").arg(activity);
IEditor *editor = showOutputInEditor(title, result, VcsBase::DiffOutput, activity, 0);
setDiffBaseDirectory(editor, topLevel);
setWorkingDirectory(editor, topLevel);
}
void ClearCasePlugin::diffCurrentFile()
......
......@@ -503,7 +503,7 @@ void CvsPlugin::diffCommitFiles(const QStringList &files)
static void setDiffBaseDirectory(IEditor *editor, const QString &db)
{
if (VcsBaseEditorWidget *ve = qobject_cast<VcsBaseEditorWidget*>(editor->widget()))
ve->setDiffBaseDirectory(db);
ve->setWorkingDirectory(db);
}
// Collect all parameters required for a diff to be able to associate them
......
......@@ -1122,7 +1122,7 @@ void GitClient::diff(const QString &workingDirectory,
vcsEditor->configurationWidget());
argWidget->setFileNames(unstagedFileNames, stagedFileNames);
QStringList userDiffArgs = argWidget->arguments();
vcsEditor->setDiffBaseDirectory(workingDirectory);
vcsEditor->setWorkingDirectory(workingDirectory);
// Create a batch of 2 commands to be run after each other in case
// we have a mixture of staged/unstaged files as is the case
......@@ -1220,7 +1220,7 @@ void GitClient::diff(const QString &workingDirectory, const QString &fileName)
connect(vcsEditor, SIGNAL(diffChunkReverted(VcsBase::DiffChunk)),
argWidget, SLOT(executeCommand()));
}
vcsEditor->setDiffBaseDirectory(workingDirectory);
vcsEditor->setWorkingDirectory(workingDirectory);
QStringList cmdArgs;
cmdArgs << QLatin1String("diff")
......@@ -1280,7 +1280,7 @@ void GitClient::diffBranch(const QString &workingDirectory,
branchName));
newEditor = vcsEditor->editor();
}
vcsEditor->setDiffBaseDirectory(workingDirectory);
vcsEditor->setWorkingDirectory(workingDirectory);
QStringList cmdArgs;
cmdArgs << QLatin1String("diff")
......@@ -1331,7 +1331,7 @@ void GitClient::log(const QString &workingDirectory, const QString &fileName,
enableAnnotationContextMenu,
args, fileName));
editor->setFileLogAnnotateEnabled(enableAnnotationContextMenu);
editor->setDiffBaseDirectory(workingDirectory);
editor->setWorkingDirectory(workingDirectory);
QStringList arguments;
arguments << QLatin1String("log") << QLatin1String(noColorOption)
......@@ -1444,7 +1444,7 @@ void GitClient::show(const QString &source, const QString &id,
<< vcsEditor->configurationWidget()->arguments()
<< id;
vcsEditor->setDiffBaseDirectory(workingDirectory);
vcsEditor->setWorkingDirectory(workingDirectory);
executeGit(workingDirectory, arguments, vcsEditor);
}
if (newEditor) {
......
......@@ -249,7 +249,7 @@ void GitEditor::applyDiffChunk(const VcsBase::DiffChunk& chunk, bool revert)
if (!patchFile.open())
return;
const QString baseDir = diffBaseDirectory();
const QString baseDir = workingDirectory();
patchFile.write(chunk.header);
patchFile.write(chunk.chunk);
patchFile.close();
......
......@@ -545,10 +545,10 @@ void SubversionDiffParameterWidget::triggerReRun()
emit reRunDiff(effectiveParameters);
}
static inline void setDiffBaseDirectory(Core::IEditor *editor, const QString &db)
static inline void setWorkingDirectory(Core::IEditor *editor, const QString &wd)
{
if (VcsBase::VcsBaseEditorWidget *ve = qobject_cast<VcsBase::VcsBaseEditorWidget*>(editor->widget()))
ve->setDiffBaseDirectory(db);
ve->setWorkingDirectory(wd);
}
void SubversionPlugin::svnDiff(const QString &workingDir, const QStringList &files, QString diffname)
......@@ -590,12 +590,12 @@ void SubversionPlugin::svnDiff(const Subversion::Internal::SubversionDiffParamet
if (Core::IEditor *existingEditor = VcsBase::VcsBaseEditorWidget::locateEditorByTag(tag)) {
existingEditor->document()->setContents(response.stdOut.toUtf8());
Core::EditorManager::activateEditor(existingEditor);
setDiffBaseDirectory(existingEditor, p.workingDir);
setWorkingDirectory(existingEditor, p.workingDir);
return;
}
const QString title = QString::fromLatin1("svn diff %1").arg(diffName);
Core::IEditor *editor = showOutputInEditor(title, response.stdOut, VcsBase::DiffOutput, source, codec);
setDiffBaseDirectory(editor, p.workingDir);
setWorkingDirectory(editor, p.workingDir);
VcsBase::VcsBaseEditorWidget::tagEditor(editor, tag);
SubversionEditor *diffEditorWidget = qobject_cast<SubversionEditor *>(editor->widget());
QTC_ASSERT(diffEditorWidget, return);
......
......@@ -355,7 +355,7 @@ void VcsBaseClient::diff(const QString &workingDir, const QStringList &files,
const QString source = VcsBase::VcsBaseEditorWidget::getSource(workingDir, files);
VcsBase::VcsBaseEditorWidget *editor = createVcsEditor(kind, title, source, true,
vcsCmdString.toLatin1().constData(), id);
editor->setDiffBaseDirectory(workingDir);
editor->setWorkingDirectory(workingDir);
VcsBaseEditorParameterWidget *paramWidget = createDiffEditor(workingDir, files, extraOptions);
if (paramWidget != 0) {
......
......@@ -563,7 +563,7 @@ public:
const VcsBaseEditorParameters *m_parameters;
QString m_source;
QString m_diffBaseDirectory;
QString m_workingDirectory;
QRegExp m_diffFilePattern;
QRegExp m_logEntryPattern;
......@@ -779,14 +779,14 @@ void VcsBaseEditorWidget::setFileLogAnnotateEnabled(bool e)
d->m_fileLogAnnotateEnabled = e;
}
QString VcsBaseEditorWidget::diffBaseDirectory() const
QString VcsBaseEditorWidget::workingDirectory() const
{
return d->m_diffBaseDirectory;
return d->m_workingDirectory;
}
void VcsBaseEditorWidget::setDiffBaseDirectory(const QString &bd)
void VcsBaseEditorWidget::setWorkingDirectory(const QString &wd)
{
d->m_diffBaseDirectory = bd;
d->m_workingDirectory = wd;
}
QTextCodec *VcsBaseEditorWidget::codec() const
......@@ -1370,8 +1370,8 @@ QString VcsBaseEditorWidget::findDiffFile(const QString &f) const
// 1) Try base dir
const QChar slash = QLatin1Char('/');
if (!d->m_diffBaseDirectory.isEmpty()) {
const QFileInfo baseFileInfo(d->m_diffBaseDirectory + slash + f);
if (!d->m_workingDirectory.isEmpty()) {
const QFileInfo baseFileInfo(d->m_workingDirectory + slash + f);
if (baseFileInfo.isFile())
return baseFileInfo.absoluteFilePath();
}
......@@ -1451,8 +1451,8 @@ bool VcsBaseEditorWidget::canApplyDiffChunk(const DiffChunk &dc) const
// (passing '-R' for revert), assuming we got absolute paths from the VCS plugins.
bool VcsBaseEditorWidget::applyDiffChunk(const DiffChunk &dc, bool revert) const
{
return VcsBasePlugin::runPatch(dc.asPatch(d->m_diffBaseDirectory),
d->m_diffBaseDirectory, 0, revert);
return VcsBasePlugin::runPatch(dc.asPatch(d->m_workingDirectory),
d->m_workingDirectory, 0, revert);
}
QString VcsBaseEditorWidget::fileNameFromDiffSpecification(const QTextBlock &inBlock, QString *header) const
......
......@@ -90,7 +90,7 @@ public:
class VCSBASE_EXPORT VcsBaseEditorWidget : public TextEditor::BaseTextEditorWidget
{
Q_PROPERTY(QString source READ source WRITE setSource)
Q_PROPERTY(QString diffBaseDirectory READ diffBaseDirectory WRITE setDiffBaseDirectory)
Q_PROPERTY(QString workingDirectory READ workingDirectory WRITE setWorkingDirectory)
Q_PROPERTY(QTextCodec *codec READ codec WRITE setCodec)
Q_PROPERTY(QString annotateRevisionTextFormat READ annotateRevisionTextFormat WRITE setAnnotateRevisionTextFormat)
Q_PROPERTY(QString copyRevisionTextFormat READ copyRevisionTextFormat WRITE setCopyRevisionTextFormat)
......@@ -144,8 +144,8 @@ public:
void setCodec(QTextCodec *);
// Base directory for diff views
QString diffBaseDirectory() const;
void setDiffBaseDirectory(const QString &d);
QString workingDirectory() const;
void setWorkingDirectory(const QString &wd);
bool isModified() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment