forked from qt-creator/qt-creator
Rename some methods and variables in DiffEditor
Change-Id: Ic6db2882c9468b9451a785e4657e4255b40fca4c Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -137,12 +137,12 @@ void DiffEditorController::setReloader(DiffEditorReloader *reloader)
|
||||
return; // nothing changes
|
||||
|
||||
if (m_reloader)
|
||||
m_reloader->setDiffEditorController(0);
|
||||
m_reloader->setController(0);
|
||||
|
||||
m_reloader = reloader;
|
||||
|
||||
if (m_reloader)
|
||||
m_reloader->setDiffEditorController(this);
|
||||
m_reloader->setController(this);
|
||||
|
||||
reloaderChanged(m_reloader);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace DiffEditor {
|
||||
|
||||
DiffEditorDocument::DiffEditorDocument() :
|
||||
Core::TextDocument(),
|
||||
m_diffEditorController(new DiffEditorController(this))
|
||||
m_controller(new DiffEditorController(this))
|
||||
{
|
||||
setId(Constants::DIFF_EDITOR_ID);
|
||||
setTemporary(true);
|
||||
@@ -55,7 +55,7 @@ DiffEditorDocument::~DiffEditorDocument()
|
||||
|
||||
DiffEditorController *DiffEditorDocument::controller() const
|
||||
{
|
||||
return m_diffEditorController;
|
||||
return m_controller;
|
||||
}
|
||||
|
||||
bool DiffEditorDocument::setContents(const QByteArray &contents)
|
||||
@@ -66,10 +66,10 @@ bool DiffEditorDocument::setContents(const QByteArray &contents)
|
||||
|
||||
QString DiffEditorDocument::defaultPath() const
|
||||
{
|
||||
if (!m_diffEditorController)
|
||||
if (!m_controller)
|
||||
return QString();
|
||||
|
||||
return m_diffEditorController->workingDirectory();
|
||||
return m_controller->workingDirectory();
|
||||
}
|
||||
|
||||
bool DiffEditorDocument::save(QString *errorString, const QString &fileName, bool autoSave)
|
||||
@@ -77,10 +77,10 @@ bool DiffEditorDocument::save(QString *errorString, const QString &fileName, boo
|
||||
Q_UNUSED(errorString)
|
||||
Q_UNUSED(autoSave)
|
||||
|
||||
if (!m_diffEditorController)
|
||||
if (!m_controller)
|
||||
return false;
|
||||
|
||||
const QString contents = DiffUtils::makePatch(m_diffEditorController->diffFiles());
|
||||
const QString contents = DiffUtils::makePatch(m_controller->diffFiles());
|
||||
|
||||
const bool ok = write(fileName, format(), contents, errorString);
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
|
||||
|
||||
private:
|
||||
DiffEditorController *m_diffEditorController;
|
||||
DiffEditorController *m_controller;
|
||||
};
|
||||
|
||||
} // namespace DiffEditor
|
||||
|
||||
@@ -108,7 +108,7 @@ void SimpleDiffEditorReloader::reload()
|
||||
QList<Diff> outputLeftDiffList;
|
||||
QList<Diff> outputRightDiffList;
|
||||
|
||||
if (diffEditorController()->isIgnoreWhitespace()) {
|
||||
if (controller()->isIgnoreWhitespace()) {
|
||||
const QList<Diff> leftIntermediate =
|
||||
Differ::moveWhitespaceIntoEqualities(leftDiffList);
|
||||
const QList<Diff> rightIntermediate =
|
||||
@@ -125,14 +125,14 @@ void SimpleDiffEditorReloader::reload()
|
||||
const ChunkData chunkData = DiffUtils::calculateOriginalData(
|
||||
outputLeftDiffList, outputRightDiffList);
|
||||
FileData fileData = DiffUtils::calculateContextData(
|
||||
chunkData, diffEditorController()->contextLinesNumber(), 0);
|
||||
chunkData, controller()->contextLinesNumber(), 0);
|
||||
fileData.leftFileInfo.fileName = m_leftFileName;
|
||||
fileData.rightFileInfo.fileName = m_rightFileName;
|
||||
|
||||
QList<FileData> fileDataList;
|
||||
fileDataList << fileData;
|
||||
|
||||
diffEditorController()->setDiffFiles(fileDataList);
|
||||
controller()->setDiffFiles(fileDataList);
|
||||
|
||||
reloadFinished();
|
||||
}
|
||||
|
||||
@@ -44,12 +44,12 @@ DiffEditorReloader::~DiffEditorReloader()
|
||||
|
||||
}
|
||||
|
||||
DiffEditorController *DiffEditorReloader::diffEditorController() const
|
||||
DiffEditorController *DiffEditorReloader::controller() const
|
||||
{
|
||||
return m_controller;
|
||||
}
|
||||
|
||||
void DiffEditorReloader::setDiffEditorController(DiffEditorController *controller)
|
||||
void DiffEditorReloader::setController(DiffEditorController *controller)
|
||||
{
|
||||
if (m_controller == controller)
|
||||
return; // nothing changes
|
||||
|
||||
@@ -55,8 +55,8 @@ protected:
|
||||
// inside reload() (for synchronous reload)
|
||||
// or later (for asynchronous reload)
|
||||
virtual void reload() = 0;
|
||||
DiffEditorController *diffEditorController() const;
|
||||
void setDiffEditorController(DiffEditorController *diffEditorController);
|
||||
DiffEditorController *controller() const;
|
||||
void setController(DiffEditorController *controller);
|
||||
|
||||
protected slots:
|
||||
void reloadFinished();
|
||||
|
||||
Reference in New Issue
Block a user