aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cpptools/abstracteditorsupport.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2016-01-15 16:12:54 +0100
committerUlf Hermann <ulf.hermann@theqtcompany.com>2016-02-16 12:53:05 +0000
commit2e3e06052065c97fa4a2ddd2b1418bb3447387d4 (patch)
tree0628f8d1a68a3f16b66e3d61c6a26a7bb34ed21c /src/plugins/cpptools/abstracteditorsupport.cpp
parent13e0abf526e87179fc6b50e967902189fc42b832 (diff)
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>
Diffstat (limited to 'src/plugins/cpptools/abstracteditorsupport.cpp')
-rw-r--r--src/plugins/cpptools/abstracteditorsupport.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/cpptools/abstracteditorsupport.cpp b/src/plugins/cpptools/abstracteditorsupport.cpp
index c2edc0291a..c2f435b171 100644
--- a/src/plugins/cpptools/abstracteditorsupport.cpp
+++ b/src/plugins/cpptools/abstracteditorsupport.cpp
@@ -34,9 +34,15 @@
namespace CppTools {
-AbstractEditorSupport::AbstractEditorSupport(CppModelManager *modelmanager) :
- m_modelmanager(modelmanager), m_revision(1)
+AbstractEditorSupport::AbstractEditorSupport(CppModelManager *modelmanager, QObject *parent) :
+ QObject(parent), m_modelmanager(modelmanager), m_revision(1)
{
+ modelmanager->addExtraEditorSupport(this);
+}
+
+AbstractEditorSupport::~AbstractEditorSupport()
+{
+ m_modelmanager->removeExtraEditorSupport(this);
}
void AbstractEditorSupport::updateDocument()