| 351 | } |
| 352 | |
| 353 | void MapEditorController::setTool(MapEditorTool* new_tool) |
| 354 | { |
| 355 | if (current_tool) |
| 356 | { |
| 357 | if (current_tool->editingInProgress()) |
| 358 | { |
| 359 | current_tool->finishEditing(); |
| 360 | } |
| 361 | current_tool->deleteLater(); |
| 362 | } |
| 363 | |
| 364 | if (!override_tool) |
| 365 | { |
| 366 | map->clearDrawingBoundingBox(); |
| 367 | window->setStatusBarText(QString{}); |
| 368 | } |
| 369 | |
| 370 | current_tool = new_tool; |
| 371 | if (current_tool && !override_tool) |
| 372 | { |
| 373 | current_tool->init(); |
| 374 | } |
| 375 | |
| 376 | if (!override_tool) |
| 377 | map_widget->setTool(current_tool); |
| 378 | } |
| 379 | |
| 380 | void MapEditorController::setEditTool() |
| 381 | { |
no test coverage detected