forked from qt-creator/qt-creator
Revert "DiffEditorController: Add an option to set a syntax highlighter"
This reverts commit364beabcf1. Reason for revert: Not needed anymore afterbf823eb581Change-Id: I8f1d4db7d8b3a216e808ec431f002c1199fb919c Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
@@ -147,7 +147,6 @@ private:
|
|||||||
void documentHasChanged();
|
void documentHasChanged();
|
||||||
void toggleDescription();
|
void toggleDescription();
|
||||||
void updateDescription();
|
void updateDescription();
|
||||||
void updateDescriptionHighlighter();
|
|
||||||
void contextLineCountHasChanged(int lines);
|
void contextLineCountHasChanged(int lines);
|
||||||
void ignoreWhitespaceHasChanged();
|
void ignoreWhitespaceHasChanged();
|
||||||
void prepareForReload();
|
void prepareForReload();
|
||||||
@@ -300,8 +299,6 @@ void DiffEditor::setDocument(std::shared_ptr<DiffEditorDocument> doc)
|
|||||||
this, &DiffEditor::documentHasChanged);
|
this, &DiffEditor::documentHasChanged);
|
||||||
connect(m_document.get(), &DiffEditorDocument::descriptionChanged,
|
connect(m_document.get(), &DiffEditorDocument::descriptionChanged,
|
||||||
this, &DiffEditor::updateDescription);
|
this, &DiffEditor::updateDescription);
|
||||||
connect(m_document.get(), &DiffEditorDocument::descriptionHighlighterChanged,
|
|
||||||
this, &DiffEditor::updateDescriptionHighlighter);
|
|
||||||
connect(m_document.get(), &DiffEditorDocument::aboutToReload,
|
connect(m_document.get(), &DiffEditorDocument::aboutToReload,
|
||||||
this, &DiffEditor::prepareForReload);
|
this, &DiffEditor::prepareForReload);
|
||||||
connect(m_document.get(), &DiffEditorDocument::reloadFinished,
|
connect(m_document.get(), &DiffEditorDocument::reloadFinished,
|
||||||
@@ -459,13 +456,6 @@ void DiffEditor::updateDescription()
|
|||||||
m_toggleDescriptionAction->setVisible(!description.isEmpty());
|
m_toggleDescriptionAction->setVisible(!description.isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiffEditor::updateDescriptionHighlighter()
|
|
||||||
{
|
|
||||||
const auto creator = m_document->descriptionSyntaxHighlighterCreator();
|
|
||||||
if (creator)
|
|
||||||
m_descriptionWidget->textDocument()->resetSyntaxHighlighter(creator);
|
|
||||||
}
|
|
||||||
|
|
||||||
void DiffEditor::contextLineCountHasChanged(int lines)
|
void DiffEditor::contextLineCountHasChanged(int lines)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(!m_document->isContextLineCountForced(), return);
|
QTC_ASSERT(!m_document->isContextLineCountForced(), return);
|
||||||
|
|||||||
@@ -93,12 +93,6 @@ void DiffEditorController::setDescription(const QString &description)
|
|||||||
m_document->setDescription(description);
|
m_document->setDescription(description);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiffEditorController::setDescriptionSyntaxHighlighterCreator(
|
|
||||||
const std::function<TextEditor::SyntaxHighlighter *()> &creator)
|
|
||||||
{
|
|
||||||
m_document->setDescriptionSyntaxHighlighterCreator(creator);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Force the lines of context to the given number.
|
* @brief Force the lines of context to the given number.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ class QMenu;
|
|||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Core { class IDocument; }
|
namespace Core { class IDocument; }
|
||||||
namespace TextEditor { class SyntaxHighlighter; }
|
|
||||||
namespace Utils { class FilePath; }
|
namespace Utils { class FilePath; }
|
||||||
|
|
||||||
namespace DiffEditor {
|
namespace DiffEditor {
|
||||||
@@ -65,8 +64,6 @@ protected:
|
|||||||
void setDisplayName(const QString &name) { m_displayName = name; }
|
void setDisplayName(const QString &name) { m_displayName = name; }
|
||||||
void setAnsiEnabled(bool enabled);
|
void setAnsiEnabled(bool enabled);
|
||||||
void setDescription(const QString &description);
|
void setDescription(const QString &description);
|
||||||
void setDescriptionSyntaxHighlighterCreator(
|
|
||||||
const std::function<TextEditor::SyntaxHighlighter *()> &creator);
|
|
||||||
void setStartupFile(const QString &startupFile);
|
void setStartupFile(const QString &startupFile);
|
||||||
void forceContextLineCount(int lines);
|
void forceContextLineCount(int lines);
|
||||||
|
|
||||||
|
|||||||
@@ -179,13 +179,6 @@ void DiffEditorDocument::setDescription(const QString &description)
|
|||||||
emit descriptionChanged();
|
emit descriptionChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiffEditorDocument::setDescriptionSyntaxHighlighterCreator(
|
|
||||||
const std::function<TextEditor::SyntaxHighlighter *()> &creator)
|
|
||||||
{
|
|
||||||
m_descriptionHighlighter = creator;
|
|
||||||
emit descriptionHighlighterChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString DiffEditorDocument::description() const
|
QString DiffEditorDocument::description() const
|
||||||
{
|
{
|
||||||
return m_description;
|
return m_description;
|
||||||
|
|||||||
@@ -8,8 +8,6 @@
|
|||||||
#include <coreplugin/patchtool.h>
|
#include <coreplugin/patchtool.h>
|
||||||
#include <coreplugin/textdocument.h>
|
#include <coreplugin/textdocument.h>
|
||||||
|
|
||||||
namespace TextEditor { class SyntaxHighlighter; }
|
|
||||||
|
|
||||||
namespace DiffEditor {
|
namespace DiffEditor {
|
||||||
|
|
||||||
class DiffEditorController;
|
class DiffEditorController;
|
||||||
@@ -49,11 +47,6 @@ public:
|
|||||||
QString description() const;
|
QString description() const;
|
||||||
void setDescriptionAnsiEnabled(bool enabled) { m_descriptionAnsiEnabled = enabled; }
|
void setDescriptionAnsiEnabled(bool enabled) { m_descriptionAnsiEnabled = enabled; }
|
||||||
bool isDescriptionAnsiEnabled() const { return m_descriptionAnsiEnabled; }
|
bool isDescriptionAnsiEnabled() const { return m_descriptionAnsiEnabled; }
|
||||||
void setDescriptionSyntaxHighlighterCreator(
|
|
||||||
const std::function<TextEditor::SyntaxHighlighter *()> &creator);
|
|
||||||
std::function<TextEditor::SyntaxHighlighter *()> descriptionSyntaxHighlighterCreator() const {
|
|
||||||
return m_descriptionHighlighter;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setContextLineCount(int lines);
|
void setContextLineCount(int lines);
|
||||||
int contextLineCount() const;
|
int contextLineCount() const;
|
||||||
@@ -80,7 +73,6 @@ signals:
|
|||||||
void temporaryStateChanged();
|
void temporaryStateChanged();
|
||||||
void documentChanged();
|
void documentChanged();
|
||||||
void descriptionChanged();
|
void descriptionChanged();
|
||||||
void descriptionHighlighterChanged();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool saveImpl(QString *errorString, const Utils::FilePath &filePath, bool autoSave) override;
|
bool saveImpl(QString *errorString, const Utils::FilePath &filePath, bool autoSave) override;
|
||||||
@@ -95,7 +87,6 @@ private:
|
|||||||
Utils::FilePath m_workingDirectory;
|
Utils::FilePath m_workingDirectory;
|
||||||
QString m_startupFile;
|
QString m_startupFile;
|
||||||
QString m_description;
|
QString m_description;
|
||||||
std::function<TextEditor::SyntaxHighlighter *()> m_descriptionHighlighter = {};
|
|
||||||
int m_contextLineCount = 3;
|
int m_contextLineCount = 3;
|
||||||
bool m_isContextLineCountForced = false;
|
bool m_isContextLineCountForced = false;
|
||||||
bool m_ignoreWhitespace = false;
|
bool m_ignoreWhitespace = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user