Commit b556ba50 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by hjk
Browse files

TextEditor: Remove unneeded qualifications



Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
  next if file =~ %r{src/shared/qbs|/qmljs/}
  s = File.read(file)
  s.scan(/^using namespace (.*);$/) {
    ns = $1
    t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
      before = $1
      char = $2
      if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
        m
      else
        before + char
      end
    }
    if t != s
      puts file
      File.open(file, 'w').write(t)
    end
  }
}

Change-Id: Ief087658e2adc337ee02c49f0fb406597114df07
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent 69ac7f8d
......@@ -90,10 +90,10 @@ void AutoCompleter::countBrackets(QTextCursor cursor,
cursor.setPosition(from);
QTextBlock block = cursor.block();
while (block.isValid() && block.position() < end) {
TextEditor::Parentheses parenList = TextEditor::TextDocumentLayout::parentheses(block);
if (!parenList.isEmpty() && !TextEditor::TextDocumentLayout::ifdefedOut(block)) {
Parentheses parenList = TextDocumentLayout::parentheses(block);
if (!parenList.isEmpty() && !TextDocumentLayout::ifdefedOut(block)) {
for (int i = 0; i < parenList.count(); ++i) {
TextEditor::Parenthesis paren = parenList.at(i);
Parenthesis paren = parenList.at(i);
int position = block.position() + paren.pos;
if (position < from || position >= end)
continue;
......@@ -151,10 +151,10 @@ QString AutoCompleter::autoComplete(QTextCursor &cursor, const QString &textToIn
const QString brackets = QLatin1String("[]");
if (parentheses.contains(character) || brackets.contains(character)) {
QTextCursor tmp= cursor;
bool foundBlockStart = TextEditor::TextBlockUserData::findPreviousBlockOpenParenthesis(&tmp);
bool foundBlockStart = TextBlockUserData::findPreviousBlockOpenParenthesis(&tmp);
int blockStart = foundBlockStart ? tmp.position() : 0;
tmp = cursor;
bool foundBlockEnd = TextEditor::TextBlockUserData::findNextBlockClosingParenthesis(&tmp);
bool foundBlockEnd = TextBlockUserData::findNextBlockClosingParenthesis(&tmp);
int blockEnd = foundBlockEnd ? tmp.position() : (cursor.document()->characterCount() - 1);
const QChar openChar = parentheses.contains(character) ? QLatin1Char('(') : QLatin1Char('[');
const QChar closeChar = parentheses.contains(character) ? QLatin1Char(')') : QLatin1Char(']');
......@@ -218,10 +218,10 @@ bool AutoCompleter::autoBackspace(QTextCursor &cursor)
const QChar character = lookBehind;
if (character == QLatin1Char('(') || character == QLatin1Char('[')) {
QTextCursor tmp = cursor;
TextEditor::TextBlockUserData::findPreviousBlockOpenParenthesis(&tmp);
TextBlockUserData::findPreviousBlockOpenParenthesis(&tmp);
int blockStart = tmp.isNull() ? 0 : tmp.position();
tmp = cursor;
TextEditor::TextBlockUserData::findNextBlockClosingParenthesis(&tmp);
TextBlockUserData::findNextBlockClosingParenthesis(&tmp);
int blockEnd = tmp.isNull() ? (cursor.document()->characterCount()-1) : tmp.position();
QChar openChar = character;
QChar closeChar = (character == QLatin1Char('(')) ? QLatin1Char(')') : QLatin1Char(']');
......
......@@ -55,6 +55,9 @@
#include <QLabel>
#include <QLabel>
using namespace Utils;
using namespace Core;
namespace TextEditor {
namespace Internal {
......@@ -63,8 +66,8 @@ class BaseFileFindPrivate
public:
BaseFileFindPrivate() : m_resultLabel(0), m_filterCombo(0) {}
QMap<QFutureWatcher<Utils::FileSearchResultList> *, QPointer<Core::SearchResult> > m_watchers;
QPointer<Core::IFindSupport> m_currentFindSupport;
QMap<QFutureWatcher<FileSearchResultList> *, QPointer<SearchResult> > m_watchers;
QPointer<IFindSupport> m_currentFindSupport;
QLabel *m_resultLabel;
QStringListModel m_filterStrings;
......@@ -75,8 +78,6 @@ public:
} // namespace Internal
using namespace Internal;
using namespace Utils;
using namespace Core;
BaseFileFind::BaseFileFind() : d(new BaseFileFindPrivate)
{
......@@ -125,15 +126,15 @@ QStringList BaseFileFind::fileNameFilters() const
return filters;
}
void BaseFileFind::runNewSearch(const QString &txt, Core::FindFlags findFlags,
void BaseFileFind::runNewSearch(const QString &txt, FindFlags findFlags,
SearchResultWindow::SearchMode searchMode)
{
d->m_currentFindSupport = 0;
if (d->m_filterCombo)
updateComboEntries(d->m_filterCombo, true);
SearchResult *search = Core::SearchResultWindow::instance()->startNewSearch(label(),
toolTip().arg(Core::IFindFilter::descriptionForFindFlags(findFlags)),
txt, searchMode, Core::SearchResultWindow::PreserveCaseEnabled,
SearchResult *search = SearchResultWindow::instance()->startNewSearch(label(),
toolTip().arg(IFindFilter::descriptionForFindFlags(findFlags)),
txt, searchMode, SearchResultWindow::PreserveCaseEnabled,
QString::fromLatin1("TextEditor"));
search->setTextToReplace(txt);
search->setSearchAgainSupported(true);
......@@ -158,14 +159,14 @@ void BaseFileFind::runNewSearch(const QString &txt, Core::FindFlags findFlags,
runSearch(search);
}
void BaseFileFind::runSearch(Core::SearchResult *search)
void BaseFileFind::runSearch(SearchResult *search)
{
FileFindParameters parameters = search->userData().value<FileFindParameters>();
CountingLabel *label = new CountingLabel;
connect(search, SIGNAL(countChanged(int)), label, SLOT(updateCount(int)));
CountingLabel *statusLabel = new CountingLabel;
connect(search, SIGNAL(countChanged(int)), statusLabel, SLOT(updateCount(int)));
Core::SearchResultWindow::instance()->popup(IOutputPane::Flags(IOutputPane::ModeSwitch|IOutputPane::WithFocus));
SearchResultWindow::instance()->popup(IOutputPane::Flags(IOutputPane::ModeSwitch|IOutputPane::WithFocus));
QFutureWatcher<FileSearchResultList> *watcher = new QFutureWatcher<FileSearchResultList>();
d->m_watchers.insert(watcher, search);
watcher->setPendingResultsLimit(1);
......@@ -189,24 +190,24 @@ void BaseFileFind::runSearch(Core::SearchResult *search)
connect(progress, SIGNAL(clicked()), search, SLOT(popup()));
}
void BaseFileFind::findAll(const QString &txt, Core::FindFlags findFlags)
void BaseFileFind::findAll(const QString &txt, FindFlags findFlags)
{
runNewSearch(txt, findFlags, SearchResultWindow::SearchOnly);
}
void BaseFileFind::replaceAll(const QString &txt, Core::FindFlags findFlags)
void BaseFileFind::replaceAll(const QString &txt, FindFlags findFlags)
{
runNewSearch(txt, findFlags, SearchResultWindow::SearchAndReplace);
}
void BaseFileFind::doReplace(const QString &text,
const QList<Core::SearchResultItem> &items,
const QList<SearchResultItem> &items,
bool preserveCase)
{
QStringList files = replaceAll(text, items, preserveCase);
if (!files.isEmpty()) {
DocumentManager::notifyFilesChangedInternally(files);
Core::SearchResultWindow::instance()->hide();
SearchResultWindow::instance()->hide();
}
}
......@@ -219,10 +220,10 @@ void BaseFileFind::displayResult(int index) {
watcher->cancel();
return;
}
Utils::FileSearchResultList results = watcher->resultAt(index);
QList<Core::SearchResultItem> items;
foreach (const Utils::FileSearchResult &result, results) {
Core::SearchResultItem item;
FileSearchResultList results = watcher->resultAt(index);
QList<SearchResultItem> items;
foreach (const FileSearchResult &result, results) {
SearchResultItem item;
item.path = QStringList() << QDir::toNativeSeparators(result.fileName);
item.lineNumber = result.lineNumber;
item.text = result.matchingLine;
......@@ -232,7 +233,7 @@ void BaseFileFind::displayResult(int index) {
item.userData = result.regexpCapturedTexts;
items << item;
}
search->addResults(items, Core::SearchResult::AddOrdered);
search->addResults(items, SearchResult::AddOrdered);
}
void BaseFileFind::searchFinished()
......@@ -305,7 +306,7 @@ void BaseFileFind::updateComboEntries(QComboBox *combo, bool onTop)
}
}
void BaseFileFind::openEditor(const Core::SearchResultItem &item)
void BaseFileFind::openEditor(const SearchResultItem &item)
{
SearchResult *result = qobject_cast<SearchResult *>(sender());
IEditor *openedEditor = 0;
......@@ -354,7 +355,7 @@ void BaseFileFind::recheckEnabled()
}
QStringList BaseFileFind::replaceAll(const QString &text,
const QList<Core::SearchResultItem> &items,
const QList<SearchResultItem> &items,
bool preserveCase)
{
if (items.isEmpty())
......@@ -362,12 +363,12 @@ QStringList BaseFileFind::replaceAll(const QString &text,
RefactoringChanges refactoring;
QHash<QString, QList<Core::SearchResultItem> > changes;
foreach (const Core::SearchResultItem &item, items)
QHash<QString, QList<SearchResultItem> > changes;
foreach (const SearchResultItem &item, items)
changes[QDir::fromNativeSeparators(item.path.first())].append(item);
// Checking for files without write permissions
QHashIterator<QString, QList<Core::SearchResultItem> > it(changes);
QHashIterator<QString, QList<SearchResultItem> > it(changes);
QSet<QString> roFiles;
while (it.hasNext()) {
it.next();
......@@ -388,12 +389,12 @@ QStringList BaseFileFind::replaceAll(const QString &text,
while (it.hasNext()) {
it.next();
const QString fileName = it.key();
const QList<Core::SearchResultItem> changeItems = it.value();
const QList<SearchResultItem> changeItems = it.value();
ChangeSet changeSet;
RefactoringFilePtr file = refactoring.file(fileName);
QSet<QPair<int, int> > processed;
foreach (const Core::SearchResultItem &item, changeItems) {
foreach (const SearchResultItem &item, changeItems) {
const QPair<int, int> &p = qMakePair(item.lineNumber, item.textMarkPos);
if (processed.contains(p))
continue;
......
......@@ -267,11 +267,11 @@ const ExtraEncodingSettings &BehaviorSettingsPage::extraEncodingSettings() const
void BehaviorSettingsPage::openCodingStylePreferences(TabSettingsWidget::CodingStyleLink link)
{
switch (link) {
case TextEditor::TabSettingsWidget::CppLink:
case TabSettingsWidget::CppLink:
Core::ICore::showOptionsDialog(CppTools::Constants::CPP_SETTINGS_CATEGORY,
CppTools::Constants::CPP_CODE_STYLE_SETTINGS_ID);
break;
case TextEditor::TabSettingsWidget::QtQuickLink:
case TabSettingsWidget::QtQuickLink:
Core::ICore::showOptionsDialog(QmlJSEditor::Constants::SETTINGS_CATEGORY_QML,
QmlJSTools::Constants::QML_JS_CODE_STYLE_SETTINGS_ID);
break;
......
......@@ -214,7 +214,7 @@ void GenericProposalModel::filter(const QString &prefix)
*
* It also implements the fully and first-letter-only case sensitivity.
*/
const TextEditor::CaseSensitivity caseSensitivity =
const CaseSensitivity caseSensitivity =
TextEditorSettings::completionSettings().m_caseSensitivity;
QString keyRegExp;
......@@ -223,8 +223,8 @@ void GenericProposalModel::filter(const QString &prefix)
const QLatin1String uppercaseWordContinuation("[a-z0-9_]*");
const QLatin1String lowercaseWordContinuation("(?:[a-zA-Z0-9]*_)?");
foreach (const QChar &c, prefix) {
if (caseSensitivity == TextEditor::CaseInsensitive ||
(caseSensitivity == TextEditor::FirstLetterCaseSensitive && !first)) {
if (caseSensitivity == CaseInsensitive ||
(caseSensitivity == FirstLetterCaseSensitive && !first)) {
keyRegExp += QLatin1String("(?:");
if (!first)
......
......@@ -145,11 +145,11 @@ QVariant ModelAdapter::data(const QModelIndex &index, int role) const
// ------------------------
// GenericProposalInfoFrame
// ------------------------
class GenericProposalInfoFrame : public Utils::FakeToolTip
class GenericProposalInfoFrame : public FakeToolTip
{
public:
GenericProposalInfoFrame(QWidget *parent = 0)
: Utils::FakeToolTip(parent), m_label(new QLabel(this))
: FakeToolTip(parent), m_label(new QLabel(this))
{
QVBoxLayout *layout = new QVBoxLayout(this);
layout->setMargin(0);
......
......@@ -158,7 +158,7 @@ ICodeStylePreferences *CodeStylePool::createCodeStyle(const QByteArray &id, cons
if (!d->m_factory)
return 0;
TextEditor::ICodeStylePreferences *codeStyle = d->m_factory->createCodeStyle();
ICodeStylePreferences *codeStyle = d->m_factory->createCodeStyle();
codeStyle->setId(id);
codeStyle->setTabSettings(tabSettings);
codeStyle->setValue(codeStyleData);
......@@ -230,7 +230,7 @@ void CodeStylePool::loadCustomCodeStyles()
ICodeStylePreferences *CodeStylePool::importCodeStyle(const Utils::FileName &fileName)
{
TextEditor::ICodeStylePreferences *codeStyle = loadCodeStyle(fileName);
ICodeStylePreferences *codeStyle = loadCodeStyle(fileName);
if (codeStyle)
saveCodeStyle(codeStyle);
return codeStyle;
......@@ -238,7 +238,7 @@ ICodeStylePreferences *CodeStylePool::importCodeStyle(const Utils::FileName &fil
ICodeStylePreferences *CodeStylePool::loadCodeStyle(const Utils::FileName &fileName)
{
TextEditor::ICodeStylePreferences *codeStyle = 0;
ICodeStylePreferences *codeStyle = 0;
Utils::PersistentSettingsReader reader;
reader.load(fileName);
QVariantMap m = reader.restoreValues();
......
......@@ -190,7 +190,7 @@ CodeStyleSelectorWidget::~CodeStyleSelectorWidget()
delete m_ui;
}
void CodeStyleSelectorWidget::setCodeStyle(TextEditor::ICodeStylePreferences *codeStyle)
void CodeStyleSelectorWidget::setCodeStyle(ICodeStylePreferences *codeStyle)
{
if (m_codeStyle == codeStyle)
return; // nothing changes
......@@ -244,15 +244,15 @@ void CodeStyleSelectorWidget::slotComboBoxActivated(int index)
if (index < 0 || index >= m_ui->delegateComboBox->count())
return;
TextEditor::ICodeStylePreferences *delegate =
m_ui->delegateComboBox->itemData(index).value<TextEditor::ICodeStylePreferences *>();
ICodeStylePreferences *delegate =
m_ui->delegateComboBox->itemData(index).value<ICodeStylePreferences *>();
const bool wasBlocked = blockSignals(true);
m_codeStyle->setCurrentDelegate(delegate);
blockSignals(wasBlocked);
}
void CodeStyleSelectorWidget::slotCurrentDelegateChanged(TextEditor::ICodeStylePreferences *delegate)
void CodeStyleSelectorWidget::slotCurrentDelegateChanged(ICodeStylePreferences *delegate)
{
m_ignoreGuiSignals = true;
m_ui->delegateComboBox->setCurrentIndex(m_ui->delegateComboBox->findData(QVariant::fromValue(delegate)));
......
......@@ -56,7 +56,7 @@ FindInFiles::FindInFiles()
m_directory(0)
{
m_instance = this;
connect(Core::EditorManager::instance(), SIGNAL(findOnFileSystemRequest(QString)),
connect(EditorManager::instance(), SIGNAL(findOnFileSystemRequest(QString)),
this, SLOT(findOnFileSystem(QString)));
}
......@@ -74,7 +74,7 @@ QString FindInFiles::displayName() const
return tr("Files on File System");
}
void FindInFiles::findAll(const QString &txt, Core::FindFlags findFlags)
void FindInFiles::findAll(const QString &txt, FindFlags findFlags)
{
updateComboEntries(m_directory, true);
BaseFileFind::findAll(txt, findFlags);
......@@ -85,7 +85,7 @@ Utils::FileIterator *FindInFiles::files(const QStringList &nameFilters,
{
return new Utils::SubDirFileIterator(QStringList() << additionalParameters.toString(),
nameFilters,
Core::EditorManager::defaultTextCodec());
EditorManager::defaultTextCodec());
}
QVariant FindInFiles::additionalParameters() const
......
......@@ -111,7 +111,7 @@ private:
class FontSettingsPagePrivate
{
public:
FontSettingsPagePrivate(const TextEditor::FormatDescriptions &fd,
FontSettingsPagePrivate(const FormatDescriptions &fd,
Core::Id id,
const QString &displayName,
const QString &category);
......@@ -122,7 +122,7 @@ public:
const QString m_displayName;
const QString m_settingsGroup;
TextEditor::FormatDescriptions m_descriptions;
FormatDescriptions m_descriptions;
FontSettings m_value;
FontSettings m_lastValue;
QPointer<QWidget> m_widget;
......@@ -168,7 +168,7 @@ static QString createColorSchemeFileName(const QString &pattern)
}
// ------- FontSettingsPagePrivate
FontSettingsPagePrivate::FontSettingsPagePrivate(const TextEditor::FormatDescriptions &fd,
FontSettingsPagePrivate::FontSettingsPagePrivate(const FormatDescriptions &fd,
Core::Id id,
const QString &displayName,
const QString &category) :
......
......@@ -129,7 +129,7 @@ bool Context::isDynamic() const
void Context::updateDynamicRules(const QStringList &captures) const
{
TextEditor::Internal::updateDynamicRules(m_rules, captures);
Internal::updateDynamicRules(m_rules, captures);
}
void Context::addRule(const QSharedPointer<Rule> &rule)
......
......@@ -82,7 +82,7 @@ HighlighterCodeFormatterData *formatterData(const QTextBlock &block)
}
Highlighter::Highlighter(QTextDocument *parent) :
TextEditor::SyntaxHighlighter(parent),
SyntaxHighlighter(parent),
m_regionDepth(0),
m_indentationBasedFolding(false),
m_tabSettings(0),
......@@ -90,24 +90,24 @@ Highlighter::Highlighter(QTextDocument *parent) :
m_dynamicContextsCounter(0),
m_isBroken(false)
{
static QVector<TextEditor::TextStyle> categories;
static QVector<TextStyle> categories;
if (categories.isEmpty()) {
categories << TextEditor::C_TEXT
<< TextEditor::C_VISUAL_WHITESPACE
<< TextEditor::C_KEYWORD
<< TextEditor::C_TYPE
<< TextEditor::C_COMMENT
<< TextEditor::C_NUMBER
<< TextEditor::C_NUMBER
<< TextEditor::C_NUMBER
<< TextEditor::C_STRING
<< TextEditor::C_STRING
<< TextEditor::C_TEXT // TODO : add style for alert (eg. yellow background)
<< TextEditor::C_TEXT // TODO : add style for error (eg. red underline)
<< TextEditor::C_FUNCTION
<< TextEditor::C_TEXT
<< TextEditor::C_TEXT
<< TextEditor::C_LOCAL;
categories << C_TEXT
<< C_VISUAL_WHITESPACE
<< C_KEYWORD
<< C_TYPE
<< C_COMMENT
<< C_NUMBER
<< C_NUMBER
<< C_NUMBER
<< C_STRING
<< C_STRING
<< C_TEXT // TODO : add style for alert (eg. yellow background)
<< C_TEXT // TODO : add style for error (eg. red underline)
<< C_FUNCTION
<< C_TEXT
<< C_TEXT
<< C_LOCAL;
}
setTextFormatCategories(categories);
......@@ -196,7 +196,7 @@ void Highlighter::highlightBlock(const QString &text)
setCurrentBlockState(computeState(extractObservableState(currentBlockState())));
}
TextEditor::Parentheses parentheses;
Parentheses parentheses;
for (int pos = 0; pos < length; ++pos) {
const QChar c = text.at(pos);
if (isOpeningParenthesis(c))
......
......@@ -176,10 +176,10 @@ QSharedPointer<HighlightDefinition> Manager::definition(const QString &id)
try {
reader.parse(source);
} catch (const HighlighterException &e) {
Core::MessageManager::write(
MessageManager::write(
QCoreApplication::translate("GenericHighlighter",
"Generic highlighter error: ") + e.message(),
Core::MessageManager::WithFocus);
MessageManager::WithFocus);
definition.clear();
}
m_isBuildingDefinition.remove(id);
......
......@@ -70,7 +70,7 @@ void TextEditor::setMimeTypeForHighlighter(Highlighter *highlighter, const Core:
SyntaxHighlighter *TextEditor::createGenericSyntaxHighlighter(const Core::MimeType &mimeType)
{
TextEditor::Highlighter *highlighter = new TextEditor::Highlighter();
Highlighter *highlighter = new Highlighter();
setMimeTypeForHighlighter(highlighter, mimeType);
return highlighter;
}
......@@ -50,7 +50,7 @@ bool Indenter::isElectricCharacter(const QChar &) const
void Indenter::indentBlock(QTextDocument *doc,
const QTextBlock &block,
const QChar &typedChar,
const TextEditor::TabSettings &tabSettings)
const TabSettings &tabSettings)
{
Q_UNUSED(doc);
Q_UNUSED(block);
......@@ -61,7 +61,7 @@ void Indenter::indentBlock(QTextDocument *doc,
void Indenter::indent(QTextDocument *doc,
const QTextCursor &cursor,
const QChar &typedChar,
const TextEditor::TabSettings &tabSettings)
const TabSettings &tabSettings)
{
if (cursor.hasSelection()) {
QTextBlock block = doc->findBlock(cursor.selectionStart());
......@@ -75,7 +75,7 @@ void Indenter::indent(QTextDocument *doc,
}
}
void Indenter::reindent(QTextDocument *doc, const QTextCursor &cursor, const TextEditor::TabSettings &tabSettings)
void Indenter::reindent(QTextDocument *doc, const QTextCursor &cursor, const TabSettings &tabSettings)
{
if (cursor.hasSelection()) {
QTextBlock block = doc->findBlock(cursor.selectionStart());
......
......@@ -63,7 +63,7 @@ void LineNumberFilter::prepareSearch(const QString &entry)
m_hasCurrentEditor = EditorManager::currentEditor() != 0;
}
QList<LocatorFilterEntry> LineNumberFilter::matchesFor(QFutureInterface<Core::LocatorFilterEntry> &, const QString &entry)
QList<LocatorFilterEntry> LineNumberFilter::matchesFor(QFutureInterface<LocatorFilterEntry> &, const QString &entry)
{
QList<LocatorFilterEntry> value;
QStringList lineAndColumn = entry.split(QLatin1Char(':'));
......
......@@ -63,7 +63,7 @@ NormalIndenter::~NormalIndenter()
void NormalIndenter::indentBlock(QTextDocument *doc,
const QTextBlock &block,
const QChar &typedChar,
const TextEditor::TabSettings &tabSettings)
const TabSettings &tabSettings)
{
Q_UNUSED(typedChar)
......
......@@ -40,7 +40,7 @@
using namespace TextEditor;
using namespace TextEditor::SemanticHighlighter;
void TextEditor::SemanticHighlighter::incrementalApplyExtraAdditionalFormats(
void SemanticHighlighter::incrementalApplyExtraAdditionalFormats(
SyntaxHighlighter *highlighter,
const QFuture<HighlightingResult> &future,
int from, int to,
......@@ -110,7 +110,7 @@ void TextEditor::SemanticHighlighter::incrementalApplyExtraAdditionalFormats(
}
}
void TextEditor::SemanticHighlighter::clearExtraAdditionalFormatsUntilEnd(
void SemanticHighlighter::clearExtraAdditionalFormatsUntilEnd(
SyntaxHighlighter *highlighter,
const QFuture<HighlightingResult> &future)
{
......
......@@ -54,5 +54,5 @@ QString PlainTextSnippetProvider::displayName() const
return QCoreApplication::translate("TextEditor::Internal::PlainTextSnippetProvider", "Text");
}
void PlainTextSnippetProvider::decorateEditor(TextEditor::SnippetEditorWidget *) const
void PlainTextSnippetProvider::decorateEditor(SnippetEditorWidget *) const
{}
......@@ -41,9 +41,9 @@
#include <math.h>
using namespace TextEditor;
namespace TextEditor {
class TextEditor::SyntaxHighlighterPrivate
class SyntaxHighlighterPrivate
{
SyntaxHighlighter *q_ptr;
Q_DECLARE_PUBLIC(SyntaxHighlighter)
......@@ -74,7 +74,7 @@ public:
}
void applyFormatChanges(int from, int charsRemoved, int charsAdded);
void updateFormatsForCategories(const TextEditor::FontSettings &fontSettings);
void updateFormatsForCategories(const FontSettings &fontSettings);
QVector<QTextCharFormat> formatChanges;
QTextBlock currentBlock;
......@@ -82,7 +82,7 @@ public:
bool inReformatBlocks;
TextDocumentLayout::FoldValidator foldValidator;
QVector<QTextCharFormat> formats;
QVector<TextEditor::TextStyle> formatCategories;
QVector<TextStyle> formatCategories;
};
static bool adjustRange(QTextLayout::FormatRange &range, int from, int charsRemoved, int charsAdded) {
......@@ -735,13 +735,13 @@ QList<QColor> SyntaxHighlighter::generateColors(int n, const QColor &background)
return result;
}
void SyntaxHighlighter::setFontSettings(const TextEditor::FontSettings &fontSettings)
void SyntaxHighlighter::setFontSettings(const FontSettings &fontSettings)
{
Q_D(SyntaxHighlighter);
d->updateFormatsForCategories(fontSettings);
}
void SyntaxHighlighter::setTextFormatCategories(const QVector<TextEditor::TextStyle> &categories)
void SyntaxHighlighter::setTextFormatCategories(const QVector<TextStyle> &categories)
{
Q_D(SyntaxHighlighter);
d->formatCategories = categories;
......@@ -756,10 +756,11 @@ QTextCharFormat SyntaxHighlighter::formatForCategory(int category) const
return d->formats.at(category);
}
void SyntaxHighlighterPrivate::updateFormatsForCategories(const TextEditor::FontSettings &fontSettings)
void SyntaxHighlighterPrivate::updateFormatsForCategories(const FontSettings &fontSettings)
{
formats = fontSettings.toTextCharFormats(formatCategories);
}