MCPcopy Create free account
hub / github.com/XRay3D/GERBER_X3 / addFile

Method addFile

static_libs/common/project.cpp:344–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342}
343
344int Project::addFile(FileInterface* file)
345{
346 QMutexLocker locker(&m_mutex);
347 if (!file)
348 return -1;
349 m_isPinsPlaced = false;
350 m_reloadFile = false;
351 file->createGi();
352 file->addToScene();
353 file->setVisible(true);
354 const int id = contains(file->name());
355 if (id > -1 && m_files[id]->type() == file->type()) {
356 reload(id, file);
357 } else if (file->id() == -1) {
358 const int newId = m_files.size()
359 ? (--m_files.end())->first + 1
360 : 0;
361 file->setId(newId);
362 m_files.emplace(newId, file);
363 App::fileModel()->addFile(file);
364 setChanged();
365 watcher->addPath(file->name());
366 }
367 return file->id();
368}
369
370int Project::addShape(ShapeInterface* const shape)
371{

Callers 5

addFileToProMethod · 0.45
contextMenuEventMethod · 0.45
fileHandlerMethod · 0.45
on_pbCreate_clickedMethod · 0.45
openMethod · 0.45

Calls 10

sizeMethod · 0.80
endMethod · 0.80
createGiMethod · 0.45
addToSceneMethod · 0.45
setVisibleMethod · 0.45
nameMethod · 0.45
typeMethod · 0.45
idMethod · 0.45
setIdMethod · 0.45
addPathMethod · 0.45

Tested by

no test coverage detected