Replaced Uuid with QUuid

This commit is contained in:
pasdam 2018-03-22 22:56:05 +01:00 committed by Jonathan White
parent dcece140a0
commit ad4423d226
No known key found for this signature in database
GPG key ID: 440FC65F2E0C6E01
49 changed files with 413 additions and 612 deletions

View file

@ -73,7 +73,7 @@ Group::~Group()
Group* Group::createRecycleBin()
{
Group* recycleBin = new Group();
recycleBin->setUuid(Uuid::random());
recycleBin->setUuid(QUuid::createUuid());
recycleBin->setName(tr("Recycle Bin"));
recycleBin->setIcon(RecycleBinIconNumber);
recycleBin->setSearchingEnabled(Group::Disable);
@ -105,7 +105,7 @@ void Group::setUpdateTimeinfo(bool value)
m_updateTimeinfo = value;
}
Uuid Group::uuid() const
const QUuid& Group::uuid() const
{
return m_uuid;
}
@ -171,7 +171,7 @@ int Group::iconNumber() const
return m_data.iconNumber;
}
Uuid Group::iconUuid() const
const QUuid& Group::iconUuid() const
{
return m_data.customIcon;
}
@ -259,7 +259,7 @@ const CustomData* Group::customData() const
return m_customData;
}
void Group::setUuid(const Uuid& uuid)
void Group::setUuid(const QUuid& uuid)
{
set(m_uuid, uuid);
}
@ -282,13 +282,13 @@ void Group::setIcon(int iconNumber)
if (m_data.iconNumber != iconNumber || !m_data.customIcon.isNull()) {
m_data.iconNumber = iconNumber;
m_data.customIcon = Uuid();
m_data.customIcon = QUuid();
emit modified();
emit dataChanged(this);
}
}
void Group::setIcon(const Uuid& uuid)
void Group::setIcon(const QUuid& uuid)
{
Q_ASSERT(!uuid.isNull());
@ -514,8 +514,9 @@ Entry* Group::findEntry(QString entryId)
Q_ASSERT(!entryId.isNull());
Entry* entry;
if (Uuid::isUuid(entryId)) {
entry = findEntryByUuid(Uuid::fromHex(entryId));
QUuid entryUuid = QUuid::fromRfc4122(QByteArray::fromHex(entryId.toLatin1()));
if (!entryUuid.isNull()) {
entry = findEntryByUuid(entryUuid);
if (entry) {
return entry;
}
@ -535,7 +536,7 @@ Entry* Group::findEntry(QString entryId)
return nullptr;
}
Entry* Group::findEntryByUuid(const Uuid& uuid)
Entry* Group::findEntryByUuid(const QUuid& uuid)
{
Q_ASSERT(!uuid.isNull());
for (Entry* entry : entriesRecursive(false)) {
@ -654,9 +655,9 @@ QList<Group*> Group::groupsRecursive(bool includeSelf)
return groupList;
}
QSet<Uuid> Group::customIconsRecursive() const
QSet<QUuid> Group::customIconsRecursive() const
{
QSet<Uuid> result;
QSet<QUuid> result;
if (!iconUuid().isNull()) {
result.insert(iconUuid());
@ -730,7 +731,7 @@ void Group::merge(const Group* other)
emit modified();
}
Group* Group::findChildByUuid(const Uuid& uuid)
Group* Group::findChildByUuid(const QUuid& uuid)
{
Q_ASSERT(!uuid.isNull());
for (Group* group : groupsRecursive(true)) {
@ -760,7 +761,7 @@ Group* Group::clone(Entry::CloneFlags entryFlags, Group::CloneFlags groupFlags)
clonedGroup->setUpdateTimeinfo(false);
if (groupFlags & Group::CloneNewUuid) {
clonedGroup->setUuid(Uuid::random());
clonedGroup->setUuid(QUuid::createUuid());
} else {
clonedGroup->setUuid(this->uuid());
}
@ -1042,7 +1043,7 @@ Entry* Group::addEntryWithPath(QString entryPath)
Entry* entry = new Entry();
entry->setTitle(entryTitle);
entry->setUuid(Uuid::random());
entry->setUuid(QUuid::createUuid());
entry->setGroup(group);
return entry;