KWallet

kwalletentry.cc
1/*
2 This file is part of the KDE project
3 SPDX-FileCopyrightText: 2001-2003 George Staikos <staikos@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#include "kwalletentry.h"
9
10using namespace KWallet;
11#include <QDataStream>
12#include <QIODevice>
13
14Entry::Entry()
15{
16}
17
18Entry::~Entry()
19{
20 _value.fill(0);
21}
22
23const QString &Entry::key() const
24{
25 return _key;
26}
27
28const QByteArray &Entry::value() const
29{
30 return _value;
31}
32
33QString Entry::password() const
34{
35 QString x;
36 QDataStream qds(_value);
37 qds >> x;
38 return x;
39}
40
41void Entry::setValue(const QByteArray &val)
42{
43 // do a direct copy from one into the other without
44 // temporary variables
45 _value.fill(0);
46 _value = val;
47}
48
49void Entry::setValue(const QString &val)
50{
51 _value.fill(0);
53 qds << val;
54}
55
56void Entry::setKey(const QString &key)
57{
58 _key = key;
59}
60
61Wallet::EntryType Entry::type() const
62{
63 return _type;
64}
65
66void Entry::setType(Wallet::EntryType type)
67{
68 _type = type;
69}
70
71void Entry::copy(const Entry *x)
72{
73 _type = x->_type;
74 _key = x->_key;
75 _value.fill(0);
76 _value = x->_value;
77}
78
Type type(const QSqlDatabase &db)
QByteArray & fill(char ch, qsizetype size)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:06 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.