| 144 | } |
| 145 | |
| 146 | void deleteLayer(const cmd::ArgumentList& args) |
| 147 | { |
| 148 | if (args.size() != 1) |
| 149 | { |
| 150 | rError() << "Usage: " << COMMAND_DELETELAYER << " <LayerID> " << std::endl; |
| 151 | return; |
| 152 | } |
| 153 | |
| 154 | DoWithMapLayerManager([&](ILayerManager& manager) |
| 155 | { |
| 156 | auto layerName = manager.getLayerName(args[0].getInt()); |
| 157 | |
| 158 | if (layerName.empty()) |
| 159 | { |
| 160 | throw cmd::ExecutionFailure(_("This layer ID doesn't exist")); |
| 161 | } |
| 162 | |
| 163 | manager.deleteLayer(layerName); |
| 164 | GlobalMapModule().setModified(true); |
| 165 | }); |
| 166 | } |
| 167 | |
| 168 | void addSelectionToLayer(const cmd::ArgumentList& args) |
| 169 | { |
nothing calls this directly
no test coverage detected