From b6c227714664aa6024f1390c0deaf692c6e05ef6 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 29 Aug 2019 11:34:13 +0200 Subject: GenericProject: Make dependency on CppTools optional Especially in the light of the language server, the generic project is currently the project one can use for language servers that require a "project workspace". Makes it possibly to run Qt Creator with "-noload CppTools" if you still want to use generic projects with some other language. Change-Id: Ib9059289a2db4c44c0c1060a02fcdafacb885fbd Reviewed-by: Nikolai Kosjar --- src/plugins/cpptools/cppprojectupdater.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/plugins/cpptools/cppprojectupdater.h') diff --git a/src/plugins/cpptools/cppprojectupdater.h b/src/plugins/cpptools/cppprojectupdater.h index 460cf707fb..5d95fa087c 100644 --- a/src/plugins/cpptools/cppprojectupdater.h +++ b/src/plugins/cpptools/cppprojectupdater.h @@ -25,6 +25,7 @@ #pragma once +#include "cppprojectupdaterinterface.h" #include "cpptools_global.h" #include "projectinfo.h" @@ -35,7 +36,18 @@ namespace CppTools { class ProjectInfo; -class CPPTOOLS_EXPORT CppProjectUpdater : public QObject +// registered in extensionsystem's object pool for plugins with weak dependency to CppTools +class CPPTOOLS_EXPORT CppProjectUpdaterFactory : public QObject +{ + Q_OBJECT +public: + CppProjectUpdaterFactory(); + + // keep the namespace, for the type name in the invokeMethod call + Q_INVOKABLE CppTools::CppProjectUpdaterInterface *create(); +}; + +class CPPTOOLS_EXPORT CppProjectUpdater : public QObject, public CppProjectUpdaterInterface { Q_OBJECT @@ -43,8 +55,8 @@ public: CppProjectUpdater(); ~CppProjectUpdater() override; - void update(const ProjectExplorer::ProjectUpdateInfo &projectUpdateInfo); - void cancel(); + void update(const ProjectExplorer::ProjectUpdateInfo &projectUpdateInfo) override; + void cancel() override; private: void cancelAndWaitForFinished(); -- cgit v1.2.1