forked from qt-creator/qt-creator
Lua: Add buildStateChanged for project hooks
Change-Id: I9d9781f17f703cc382440388471ec5d2475739aa Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -201,6 +201,20 @@ void setupProjectModule()
|
||||
QTC_CHECK_EXPECTED(res);
|
||||
});
|
||||
});
|
||||
|
||||
// buildStateChanged
|
||||
registerHook("projects.buildStateChanged", [](sol::main_function func, QObject *guard) {
|
||||
QObject::connect(
|
||||
BuildManager::instance(),
|
||||
&BuildManager::buildStateChanged,
|
||||
guard,
|
||||
[func](ProjectExplorer::Project *pro) {
|
||||
const bool isBuilding = BuildManager::isBuilding(pro);
|
||||
expected_str<void> res = void_safe_call(func, pro, isBuilding);
|
||||
QTC_CHECK_EXPECTED(res);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace Lua::Internal
|
||||
|
@@ -59,6 +59,7 @@ EditorHooks = {}
|
||||
---@field projectRemoved? function function(project: Project)
|
||||
---@field aboutToRemoveProject? function function(project: Project)
|
||||
---@field runActionsUpdated? function function() Called when Project.canRunStartupProject() might have changed.
|
||||
---@field buildStateChanged? function function(project: Project, isBuilding: boolean)
|
||||
|
||||
---@class Hooks
|
||||
---@field editors? EditorHooks
|
||||
|
Reference in New Issue
Block a user