Currently we pass in some places by value, elsewhere by const ref and
for some weird reason also by const value in a lot of places. The latter
is particularly annoying, as it is also used in interfaces and therefore
forces all implementors to do the same, since leaving the "const" off is
causing compiler warnings with MSVC.
Change-Id: I65b87dc3cce0986b8a55ff6119cb752361027803
Reviewed-by: hjk <hjk121@nokiamail.com>
This patch implements two features:
1. Reimplement CopyLine to move text cursor at the beginning of line
2. Add copy/cutLine action to Advanced Edit menu, to make it
discoverable for editor users.
Change-Id: I0bf336ebee4dbf5afd2c759e47b1830271bd9d18
Reviewed-by: David Schulz <david.schulz@digia.com>
The action handler implicitly passed ownership to ICore, which is non-
to the action handler. We now consistently create the action handler in
the editor factory, give ownership to the editor factory, and don't hold
a reference to it.
Change-Id: I4372f8de966e3ceff87c06c5528c6b54522c1d57
Reviewed-by: David Schulz <david.schulz@digia.com>
The action handler already knows which editors to handle through the
context. It only needs to receive signals for updating the actions from
the current editor. So there is no need to tell the action handler about
every individual editor. This also removes some noise from the text
editor implementations.
Change-Id: I76dc5b1559cc8cf54ff313e6cdba4e789a3108aa
Reviewed-by: David Schulz <david.schulz@digia.com>
The actionHack was used to only forward actions to editors that "belong"
to that action handler instance. That is already clearly defined by the
context that the action handler is created for, so we can just use that
instead.
Change-Id: Ia4c6795c80bb281c1ed258324925f56ca7fd8150
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Broke with f1eb9c4827 which exchanged
setDefaultKeySequence with setKeySequence
Task-number: QTCREATORBUG-10538
Change-Id: Id40bd8fd403cd586a39a19c248f59e23cf4cf8c0
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: David Schulz <david.schulz@digia.com>
BarDescriptorEditorWidget is using TextEditorActionHandler class
to provide editor actions e.g. Undo, Redo, Cut, Copy, Paste accessible
from main menu and using shortcuts.
TextEditorActionHandler.resolveTextEditorWidget() virtual function is
added to all resolving TextEditorWidget for an Editor. This allows
to have IEditor->widget() to have non-BaseTextEditorWidget instances too.
Task-number: QTCREATORBUG-10040
Change-Id: I6f433fc307c13ef2b2a20c48e6473826f2619544
Reviewed-by: David Kaspar <dkaspar@blackberry.com>
Reviewed-by: David Schulz <david.schulz@digia.com>
Reviewed-by: Tobias Nätterlund <tobias.naetterlund@kdab.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
In the majority of cases we were doing that anyways, having two
ways is just needlessly confusing.
Change-Id: Ied362a702c23beee528368d74df1f2aabe5807f8
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
No class derives from this, so the virtuals are not needed.
Change-Id: I251abc32cef6f4aacf39f31af1106eeebd8fe31e
Reviewed-by: David Schulz <david.schulz@digia.com>
This makes them align to the other "editor split" shortcuts.
Change-Id: I0b300ae495ffa17062a0a52b148f61015b965c29
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
With the line number filter with "<line>:<column>"
Change-Id: Ie8832fb1e218fe78cc40885da24716e844974924
Reviewed-by: David Schulz <david.schulz@digia.com>
Use book style capitalization, which means that
prepositions less than 4 characters long are written
in lower case.
Change-Id: I6d46a2513070897929cf1a8af2943a17d8e52b2d
Reviewed-by: David Schulz <david.schulz@digia.com>
Cleanup code and added shortcuts and menu entries for
- open header/source in next split
- follow symbol under cursor in next split
- open declaration/definition in next split
Change-Id: I2c4347749d26669d88b7c2968f30f60710f442b1
Reviewed-by: Petar Perisin <petar.perisin@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
# skip ast (excluding paste, astpath, and canv'ast'imer)
next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
s = File.read(file)
next if s.include?('qlalr')
orig = s.dup
s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
res = $&
if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
res
else
res.gsub!('} else', 'else')
res.gsub!(/\n +} *\n/m, "\n")
res.gsub(/ *{$/, '')
end
}
s.gsub!(/ *$/, '')
File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
Most of editors have "jump to file" or "follow symbol" actions. This
patch reduces amount of related boilerplate code.
New actions are made optional to prevent shortcut clash (both use F2).
Change-Id: I2af580ed9d6789df25f4487ba001f3b83887c504
Reviewed-by: hjk <qthjk@ovi.com>
Getting the #include directives ready for Qt5. This includes the
new-project wizards.
Change-Id: Ia9261f1e8faec06b9285b694d2b7e9a095978d2b
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
Add actions to the basetexteditor to indent and unindent a selection. These actions
are equivalent to Key_Tab and Key_BackTab respectively. The advantage of having
actions here is the user can override them and assign any key binding they want.
Thus, I could assign Ctrl+I and Shift+Ctrl+I to them and have the same behavior
as Kate.
Change-Id: I0a305a7b45018072a78f2880ea15650ea92095a1
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
We want to carry over all mac-specific code paths
to Qt 5. WS_MAC is no longer set; OS_MAC is.
This change is compatible with Qt 4 builds since
OS_MAC is set whenever WS_MAC is. (OS_MAC would
also be set for the theoretical X11/Mac platform,
but that's anyway not a supported configuration
for Creator)
Change-Id: Ib25d8c4e83e7e27d911124cd48aa17fdb875923f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This is a clipboard within Creator only. It allows the user to paste/navigate
through the recently copied content by repeatedly triggering a shortcut (which
is by default set to Ctrl+Shift+V).
Task-number: QTCREATORBUG-146
Change-Id: Ie449ab4b304548d5037a0c877bbbc0344d654325
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>