Commit Graph

10 Commits

Author SHA1 Message Date
Ingo Klöcker
60b96d149c
qt: Specify import options as list of strings instead of as string
* lang/qt/src/importjob.cpp, lang/qt/src/importjob.h (setImportOptions):
Change type of argument "options" to QStringList.
(importOptions): Change return type to QStringList.
* lang/qt/src/importjob_p.h (struct ImportJobPrivate): Change type of
member m_importOptions to QStringList.
* lang/qt/src/qgpgmeimportjob.cpp (import_qba): Change type of argument
"importOptions" to QStringList. Join list of import options with ','
when setting the "import-options" context flag.

* lang/qt/tests/t-import.cpp (ImportTest::testImportWithImportOptions):
Adapt to API change.
--

This makes the API that was introduced with the previous commit easier
to use.

GnuPG-bug-id: 7152
2024-06-13 10:05:44 +02:00
Ingo Klöcker
2187a4de8c
qt: Allow specifying import options when importing keys
* lang/qt/src/importjob.cpp, lang/qt/src/importjob.h (class ImportJob):
Add member functions setImportOptions and importOptions.
* lang/qt/src/importjob_p.h (struct ImportJobPrivate): Add member
m_importOptions.
* lang/qt/src/qgpgmeimportjob.cpp (import_qba): Add arg importOptions
and adjust the callers. Set import options context flag.

* lang/qt/tests/t-import.cpp (ImportTest): Add member function
testImportWithImportOptions.
--

GnuPG-bug-id: 7152
2024-06-12 11:34:41 +02:00
Ingo Klöcker
2b98585c89
qt,tests: Avoid leaking Context
* lang/qt/tests/t-import.cpp: Wrap Context*s in unique_ptr.
--

This fixes leaks found with -fsanitize=address.
2023-01-31 12:01:33 +01:00
Ingo Klöcker
64da77620a
qt: Fix comparisons of integer expressions of different signedness
* lang/qt/tests/t-import.cpp (ImportTest::testImportWithImportFilter):
Make integer literal unsigned.
--
2023-01-05 20:33:45 +01:00
Ingo Klöcker
398375a0ab
qt: Allow deferred start of import job
* lang/qt/src/importjob.h (ImportJob::startLater): New pure virtual
method.
* lang/qt/src/qgpgmeimportjob.cpp, lang/qt/src/qgpgmeimportjob.h
(QGpgMEImportJob::startLater): New method.

* lang/qt/tests/t-import.cpp (ImportTest::testDeferredStart): New.
--

This makes it possible to prepare an import job for a deferred start.

GnuPG-bug-id: 6323
2023-01-05 14:24:31 +01:00
Ingo Klöcker
9c03bde06b qt: Fix build without installed GpgME++ headers
* lang/qt/src/importjob.h, lang/qt/src/wkdlookupresult.h: Include
headers of GpgME++ without "gpgme++/" prefix when building QGpgme.
* lang/qt/src/qgpgmeimportjob.cpp, lang/qt/src/qgpgmewkdlookupjob.cpp,
lang/qt/src/wkdlookupresult.cpp, lang/qt/tests/t-import.cpp: Include
headers of GpgME++ without "gpgme++/" prefix.
--
2022-01-17 14:41:17 +01:00
Ingo Klöcker
a54402fc2d qt,tests: Add asyncDone signal to base class of all tests
* lang/qt/tests/t-support.h (class QGpgMETest): Add signal asyncDone.
* lang/qt/tests/t-changeexpiryjob.cpp,
lang/qt/tests/t-encrypt.cpp,
lang/qt/tests/t-import.cpp,
lang/qt/tests/t-keylist.cpp,
lang/qt/tests/t-keylocate.cpp,
lang/qt/tests/t-ownertrust.cpp,
lang/qt/tests/t-remarks.cpp,
lang/qt/tests/t-tofuinfo.cpp,
lang/qt/tests/t-trustsignatures.cpp,
lang/qt/tests/t-various.cpp,
lang/qt/tests/t-wkdlookup.cpp,
lang/qt/tests/t-wkspublish.cpp: Remove signal asyncDone from the test
classes.
--

This reduces duplication and makes it possible to use the signal in
the base class.

GnuPG-bug-id: 5770
2022-01-13 11:36:35 +01:00
Ingo Klöcker
619579bb17 qt: Allow specifying an import filter when importing keys
* lang/qt/src/importjob.cpp (struct ImportJobPrivate): Add member
m_importFilter.
* lang/qt/src/importjob.cpp, lang/qt/src/importjob.h (class ImportJob):
Add member functions setImportFilter and importFilter.
* lang/qt/src/qgpgmeimportjob.cpp (import_qba): Add arg importFilter
and adjust the callers. Set import filter context flag.

* lang/qt/tests/t-import.cpp (ImportTest): Add member function
testImportWithImportFilter.
--

GnuPG-bug-id: 5739
2021-12-15 15:00:07 +01:00
Ingo Klöcker
3e81a4a336 qt: Avoid test failure when test is run multiple times
* lang/qt/tests/t-import.cpp (ImportTest): Add member tempGpgHome and
member function initTestCase.
(keyFpr, keyData): Move to ImportTest::testImportWithKeyOrigin.
--

Use different temporary GNUPGHOME's when running the test. This ensures
that the import in the test is always done with a new keyring.

GnuPG-bug-id: 5733
2021-12-15 12:21:28 +01:00
Ingo Klöcker
fd6bec617d qt: Allow setting key origin when importing keys
* lang/qt/src/Makefile.am (qgpgme_sources): Add importjob.cpp.
* lang/qt/src/importjob.cpp: New.
* lang/qt/src/importjob.h (class ImportJob): Add member functions
setKeyOrigin, keyOrigin, keyOriginUrl.
* lang/qt/src/qgpgmeimportjob.cpp (originToString): New.
(import_qba): Set key origin context flag.
(QGpgMEImportJob::start, QGpgMEImportJob::exec): Add options to call
of import_qba.

* lang/qt/tests/Makefile.am (the_tests, moc_files, noinst_PROGRAMS):
Add new test.
(t_import_SOURCES): New.
* lang/qt/tests/t-import.cpp: New.
--

GnuPG-bug-id: 5733
2021-12-14 11:47:09 +01:00