363 // Delete the objects that were being selected |
363 // Delete the objects that were being selected |
364 for (LDObject* obj : selCopy) |
364 for (LDObject* obj : selCopy) |
365 obj->destroy(); |
365 obj->destroy(); |
366 |
366 |
367 refresh(); |
367 refresh(); |
368 return selCopy.size(); |
368 return length(selCopy); |
369 } |
369 } |
370 |
370 |
371 // --------------------------------------------------------------------------------------------------------------------- |
371 // --------------------------------------------------------------------------------------------------------------------- |
372 // |
372 // |
373 void MainWindow::buildObjectList() |
373 void MainWindow::buildObjectList() |
717 |
717 |
718 // --------------------------------------------------------------------------------------------------------------------- |
718 // --------------------------------------------------------------------------------------------------------------------- |
719 // |
719 // |
720 void MainWindow::spawnContextMenu (const QPoint& position) |
720 void MainWindow::spawnContextMenu (const QPoint& position) |
721 { |
721 { |
722 const bool single = (selectedObjects().size() == 1); |
722 const bool single = (length(selectedObjects()) == 1); |
723 LDObject* singleObj = single ? selectedObjects().first() : nullptr; |
723 LDObject* singleObj = single ? selectedObjects().first() : nullptr; |
724 |
724 |
725 bool hasSubfiles = false; |
725 bool hasSubfiles = false; |
726 |
726 |
727 for (LDObject* obj : selectedObjects()) |
727 for (LDObject* obj : selectedObjects()) |
1275 // This little beauty closes the initial file that was open at first when opening a new file over it. |
1275 // This little beauty closes the initial file that was open at first when opening a new file over it. |
1276 // |
1276 // |
1277 void MainWindow::closeInitialDocument() |
1277 void MainWindow::closeInitialDocument() |
1278 { |
1278 { |
1279 /* |
1279 /* |
1280 if (m_documents.size() == 2 and |
1280 if (length(m_documents) == 2 and |
1281 m_documents[0]->name().isEmpty() and |
1281 m_documents[0]->name().isEmpty() and |
1282 not m_documents[1]->name().isEmpty() and |
1282 not m_documents[1]->name().isEmpty() and |
1283 not m_documents[0]->hasUnsavedChanges()) |
1283 not m_documents[0]->hasUnsavedChanges()) |
1284 { |
1284 { |
1285 m_documents.first()->close(); |
1285 m_documents.first()->close(); |