mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-29 05:44:14 +02:00
6f9f5f84c2
Opening an element you cannot write -- anything from the QET collection, for instance -- disabled Copy along with everything else, so there was no way to reuse a primitive from it. The workaround was to save the whole element into your own collection first, just to take one shape out of it. Two actions stood in the way, and neither of them modifies anything: - Select All and Invert Selection were in the list disabled outright when read only, so nothing could be selected in the first place; - Copy was enabled only when "!m_read_only && selectedItems().count()", so even a mouse selection left it greyed out. Both now work on a read-only element. Copy is safe there: ElementScene::copy() serialises the current selection to the clipboard and touches neither the element nor the file. Cut, Paste, Paste-in-area, Delete, Rotate, Flip, Mirror, the depth actions and the add-primitive tools stay disabled exactly as before, so the element is still protected -- this only stops the editor from refusing to read out what it is already displaying. Verified with a chmod 444 element: Select All then Copy now work, the clipboard receives the expected <definition> with all three primitives, Cut/Paste/Delete remain greyed out, Save stays disabled, and the file is untouched (same permissions, same checksum).