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
93091020
Commit
93091020
authored
May 19, 2021
by
Ingo Klöcker
Browse files
Allow checking KeyPairInfo for equality
GnuPG-bug-id: 4876
parent
377ac424
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/smartcard/keypairinfo.cpp
View file @
93091020
...
...
@@ -82,3 +82,19 @@ void KeyPairInfo::update(const KeyPairInfo &other)
algorithm
=
other
.
algorithm
;
}
}
// C++20: Replace with defaulted equality operator
bool
KeyPairInfo
::
operator
==
(
const
KeyPairInfo
&
other
)
const
{
return
keyRef
==
other
.
keyRef
&&
grip
==
other
.
grip
&&
usage
==
other
.
usage
&&
keyTime
==
other
.
keyTime
&&
algorithm
==
other
.
algorithm
;
}
// C++20: Remove
bool
KeyPairInfo
::
operator
!=
(
const
KeyPairInfo
&
other
)
const
{
return
!
operator
==
(
other
);
}
src/smartcard/keypairinfo.h
View file @
93091020
...
...
@@ -24,6 +24,9 @@ struct KeyPairInfo {
void
update
(
const
KeyPairInfo
&
other
);
bool
operator
==
(
const
KeyPairInfo
&
other
)
const
;
bool
operator
!=
(
const
KeyPairInfo
&
other
)
const
;
std
::
string
keyRef
;
std
::
string
grip
;
std
::
string
usage
;
...
...
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