We used our own, hand-rolled filter model implementation for performance
reasons, but benchmarking shows no difference.
Change-Id: I076ffeffbd39b468308d48d23d15a69b966dbc23
Reviewed-by: hjk <hjk@qt.io>
Qt Creator extracts file names from the output of external processes in
various places, for instance from compilers during the build. It often
happens that such file names are not absolute, so they cannot be
directly opened in an editor when the user clicks on their
representation in some widget. That's why they are processed by the
FileInProjectFinder facility first.
This patch enhances the FileInProjectFinder to be able to return more
than one candidate for a relative file path, and allows the user to
choose between these candidates where possible. This way, we won't open
a random file anymore when a project contains more than one file with
the same name.
Fixes: QTCREATORBUG-13623
Change-Id: Id19c9eace3e6b3dbde89f6528e6d02b55872d747
Reviewed-by: hjk <hjk@qt.io>
The more specific output parsers often fail to resolve relative file
paths, so add a fallback that attempts to find the corresponding file in
the current session.
A follow-up patch should add support for manual ambiguity resolving.
Change-Id: If0aecbab0f3bf1aa779f4a538076c87ae6bf22d4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Even if source items are removed that are currently not visible, the
rest of the source mapping indices must be adapted.
Fixes: QTCREATORBUG-20542
Change-Id: Ib351286e6e7c35cdbdc96a3c38b346e8ed8f456c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Do not send endRemoveRows if we never sent beginRemoveRows.
Fix up of 702d6a6914
Task-number: QTCREATORBUG-20741
Change-Id: If22a18e6426c8b4041924a170d5927ab9d11ccdf
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
When tasks are inserted into the source model, the source indices in the
filtered model after the new items where not updated correctly.
The indices must be increased by the number of items added to the source
model, not the number of items added to the filtered model (which can be
less).
Task-number: QTCREATORBUG-20542
Task-number: QTCREATORBUG-18951
Change-Id: Idae9cf4241c31229dadf5c9fea383aef3fdfffb0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Do not send rowsRemoved before source model has removed the rows from
its data.
Add some QTC_ASSERTS and comments.
Replace trivial slot by lambda.
Change-Id: I7a0df404f757fca5f7724be66e516824ecd292dd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Ids can be compared and tested for default-constructedness without.
Change-Id: I410c8a3922faa32fa27a090ea8fba7562a9a0231
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Invalid positions should not happen, but handle them anyway if they do.
There is one report about a crash in the task model that may be related
to this.
Task-number: QTCREATORBUG-13861
Change-Id: Iae1b25974220d3622ecc39bd1a073c299b843fea
Reviewed-by: Sandro Mani <manisandro@gmail.com>
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
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>
When inserting new items into the TaskFilterModel we could end up
duplicating the items. Do not do that.
Change-Id: I2450bac185a881e16f23368b39ce5e273c061d99
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
The method is in a internal class, so this does not break the build
for external plugins.
Change-Id: I9ad75e8230059d865ec7a73aa0868cb82a35b35f
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Showed up in valgrind as being used uninitialized.
Change-Id: I77618ff982c12ff7b1d7f5e285cb9dd1810c116c
Reviewed-by: Tobias Hunger <tobias.hunger@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>
The filter model needs to remove rows before the view tries to find
the next row to select. Otherwise the filtermodel might access the
source model at a position that is out of bounds.
Change-Id: Id610455f32e7c7fe921c243537def0097b46a798
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This is now a build-error. The default value is a null void pointer anyway.
Change-Id: I92d0faf5152ec53c8e84ba4982c151a09aa33146
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This also allows simple setting of breakpoints on failed asserts.
Change-Id: I6dd84cbfaf659d57e39f3447386cebc0221b2b84
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
That means it is no longer possible to make bookmarks on lines with
errors or warnings by simply clicking. That's not nice.
It might be better to do something different, but let's see how the
feedback to this is.
Change-Id: I34788ff638ed49c21001d03cd60f992ffabd6153
Reviewed-by: hjk <qthjk@ovi.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
Makes it easier to later find the task again, and does actually not
change the order in the normal case
Change-Id: I2f36f2e7a6ab52c06e35be22820438a809ecb012
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.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>