Add Screenshot portal using KWin Screenshot DBus interface.
Details
Details
- Reviewers
graesslin davidedmundson romangg Kanedias - Group Reviewers
Plasma - Commits
- R838:06ceacee329c: Add Screenshot portal
Diff Detail
Diff Detail
- Repository
- R838 Flatpak Support: KDE Portal for XDG Desktop
- Branch
- master
- Lint
No Linters Available - Unit
No Unit Test Coverage
src/screenshot.cpp | ||
---|---|---|
63–65 | You call 3 times deleteLater (even 1 more than as needed) so you can simplified logic QPointer<ScreenshotDialog> screenshotDialog = new ScreenshotDialog(); QImage screenshot = screenshotDialog->exec() ? screenshotDialog->image() : QImage{}; if (screenshotDialog) { screenshotDialog->deleteLater(); } And dialog can be deleted in exec which will result in crash at line 81 |
Comment Actions
Looks ok to me, only minor question about how this works
src/screenshotdialog.cpp | ||
---|---|---|
129 | Are we safe closing the fd 1 here? Are we sure it already got through asyncCall? |
Comment Actions
It should be correct, because from Qt documentation, using QDbusUnixFileDescriptor creates a duplicate of that file descriptor so it should be safe to close it right after.