# fix\(share\): save aggregate usage PNG without losing grab result \(\#356\) · lucenx/codexbar-plasma

[View on GitCafe](https://git.cafe/lucenx/codexbar-plasma/commit/ff3d4789da8cb554d6757d7c11fa9ec727371c55)

Repository: [lucenx/codexbar-plasma](https://git.cafe/lucenx/codexbar-plasma)

Visibility: public

Requested revision: ff3d4789da8cb554d6757d7c11fa9ec727371c55

Requested commit: ff3d4789da8cb554d6757d7c11fa9ec727371c55

Commit: ff3d4789da8cb554d6757d7c11fa9ec727371c55

Tree: 7974f4370dcf4287aaf346a612e7f226062e6248

Author: Simone

Committer: GitHub

## Message

```
fix(share): save aggregate usage PNG without losing grab result (#356)

* fix(share): save aggregate usage PNG without losing grab result

In Qt Quick, QQuickItemGrabResult schedules deleteLater() immediately after its completion callback returns. Storing the grab result across the file dialog event loop cycle caused the captured image reference to be lost by the time the user selected a save path, failing every save with 'Choose a local PNG file.'.

Open the save dialog directly when saving, and grab and save to file synchronously within the grabToImage callback once the path is confirmed. Also update export tests to await the grab and verify the output.

* fix(share): guard save dialog while capturing and share grab helper

Check the capturing/visible/dialog guard before opening the save picker so
Save PNG during an in-flight copy no longer opens a picker whose accepted
path is then dropped. Report the busy saveImage path with feedback instead
of a silent false, and run both copy and save captures through one grabCard
helper with the existing generation/stale retirement.

Add an offscreen regression test for the save-while-capturing overlap.

* chore(i18n): regenerate catalog after share grab reorder

The grabCard helper moved "Could not create the image. Try again." above
"Image copied" in ShareUsageWindow.qml. No strings added or removed.
```

## Parents

- [807e6cab38c0358d356b6d99ce48e13aca78be9b](https://git.cafe/lucenx/codexbar-plasma/commit/807e6cab38c0358d356b6d99ce48e13aca78be9b?format=markdown)

[Source at this commit](https://git.cafe/lucenx/codexbar-plasma/tree/ff3d4789da8cb554d6757d7c11fa9ec727371c55?format=markdown)
