From b6ca8da0bd19fa6fda32fc2993f5bec7bd1f5168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Wed, 11 Feb 2009 12:11:21 +0100 Subject: [PATCH 01/10] Fixed compiler warning --- src/shared/proparser/proeditormodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/proparser/proeditormodel.cpp b/src/shared/proparser/proeditormodel.cpp index 787ea76410f..c11e8668e3f 100644 --- a/src/shared/proparser/proeditormodel.cpp +++ b/src/shared/proparser/proeditormodel.cpp @@ -923,7 +923,7 @@ QVariant ProScopeFilter::data(const QModelIndex &index, int role) const { bool checkable = m_checkable == ProScopeFilter::Blocks - || m_checkable == ProScopeFilter::Variable && sourceVariable(index); + || (m_checkable == ProScopeFilter::Variable && sourceVariable(index)); if (checkable && role == Qt::CheckStateRole) { QModelIndex srcindex = mapToSource(index); From 1dc1a64e1913f31b5cff5a1fef4b6b62160b5294 Mon Sep 17 00:00:00 2001 From: Martin Aumueller Date: Wed, 28 Jan 2009 20:49:38 +0100 Subject: [PATCH 02/10] fakevim: if Escape key serves no function, ignore it and let it be handled by the application --- src/plugins/fakevim/fakevimhandler.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 00f30f4e248..57f212ea7e7 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -1221,6 +1221,8 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, } else if (key == Key_Escape) { if (m_visualMode != NoVisualMode) leaveVisualMode(); + else + handled = false; } else { qDebug() << "IGNORED IN COMMAND MODE: " << key << text; if (text.isEmpty()) From 23a9971ad2aa336043ed24ab1c6996221ec6d626 Mon Sep 17 00:00:00 2001 From: Martin Aumueller Date: Wed, 28 Jan 2009 22:03:51 +0100 Subject: [PATCH 03/10] fakevim: implement paren matching w/o making FakeVimHandler depend on Qt Creator's TextEditor --- src/plugins/fakevim/fakevimhandler.cpp | 10 +++++++ src/plugins/fakevim/fakevimhandler.h | 1 + src/plugins/fakevim/fakevimplugin.cpp | 39 ++++++++++++++++++++++++++ 3 files changed, 50 insertions(+) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 57f212ea7e7..6c179cf902b 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -1846,6 +1846,16 @@ void FakeVimHandler::Private::moveToNextWord(bool simple) void FakeVimHandler::Private::moveToMatchingParanthesis() { + bool moved = false; + bool forward = false; + + emit q->moveToMatchingParenthesis(&moved, &forward, &m_tc); + + if (moved && forward) { + if (m_submode == NoSubMode || m_submode == ZSubMode || m_submode == RegisterSubMode) + m_tc.movePosition(Left, KeepAnchor, 1); + } + #if 0 // FIXME: remove TextEditor dependency bool undoFakeEOL = false; diff --git a/src/plugins/fakevim/fakevimhandler.h b/src/plugins/fakevim/fakevimhandler.h index a083f346dd4..c308c3cb94e 100644 --- a/src/plugins/fakevim/fakevimhandler.h +++ b/src/plugins/fakevim/fakevimhandler.h @@ -79,6 +79,7 @@ signals: void selectionChanged(const QList &selection); void writeFileRequested(bool *handled, const QString &fileName, const QString &contents); + void moveToMatchingParenthesis(bool *moved, bool *forward, QTextCursor *cursor); private: bool eventFilter(QObject *ob, QEvent *ev); diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index 50d45ff8769..c8b2898d88e 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -122,6 +122,7 @@ private slots: void showExtraInformation(const QString &msg); void changeSelection(const QList &selections); void writeFile(bool *handled, const QString &fileName, const QString &contents); + void moveToMatchingParenthesis(bool *moved, bool *forward, QTextCursor *cursor); private: FakeVimPlugin *q; @@ -203,6 +204,8 @@ void FakeVimPluginPrivate::installHandler(Core::IEditor *editor) this, SLOT(writeFile(bool*,QString,QString))); connect(handler, SIGNAL(selectionChanged(QList)), this, SLOT(changeSelection(QList))); + connect(handler, SIGNAL(moveToMatchingParenthesis(bool*,bool*,QTextCursor*)), + this, SLOT(moveToMatchingParenthesis(bool*,bool*,QTextCursor*))); handler->setupWidget(); handler->setExtraData(editor); @@ -250,6 +253,42 @@ void FakeVimPluginPrivate::writeFile(bool *handled, } } +void FakeVimPluginPrivate::moveToMatchingParenthesis(bool *moved, bool *forward, + QTextCursor *cursor) +{ + *moved = false; + + bool undoFakeEOL = false; + if (cursor->atBlockEnd() && cursor->block().length() > 1) { + cursor->movePosition(QTextCursor::Left, QTextCursor::KeepAnchor, 1); + undoFakeEOL = true; + } + TextEditor::TextBlockUserData::MatchType match + = TextEditor::TextBlockUserData::matchCursorForward(cursor); + if (match == TextEditor::TextBlockUserData::Match) { + *moved = true; + *forward = true; + } else { + if (undoFakeEOL) + cursor->movePosition(QTextCursor::Right, QTextCursor::KeepAnchor, 1); + if (match == TextEditor::TextBlockUserData::NoMatch) { + // backward matching is according to the character before the cursor + bool undoMove = false; + if (!cursor->atBlockEnd()) { + cursor->movePosition(QTextCursor::Right, QTextCursor::KeepAnchor, 1); + undoMove = true; + } + match = TextEditor::TextBlockUserData::matchCursorBackward(cursor); + if (match == TextEditor::TextBlockUserData::Match) { + *moved = true; + *forward = false; + } else if (undoMove) { + cursor->movePosition(QTextCursor::Left, QTextCursor::KeepAnchor, 1); + } + } + } +} + void FakeVimPluginPrivate::removeHandler() { if (FakeVimHandler *handler = qobject_cast(sender())) { From 06dfd937d8719bc925145a03bdf34bb35a019972 Mon Sep 17 00:00:00 2001 From: Martin Aumueller Date: Sun, 1 Feb 2009 21:35:14 +0100 Subject: [PATCH 04/10] fakevim: implement 'gg' for moving to first line --- src/plugins/fakevim/fakevimhandler.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 6c179cf902b..bdb46f0824a 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -951,7 +951,15 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, m_subsubmode = FtSubSubMode; m_subsubdata = key; } else if (key == 'g') { - m_gflag = true; + if (m_gflag) { + m_gflag = false; + m_tc.setPosition(firstPositionInLine(1), KeepAnchor); + if (m_config[ConfigStartOfLine] == ConfigOn) + moveToFirstNonBlankOnLine(); + finishMovement(); + } else { + m_gflag = true; + } } else if (key == 'G') { int n = m_mvcount.isEmpty() ? linesInDocument() : count(); m_tc.setPosition(firstPositionInLine(n), KeepAnchor); From c446f9efc652dd925bc09b3e441186a83ef2f213 Mon Sep 17 00:00:00 2001 From: Martin Aumueller Date: Sun, 1 Feb 2009 22:04:51 +0100 Subject: [PATCH 05/10] fakevim: dj/dk would not delete whole lines --- src/plugins/fakevim/fakevimhandler.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index bdb46f0824a..0615f7318a1 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -1004,7 +1004,9 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, moveDown(count()); moveToDesiredColumn(); } else { + m_moveType = MoveLineWise; moveToStartOfLine(); + setAnchor(); moveDown(count() + 1); } finishMovement(); @@ -1029,8 +1031,10 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, moveUp(count()); moveToDesiredColumn(); } else { + m_moveType = MoveLineWise; moveToStartOfLine(); moveDown(); + setAnchor(); moveUp(count() + 1); } finishMovement(); From f2940adb4d5e07bcb970b1be78c619090cb1aa54 Mon Sep 17 00:00:00 2001 From: Martin Aumueller Date: Tue, 3 Feb 2009 10:39:57 +0100 Subject: [PATCH 06/10] fakevim: implement indenting a block and autoindent --- src/plugins/fakevim/fakevimhandler.cpp | 8 +++-- src/plugins/fakevim/fakevimhandler.h | 2 ++ src/plugins/fakevim/fakevimplugin.cpp | 45 ++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 3 deletions(-) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 0615f7318a1..7b477c48176 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -40,8 +40,6 @@ // Qt Creator. The idea is to keep this file here in a "clean" state that // allows easy reuse with any QTextEdit or QPlainTextEdit derived class. -//#include - #include #include #include @@ -1718,11 +1716,15 @@ int FakeVimHandler::Private::indentDist() const const TextEditor::TextBlockIterator end(m_tc.block().next()); return indenter.indentForBottomLine(current, begin, end, QChar(' ')); #endif - return 0; + int amount = 0; + emit q->indentRegion(&amount, m_tc.block(), m_tc.block(), QChar(' ')); + return amount; } void FakeVimHandler::Private::indentRegion(QTextBlock begin, QTextBlock end, QChar typedChar) { + int amount = 0; + emit q->indentRegion(&amount, begin, end, typedChar); #if 0 // FIXME: Make independent of TextEditor if (!m_texteditor) diff --git a/src/plugins/fakevim/fakevimhandler.h b/src/plugins/fakevim/fakevimhandler.h index c308c3cb94e..f5b4101996c 100644 --- a/src/plugins/fakevim/fakevimhandler.h +++ b/src/plugins/fakevim/fakevimhandler.h @@ -36,6 +36,7 @@ #include #include +#include QT_BEGIN_NAMESPACE class QString; @@ -80,6 +81,7 @@ signals: void writeFileRequested(bool *handled, const QString &fileName, const QString &contents); void moveToMatchingParenthesis(bool *moved, bool *forward, QTextCursor *cursor); + void indentRegion(int *amount, QTextBlock begin, QTextBlock end, QChar typedChar); private: bool eventFilter(QObject *ob, QEvent *ev); diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index c8b2898d88e..fe60eaa2de6 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -56,9 +56,12 @@ #include #include #include +#include #include +#include + #include #include #include @@ -123,6 +126,7 @@ private slots: void changeSelection(const QList &selections); void writeFile(bool *handled, const QString &fileName, const QString &contents); void moveToMatchingParenthesis(bool *moved, bool *forward, QTextCursor *cursor); + void indentRegion(int *amount, QTextBlock begin, QTextBlock end, QChar typedChar); private: FakeVimPlugin *q; @@ -206,6 +210,8 @@ void FakeVimPluginPrivate::installHandler(Core::IEditor *editor) this, SLOT(changeSelection(QList))); connect(handler, SIGNAL(moveToMatchingParenthesis(bool*,bool*,QTextCursor*)), this, SLOT(moveToMatchingParenthesis(bool*,bool*,QTextCursor*))); + connect(handler, SIGNAL(indentRegion(int*,QTextBlock,QTextBlock,QChar)), + this, SLOT(indentRegion(int*,QTextBlock,QTextBlock,QChar))); handler->setupWidget(); handler->setExtraData(editor); @@ -289,6 +295,45 @@ void FakeVimPluginPrivate::moveToMatchingParenthesis(bool *moved, bool *forward, } } +void FakeVimPluginPrivate::indentRegion(int *amount, QTextBlock begin, QTextBlock end, + QChar typedChar) +{ + FakeVimHandler *handler = qobject_cast(sender()); + if (!handler) + return; + + BaseTextEditor *bt = qobject_cast(handler->widget()); + if (!bt) + return; + + typedef SharedTools::Indenter Indenter; + Indenter &indenter = Indenter::instance(); + indenter.setIndentSize(bt->tabSettings().m_indentSize); + indenter.setTabSize(bt->tabSettings().m_tabSize); + + const QTextDocument *doc = begin.document(); + const TextEditor::TextBlockIterator docStart(doc->begin()); + QTextBlock cur = begin; + do { + if (typedChar == 0 && cur.text().simplified().isEmpty()) { + *amount = 0; + if (cur != end) { + QTextCursor cursor(cur); + while (!cursor.atBlockEnd()) + cursor.deleteChar(); + } + } else { + const TextEditor::TextBlockIterator current(cur); + const TextEditor::TextBlockIterator next(cur.next()); + *amount = indenter.indentForBottomLine(current, docStart, next, typedChar); + if (cur != end) + bt->tabSettings().indentLine(cur, *amount); + } + if (cur != end) + cur = cur.next(); + } while (cur != end); +} + void FakeVimPluginPrivate::removeHandler() { if (FakeVimHandler *handler = qobject_cast(sender())) { From 3be27a7040f1d5782fae9781c243214595ede3e4 Mon Sep 17 00:00:00 2001 From: Martin Aumueller Date: Thu, 5 Feb 2009 16:07:40 +0100 Subject: [PATCH 07/10] fakevim: 0 would go to first non-blank instead of first character of a line, implement ^ and 0 --- src/plugins/fakevim/fakevimhandler.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 7b477c48176..11b4cc86cc3 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -788,11 +788,14 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, m_subsubmode = NoSubSubMode; } else if (key >= '0' && key <= '9') { if (key == '0' && m_mvcount.isEmpty()) { - moveToFirstNonBlankOnLine(); + moveToStartOfLine(); finishMovement(); } else { m_mvcount.append(QChar(key)); } + } else if (key == '^') { + moveToFirstNonBlankOnLine(); + finishMovement(); } else if (0 && key == ',') { // FIXME: fakevim uses ',' by itself, so it is incompatible m_subsubmode = FtSubSubMode; From f3c2bbaabe052f2fa02dae93c62bef093a68a866 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Tue, 10 Feb 2009 22:56:04 +0100 Subject: [PATCH 08/10] Less annoying syntax checker. (cherry picked from commit 9539bb2b28c05aa3ff7ca1aa19161ae864116422) --- src/libs/cplusplus/CppDocument.cpp | 3 ++ src/plugins/cpptools/cppmodelmanager.cpp | 43 +++++++++++++++++-- src/plugins/cpptools/cppmodelmanager.h | 17 ++++++++ .../cpptools/cpptoolseditorsupport.cpp | 24 +++++++++-- src/plugins/cpptools/cpptoolseditorsupport.h | 3 +- 5 files changed, 83 insertions(+), 7 deletions(-) diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp index 1f4621e9703..f9be119e2b3 100644 --- a/src/libs/cplusplus/CppDocument.cpp +++ b/src/libs/cplusplus/CppDocument.cpp @@ -239,6 +239,9 @@ void Document::startSkippingBlocks(unsigned start) void Document::stopSkippingBlocks(unsigned stop) { + if (_skippedBlocks.isEmpty()) + return; + unsigned start = _skippedBlocks.back().begin(); if (start > stop) _skippedBlocks.removeLast(); // Ignore this block, it's invalid. diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index 75f64fea5da..b2b9c3ee096 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -69,6 +69,7 @@ #include #include #include +#include using namespace CppTools; using namespace CppTools::Internal; @@ -447,6 +448,12 @@ CppModelManager::CppModelManager(QObject *parent) ProjectExplorer::SessionManager *session = m_projectExplorer->session(); QTC_ASSERT(session, return); + m_updateEditorSelectionsTimer = new QTimer(this); + m_updateEditorSelectionsTimer->setInterval(500); + m_updateEditorSelectionsTimer->setSingleShot(true); + connect(m_updateEditorSelectionsTimer, SIGNAL(timeout()), + this, SLOT(updateEditorSelections())); + connect(session, SIGNAL(projectAdded(ProjectExplorer::Project*)), this, SLOT(onProjectAdded(ProjectExplorer::Project*))); @@ -710,8 +717,8 @@ void CppModelManager::onDocumentUpdated(Document::Ptr doc) continue; else if (lines.contains(m.line())) continue; - else if (lines.size() == MAX_SELECTION_COUNT) - break; // we're done. + //else if (lines.size() == MAX_SELECTION_COUNT) + //break; // we're done. lines.insert(m.line()); @@ -733,12 +740,42 @@ void CppModelManager::onDocumentUpdated(Document::Ptr doc) sel.cursor = c; selections.append(sel); } - ed->setExtraSelections(TextEditor::BaseTextEditor::CodeWarningsSelection, selections); + + QList todo; + foreach (Editor e, todo) { + if (e.widget != ed) + todo.append(e); + } + + Editor e; + e.widget = ed; + e.selections = selections; + todo.append(e); + m_todo = todo; + postEditorUpdate(); break; } } } +void CppModelManager::postEditorUpdate() +{ + m_updateEditorSelectionsTimer->start(500); +} + +void CppModelManager::updateEditorSelections() +{ + foreach (Editor ed, m_todo) { + if (! ed.widget) + continue; + + ed.widget->setExtraSelections(TextEditor::BaseTextEditor::CodeWarningsSelection, + ed.selections); + } + + m_todo.clear(); +} + void CppModelManager::onProjectAdded(ProjectExplorer::Project *) { QMutexLocker locker(&mutex); diff --git a/src/plugins/cpptools/cppmodelmanager.h b/src/plugins/cpptools/cppmodelmanager.h index 361c714fee7..4713c29d61b 100644 --- a/src/plugins/cpptools/cppmodelmanager.h +++ b/src/plugins/cpptools/cppmodelmanager.h @@ -41,6 +41,8 @@ #include #include #include +#include +#include namespace Core { class ICore; @@ -49,6 +51,7 @@ class IEditor; namespace TextEditor { class ITextEditor; +class BaseTextEditor; } namespace ProjectExplorer { @@ -86,6 +89,9 @@ public: void emitDocumentUpdated(CPlusPlus::Document::Ptr doc); + void stopEditorSelectionsUpdate() + { m_updateEditorSelectionsTimer->stop(); } + Q_SIGNALS: void projectPathChanged(const QString &projectPath); @@ -102,6 +108,8 @@ private Q_SLOTS: void onAboutToRemoveProject(ProjectExplorer::Project *project); void onSessionUnloaded(); void onProjectAdded(ProjectExplorer::Project *project); + void postEditorUpdate(); + void updateEditorSelections(); private: QMap buildWorkingCopyList(); @@ -163,6 +171,15 @@ private: enum { MAX_SELECTION_COUNT = 5 }; + + struct Editor { + QPointer widget; + QList selections; + }; + + QList m_todo; + + QTimer *m_updateEditorSelectionsTimer; }; } // namespace Internal diff --git a/src/plugins/cpptools/cpptoolseditorsupport.cpp b/src/plugins/cpptools/cpptoolseditorsupport.cpp index 5a907a2d175..ab6fe3532cc 100644 --- a/src/plugins/cpptools/cpptoolseditorsupport.cpp +++ b/src/plugins/cpptools/cpptoolseditorsupport.cpp @@ -35,6 +35,7 @@ #include "cppmodelmanager.h" #include +#include #include @@ -68,12 +69,14 @@ void CppEditorSupport::setTextEditor(TextEditor::ITextEditor *textEditor) updateDocument(); } -QString CppEditorSupport::contents() const +QString CppEditorSupport::contents() { if (! _textEditor) return QString(); + else if (! _cachedContents.isEmpty()) + _cachedContents = _textEditor->contents(); - return _textEditor->contents(); + return _cachedContents; } int CppEditorSupport::updateDocumentInterval() const @@ -83,7 +86,20 @@ void CppEditorSupport::setUpdateDocumentInterval(int updateDocumentInterval) { _updateDocumentInterval = updateDocumentInterval; } void CppEditorSupport::updateDocument() -{ _updateDocumentTimer->start(_updateDocumentInterval); } +{ + if (TextEditor::BaseTextEditor *edit = qobject_cast(_textEditor->widget())) { + const QList selections = + edit->extraSelections(TextEditor::BaseTextEditor::CodeWarningsSelection); + + if (! selections.isEmpty()) + edit->setExtraSelections(TextEditor::BaseTextEditor::CodeWarningsSelection, + QList()); + + _modelManager->stopEditorSelectionsUpdate(); + } + + _updateDocumentTimer->start(_updateDocumentInterval); +} void CppEditorSupport::updateDocumentNow() { @@ -91,7 +107,9 @@ void CppEditorSupport::updateDocumentNow() _updateDocumentTimer->start(_updateDocumentInterval); } else { _updateDocumentTimer->stop(); + QStringList sourceFiles(_textEditor->file()->fileName()); + _cachedContents = _textEditor->contents(); _documentParser = _modelManager->refreshSourceFiles(sourceFiles); } } diff --git a/src/plugins/cpptools/cpptoolseditorsupport.h b/src/plugins/cpptools/cpptoolseditorsupport.h index 2bce101e523..6e136c2d852 100644 --- a/src/plugins/cpptools/cpptoolseditorsupport.h +++ b/src/plugins/cpptools/cpptoolseditorsupport.h @@ -65,7 +65,7 @@ public: int updateDocumentInterval() const; void setUpdateDocumentInterval(int updateDocumentInterval); - QString contents() const; + QString contents(); private Q_SLOTS: void updateDocument(); @@ -79,6 +79,7 @@ private: QTimer *_updateDocumentTimer; int _updateDocumentInterval; QFuture _documentParser; + QString _cachedContents; }; } // namespace Internal From dd54cc6a7a91a2be18de8b8a6e516d81c84f910d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Wed, 11 Feb 2009 14:42:23 +0100 Subject: [PATCH 09/10] Don't remove syntax errors on each document change Especially when several error markers exist, the flashing this causes while editing isn't really nice. Reviewed-by: Roberto Raggi --- src/plugins/cpptools/cppmodelmanager.cpp | 2 -- src/plugins/cpptools/cppmodelmanager.h | 4 ---- src/plugins/cpptools/cpptoolseditorsupport.cpp | 4 ---- 3 files changed, 10 deletions(-) diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index b2b9c3ee096..00db6d0640d 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -717,8 +717,6 @@ void CppModelManager::onDocumentUpdated(Document::Ptr doc) continue; else if (lines.contains(m.line())) continue; - //else if (lines.size() == MAX_SELECTION_COUNT) - //break; // we're done. lines.insert(m.line()); diff --git a/src/plugins/cpptools/cppmodelmanager.h b/src/plugins/cpptools/cppmodelmanager.h index 4713c29d61b..fb645ffe8f3 100644 --- a/src/plugins/cpptools/cppmodelmanager.h +++ b/src/plugins/cpptools/cppmodelmanager.h @@ -168,10 +168,6 @@ private: mutable QMutex mutex; - enum { - MAX_SELECTION_COUNT = 5 - }; - struct Editor { QPointer widget; QList selections; diff --git a/src/plugins/cpptools/cpptoolseditorsupport.cpp b/src/plugins/cpptools/cpptoolseditorsupport.cpp index ab6fe3532cc..a1688e7ca09 100644 --- a/src/plugins/cpptools/cpptoolseditorsupport.cpp +++ b/src/plugins/cpptools/cpptoolseditorsupport.cpp @@ -91,10 +91,6 @@ void CppEditorSupport::updateDocument() const QList selections = edit->extraSelections(TextEditor::BaseTextEditor::CodeWarningsSelection); - if (! selections.isEmpty()) - edit->setExtraSelections(TextEditor::BaseTextEditor::CodeWarningsSelection, - QList()); - _modelManager->stopEditorSelectionsUpdate(); } From b8e51e28572eb6859fb1161563a1bbce709ad113 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 11 Feb 2009 15:27:39 +0100 Subject: [PATCH 10/10] Fixes: compilation fix --- src/plugins/projectexplorer/toolchain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index 92760dc7cf9..96b16d59d31 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -304,7 +304,7 @@ QList WinCEToolChain::systemHeaderPaths() #ifdef QTCREATOR_WITH_MSVC_INCLUDES return env.value("INCLUDE").split(QLatin1Char(';')); #endif - return QStringList(); + return QList(); } void WinCEToolChain::addToEnvironment(ProjectExplorer::Environment &env)