| 177 | } |
| 178 | |
| 179 | void ProjectCore::initProject(dpf::PluginServiceContext &ctx) |
| 180 | { |
| 181 | using namespace std::placeholders; |
| 182 | ProjectService *projectService = ctx.service<ProjectService>(ProjectService::name()); |
| 183 | if (projectService) { |
| 184 | ProjectTree *treeView = ProjectKeeper::instance()->treeView(); |
| 185 | if (!projectService->addRootItem) { |
| 186 | projectService->addRootItem = std::bind(&ProjectTree::appendRootItem, treeView, _1); |
| 187 | } |
| 188 | if (!projectService->removeRootItem) { |
| 189 | projectService->removeRootItem = std::bind(&ProjectTree::removeRootItem, treeView, _1); |
| 190 | } |
| 191 | if (!projectService->expandedDepth) { |
| 192 | projectService->expandedDepth = std::bind(&ProjectTree::expandedProjectDepth, treeView, _1, _2); |
| 193 | } |
| 194 | if (!projectService->expandedAll) { |
| 195 | projectService->expandedAll = std::bind(&ProjectTree::expandedProjectAll, treeView, _1); |
| 196 | } |
| 197 | if (!projectService->getAllProjectInfo) { |
| 198 | projectService->getAllProjectInfo = std::bind(&ProjectTree::getAllProjectInfo, treeView); |
| 199 | } |
| 200 | if (!projectService->getProjectInfo) { |
| 201 | projectService->getProjectInfo = std::bind(&ProjectTree::getProjectInfo, treeView, _1, _2); |
| 202 | } |
| 203 | if (!projectService->getActiveProjectInfo) { |
| 204 | projectService->getActiveProjectInfo = std::bind(&ProjectTree::getActiveProjectInfo, treeView); |
| 205 | } |
| 206 | if (!projectService->hasProjectInfo) { |
| 207 | projectService->hasProjectInfo = std::bind(&ProjectTree::hasProjectInfo, treeView, _1); |
| 208 | } |
| 209 | if (!projectService->updateProjectInfo) { |
| 210 | projectService->updateProjectInfo = std::bind(&ProjectTree::updateProjectInfo, treeView, _1); |
| 211 | } |
| 212 | if (!projectService->expandItemByFile) { |
| 213 | projectService->expandItemByFile = std::bind(&ProjectTree::expandItemByFile, treeView, _1); |
| 214 | } |
| 215 | if (!projectService->openProject) { |
| 216 | projectService->openProject = std::bind(&ProjectCore::openProject, this); |
| 217 | } |
| 218 | if (!projectService->getActiveProjectItem) { |
| 219 | projectService->getActiveProjectItem = std::bind(&ProjectTree::getActiveProjectItem, treeView); |
| 220 | } |
| 221 | if (!projectService->restoreExpandState) { |
| 222 | projectService->restoreExpandState = std::bind(&ProjectTree::restoreExpandState, treeView, _1); |
| 223 | } |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | void ProjectCore::registerVariables() |
| 228 | { |