This reduces the need for most of the remaining uses of the
editor() back link.
Change-Id: I557cf4d3b5e1986f811fb17e87bf1825ac6912c6
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
There are still a few places where the EditorWidget is the primary
object, or several of them per "visible" IEditor (e.g. Diff).
Provide a means to streamline setup there, too.
Change-Id: I14cfbd68e555ebc539e707032a0e5bef563e0a36
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Fixes local use highlighting and renaming in new split, among others.
Done-with: hjk <hjk121@nokiamail.com>
Change-Id: Ic604d37d2dc0082fa4a75c2af457f60d6d6cfa66
Reviewed-by: hjk <hjk121@nokiamail.com>
The BaseTextEditorFactory will keep a collection of all
relevant creation functions (document, editor, widget,
indenter, syntax highlighter) and will use them to
create or duplicate base text editors in a uniform way.
Change-Id: I255b519e35cf1c28d5e198242f99316951a0235e
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This is needed for further refactoring in the cpp and qmljs editors.
Change-Id: Ic25525e5f468e915226e9daa8d118ff76a749e9f
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
The SnippetEditorWidget setup is unusual as it doesn't have
an associated SnippetEditorFactory/SnippetEditor creation chain
and requires manual intervention. This was lost in the
conversion to the new construction scheme.
Change-Id: I0919295603432e525c2abd0da762acc8207f996c
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
No need for the extra indirection here.
Change-Id: I21a303423ba52724551cca0bc82d4e4b08ab4e52
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
IEditorFactory knows how to construct an *Editor, the
Editor knows how to construct the Widget.
Change-Id: I2894e6ae622cb43ef6974aac82505c1f9912ff7b
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
All editors did that manually, with varying approaches. Connect once
when the document is made known to the EditorWidget instead.
Change-Id: Ib0828b08158539859f6f89c8080435a027aa06ed
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
In most cases, the *Editor constructor does not need to
access the *EditorWidget.
Change-Id: I1f5c076a0f723d5d82b398e8c250c7bd1d47eb17
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This does not seem to be necessary at all (it's overwritten on each
and every setDisplaySetting() call) and is the only remaining
difference in the two remaning BaseTextEditorWidget constructor bodies.
Change-Id: I6b8c0a51cf97e12f0dffb0673b680d4bbd2f2b45
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
There was document(), textDocument() and baseTextDocument().
Two should be enough...
Change-Id: Id9e41c8d857c5cb3269a9fce5ab594d34448c982
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Lifetime is coupled to the widgets, not the editor.
Change-Id: I01560bbdd6c399376d3a4184f0eb83e4153f830e
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Its lifetime is connected to the widget.
Change-Id: Iebf1a524511051f40869803426e274e8909c87e4
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
There are conceptually only two: one that operates a new document,
and one that shares one. Being explicit makes moving data over to
the Editor hierarchy easier. Convenience can be re-added there,
later.
Change-Id: I9b34ff26628c99ffff01201dcf99332d5e7253e9
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
Goal is to consolidate "controller" related data in the *Editor hierarchy.
This patch introduces temporary "cross-Private" accessors dd() to
keep the patches small.
First item moved is the AutoCompleter, a glimps at long term benefits
is the simplification in the JavaEditorWidget which is now essentially
a BaseTextEditorWidget, only containing the still-wrong createEditor().
But that can only be move if the *Editors are self-contained, i.e.
keep data themselves, not indirectly through the *EditorWidgets.
Change-Id: Ia0ab90f0322bb17ac20458e6581069eed30acbaf
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
In case of the CppEditor a direct member is not possible due
to setup restrictions inside the CppEditor machinery. I'd expect
that to be fixable when the editor base system is in good shape.
Change-Id: I184e219ca2dff6f67c9b58c182212eb12972cc84
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
No need for most of the machinery.
Change-Id: I9078174582d83da94c6c7f20282fd3a5f1742911
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
Qt 5.4 is adding ref-qualified overloads to toUpper, toLower, trimmed
and some others, so the cast becomes ambiguous or just plain wrong.
Change-Id: Idff0b3e100f075b9b995aeb84d88575afecb2d6f
Reviewed-by: hjk <hjk121@nokiamail.com>
Same patter. Plain is fully merged now, so remove the files, too.
Change-Id: Id8c0ba5689ad9980a0db3580cb9833344fd911f3
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
By moving some private functions to the pimpl.
Also, re-order some member function declarations.
Change-Id: If8a6c7ae1c27386511a5fa0a92c88a13541c2d94
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
That was the only user of that layer of abstraction.
Change-Id: I2bdc4abb8b2b33bfb70398dd11f7ecc4745ddc43
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Move the remaining contents to more appropriate places.
Change-Id: I55eed5c572bd33dafe2187523d9aa381c211fdd6
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
MSVC suddenly has this problem when bulding Qt Creator master Qt5 dev.
error C2352: 'TextEditor::BaseTextEditorWidget::extraSelections' :
illegal call of non-static member function
error C2825: 'T': must be a class or namespace when followed by '::'
...
This patch works it around by simply using this->
Change-Id: I8aae3e76f80248e1dd27d87552d14a81eda0d25f
Reviewed-by: hjk <hjk121@nokiamail.com>