Commit Graph

5 Commits

Author SHA1 Message Date
Nikolai Kosjar
b4d6884c25 CppTools: Fix propagating unsaved files
On project loading ExtraCompiler objects are created that might read the
already existing ui_*.h files in the build directory. In this case,
ExtraCompiler::setContent() is called, which will emit a signal about
the modified content.

Now GeneratedCodeModelSupport is a client of this signal and it forwards
the changed contents to the clang code model. However,
GeneratedCodeModelSupport objects might be created later and miss the
initial signal emission, thus leaving the code model unaware of some
unsaved files.

Fix by notifying the code model at construction time of
GeneratedCodeModelSupport.

Change-Id: I7311867ad7f534920357801647bd2d0c82bb4edb
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-22 12:21:07 +00:00
Orgad Shaneh
ba517fcfab ExtraCompiler: Remove stored targets list
Itereate over the hash keys instead.

Change-Id: Ib14bef708b74ed1938bcb985b3a5091aca704391
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-03-15 11:52:49 +00:00
Tobias Hunger
972ea4cba0 ExtraCompiler: Run extra compiler in a thread
and make sure there are not too many of these threads
running at any time. This stops the massive process
startup when loading a project with many UI files, etc.

Task-number: QTCREATORBUG-15795
Change-Id: Icfcddd80d04e36b61ecafbbefe5a1a8b7ea02ec6
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2016-03-11 09:49:25 +00:00
Orgad Shaneh
8b0d849a27 ExtraCompiler: Store contents as Utf8
Avoid conversions when they're not needed.

Change-Id: I7e996bc6e87be4327d75f0d743ff2de38d6ccc32
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2016-02-18 09:33:04 +00:00
Ulf Hermann
2e3e060520 Generalize support for extra compilers
Allow for different extra compilers which may get called to generate
additional code for the code model. The build system is expected to
know what files are generated from which source file and the extra
compilers know how to generate the content of those files, without
touching the build directory. the uic adapter is refactored to be
the first such extra compiler.

The extra compiler is run when an editor for its source document
loses focus, or after a timeout of 1s when the source document has
been changed.

Change-Id: I13c110c61120c812f02639a3684144daf8979b37
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-16 12:53:05 +00:00