Page MenuHome GnuPG

qt: Add function for synchronously executing ExportJob
ClosedPublic

Authored by TobiasFella on Jan 19 2024, 1:48 PM.

Details

Reviewers
ikloecker
Summary
  • lang/qt/src/exportjob: Add exec function.
  • lang/qt/src/qgpgmeexportjob.cpp: Implement exec function.
  • lang/qt/src/qgpgmeexportjob.h: Override exec function.
Test Plan

test with kleopatra / libkleo drag MRs

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

TobiasFella created this revision.
lang/qt/src/exportjob.h
85

This breaks the ABI. You must move this new virtual member below setExportFlags. Additionally, the function cannot be pure virtual. You have to add an (empty, non-inline) implementation (as was done for setExportFlags; the implementation is in qgpgmeexportjob.cpp for no apparent reason).

I've learnt this the hard way. I've been using abidiff from time to time since then to check for obvious ABI breakage.

lang/qt/src/qgpgmeexportjob.cpp
94

Most (or all?) other exec() functions call

resultHook(r);

I'm not sure why because only some Jobs overwrite resultHook and the default implementation is empty. Unless you find a reason why calling resultHook makes sense, you can leave it out.

96
return std::get<0>(r);
TobiasFella marked 3 inline comments as done.
TobiasFella added inline comments.
lang/qt/src/qgpgmeexportjob.cpp
94

I don't see a resason to do it either. Most implementations use it to store the result in a member variable, but we don't need that here

This revision is now accepted and ready to land.Jan 22 2024, 10:46 AM
TobiasFella marked an inline comment as done.

Merged.