10 #include <KLocalizedString> 13 #include <QDataStream> 14 #include <QSharedData> 26 Private(
const Private &other)
30 mBinaryData = other.mBinaryData;
31 mTextData = other.mTextData;
32 mCustomTypeString = other.mCustomTypeString;
33 mIsBinary = other.mIsBinary;
65 if (d->mId != other.d->mId) {
69 if (d->mType != other.d->mType) {
73 if (d->mIsBinary != other.d->mIsBinary) {
78 if (d->mBinaryData != other.d->mBinaryData) {
82 if (d->mTextData != other.d->mTextData) {
87 if (d->mCustomTypeString != other.d->mCustomTypeString) {
96 return !(*
this == other);
101 if (
this != &other) {
120 d->mBinaryData = binary;
126 return d->mBinaryData;
132 d->mIsBinary =
false;
152 d->mCustomTypeString = custom;
162 return d->mCustomTypeString;
168 str += QStringLiteral(
" Id: %1\n").
arg(d->mId);
169 str += QStringLiteral(
" Type: %1\n").
arg(
typeLabel(d->mType));
171 str += QStringLiteral(
" CustomType: %1\n").
arg(d->mCustomTypeString);
173 str += QStringLiteral(
" IsBinary: %1\n").
174 arg(d->mIsBinary ? QStringLiteral(
"true") : QStringLiteral(
"false"));
176 str += QStringLiteral(
" Binary: %1\n").
179 str += QStringLiteral(
" Text: %1\n").
arg(d->mTextData);
201 return i18nc(
"X.509 public key",
"X509");
204 return i18nc(
"Pretty Good Privacy key",
"PGP");
207 return i18nc(
"A custom key",
"Custom");
210 return i18nc(
"another type of encryption key",
"Unknown type");
217 return s << key.d->mId << key.d->mType << key.d->mIsBinary << key.d->mBinaryData
218 << key.d->mTextData << key.d->mCustomTypeString;
224 s >> key.d->mId >> type >> key.d->mIsBinary >> key.d->mBinaryData >> key.d->mTextData
225 >> key.d->mCustomTypeString;
QString i18nc(const char *context, const char *text, const TYPE &arg...)
bool isEmpty() const const
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
QString fromLatin1(const char *str, int size)
KCOREADDONS_EXPORT QString randomString(int length)