MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / deleteLayer

Method deleteLayer

radiantcore/layers/LayerModule.cpp:146–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 9

rErrorFunction · 0.85
DoWithMapLayerManagerFunction · 0.85
ExecutionFailureClass · 0.85
getIntMethod · 0.80
setModifiedMethod · 0.80
_Function · 0.50
sizeMethod · 0.45
getLayerNameMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected