Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Kleopatra
Commits
34f54202
Commit
34f54202
authored
Mar 03, 2021
by
Ingo Klöcker
Browse files
Move protocol to options helper to CertificateSelectionDialog
GnuPG-bug-id: 5332
parent
c5803459
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/crypto/gui/resolverecipientspage.cpp
View file @
34f54202
...
...
@@ -220,15 +220,6 @@ bool ResolveRecipientsPage::ItemWidget::isSelected() const
return
m_selected
;
}
static
CertificateSelectionDialog
::
Option
protocol2option
(
GpgME
::
Protocol
proto
)
{
switch
(
proto
)
{
case
OpenPGP
:
return
CertificateSelectionDialog
::
OpenPGPFormat
;
case
CMS
:
return
CertificateSelectionDialog
::
CMSFormat
;
default:
return
CertificateSelectionDialog
::
AnyFormat
;
}
}
static
CertificateSelectionDialog
*
createCertificateSelectionDialog
(
QWidget
*
parent
,
GpgME
::
Protocol
prot
)
{
CertificateSelectionDialog
*
const
dlg
=
new
CertificateSelectionDialog
(
parent
);
...
...
@@ -236,7 +227,7 @@ static CertificateSelectionDialog *createCertificateSelectionDialog(QWidget *par
CertificateSelectionDialog
::
SingleSelection
|
CertificateSelectionDialog
::
EncryptOnly
|
CertificateSelectionDialog
::
MultiSelection
|
protocol2option
(
prot
);
CertificateSelectionDialog
::
optionsFromProtocol
(
prot
);
dlg
->
setOptions
(
options
);
return
dlg
;
}
...
...
src/dialogs/certificateselectiondialog.cpp
View file @
34f54202
...
...
@@ -57,6 +57,16 @@ using namespace Kleo::Dialogs;
using
namespace
Kleo
::
Commands
;
using
namespace
GpgME
;
CertificateSelectionDialog
::
Option
CertificateSelectionDialog
::
optionsFromProtocol
(
Protocol
proto
)
{
switch
(
proto
)
{
case
OpenPGP
:
return
CertificateSelectionDialog
::
OpenPGPFormat
;
case
CMS
:
return
CertificateSelectionDialog
::
CMSFormat
;
default:
return
CertificateSelectionDialog
::
AnyFormat
;
}
}
class
CertificateSelectionDialog
::
Private
{
friend
class
::
Kleo
::
Dialogs
::
CertificateSelectionDialog
;
...
...
src/dialogs/certificateselectiondialog.h
View file @
34f54202
...
...
@@ -14,6 +14,8 @@
#include <utils/pimpl_ptr.h>
#include <gpgme++/global.h>
#include <memory>
#include <vector>
...
...
@@ -57,6 +59,8 @@ public:
};
Q_DECLARE_FLAGS
(
Options
,
Option
)
static
Option
optionsFromProtocol
(
GpgME
::
Protocol
proto
);
explicit
CertificateSelectionDialog
(
QWidget
*
parent
=
nullptr
);
~
CertificateSelectionDialog
()
override
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment