Merged revisions 935548 via svnmerge from

svn+ssh://tmcguire@svn.kde.org/home/kde/branches/kdepim/enterprise/kdepim

........
  r935548 | mutz | 2009-03-05 16:02:46 +0100 (Thu, 05 Mar 2009) | 1 line
  
  Don't allow selection of S/MIME certificates when we only want OpenPGP ones (and vice versa).
........

svn path=/branches/kdepim/enterprise4/kdepim/; revision=938085
wilder-work
Thomas McGuire 17 years ago
parent c816378212
commit 0a8cbeacb1
  1. 7
      keyresolver.cpp
  2. 7
      kleo_util.h

@ -1487,9 +1487,14 @@ std::vector<GpgME::Key> Kleo::KeyResolver::signingKeys( CryptoMessageFormat f )
std::vector<GpgME::Key> Kleo::KeyResolver::selectKeys( const QString & person, const QString & msg, const std::vector<GpgME::Key> & selectedKeys ) const {
const bool opgp = containsOpenPGP( mCryptoMessageFormats );
const bool x509 = containsSMIME( mCryptoMessageFormats );
Kleo::KeySelectionDialog dlg( i18n("Encryption Key Selection"),
msg, selectedKeys,
Kleo::KeySelectionDialog::ValidEncryptionKeys,
Kleo::KeySelectionDialog::ValidEncryptionKeys
& ~(opgp ? 0 : Kleo::KeySelectionDialog::OpenPGPKeys)
& ~(x509 ? 0 : Kleo::KeySelectionDialog::SMIMEKeys),
true, true ); // multi-selection and "remember choice" box
if ( dlg.exec() != QDialog::Accepted )

@ -77,5 +77,12 @@ static inline bool isOpenPGP( Kleo::CryptoMessageFormat f ) {
return f == Kleo::InlineOpenPGPFormat || f == Kleo::OpenPGPMIMEFormat ;
}
static inline bool containsSMIME( unsigned int f ) {
return f & (Kleo::SMIMEFormat|Kleo::SMIMEOpaqueFormat) ;
}
static inline bool containsOpenPGP( unsigned int f ) {
return f & (Kleo::OpenPGPMIMEFormat|Kleo::InlineOpenPGPFormat) ;
}
#endif // __KDEPIM_KMAIL_KLEO_UTIL_H__

Loading…
Cancel
Save