mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-24 23:09:44 -05:00
Use static method instead of a constructor for random Uuids.
This commit is contained in:
parent
d8b21c8b04
commit
a3211872e0
@ -19,6 +19,7 @@
|
||||
|
||||
TimeInfo::TimeInfo()
|
||||
{
|
||||
m_expires = false;
|
||||
}
|
||||
|
||||
QDateTime TimeInfo::lastModificationTime() const
|
||||
|
@ -25,15 +25,6 @@ Uuid::Uuid() : m_data(length, 0)
|
||||
{
|
||||
}
|
||||
|
||||
Uuid::Uuid(bool generate) : m_data(length, 0)
|
||||
{
|
||||
if (generate) {
|
||||
while (isNull()) {
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Uuid::Uuid(const QByteArray& data)
|
||||
{
|
||||
Q_ASSERT(data.size() == 16);
|
||||
@ -41,6 +32,12 @@ Uuid::Uuid(const QByteArray& data)
|
||||
m_data = data;
|
||||
}
|
||||
|
||||
Uuid Uuid::random() {
|
||||
QByteArray randomAray;
|
||||
// TODO fill with random data
|
||||
return Uuid(randomAray);
|
||||
}
|
||||
|
||||
QString Uuid::toBase64() const
|
||||
{
|
||||
return m_data.toBase64();
|
||||
|
@ -25,8 +25,8 @@ class Uuid
|
||||
{
|
||||
public:
|
||||
Uuid();
|
||||
explicit Uuid(bool generate);
|
||||
explicit Uuid(const QByteArray& data);
|
||||
static Uuid random();
|
||||
QString toBase64() const;
|
||||
QByteArray toByteArray() const;
|
||||
bool isNull() const;
|
||||
|
Loading…
Reference in New Issue
Block a user