mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-04-05 05:27:39 +03:00
Removing QWidget dependency from src/core.
This commit is contained in:
parent
6f5bbf7ad1
commit
004f2b6801
46 changed files with 298 additions and 313 deletions
|
@ -19,7 +19,7 @@
|
|||
#include "Entry.h"
|
||||
|
||||
#include "core/Config.h"
|
||||
#include "core/DatabaseIcons.h"
|
||||
#include "core/Database.h"
|
||||
#include "core/Group.h"
|
||||
#include "core/Metadata.h"
|
||||
#include "core/PasswordHealth.h"
|
||||
|
@ -159,40 +159,6 @@ const QString Entry::uuidToHex() const
|
|||
return Tools::uuidToHex(m_uuid);
|
||||
}
|
||||
|
||||
QImage Entry::icon() const
|
||||
{
|
||||
if (m_data.customIcon.isNull()) {
|
||||
return databaseIcons()->icon(m_data.iconNumber).toImage();
|
||||
} else {
|
||||
Q_ASSERT(database());
|
||||
|
||||
if (database()) {
|
||||
return database()->metadata()->customIcon(m_data.customIcon);
|
||||
} else {
|
||||
return QImage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QPixmap Entry::iconPixmap(IconSize size) const
|
||||
{
|
||||
QPixmap icon(size, size);
|
||||
if (m_data.customIcon.isNull()) {
|
||||
icon = databaseIcons()->icon(m_data.iconNumber, size);
|
||||
} else {
|
||||
Q_ASSERT(database());
|
||||
if (database()) {
|
||||
icon = database()->metadata()->customIconPixmap(m_data.customIcon, size);
|
||||
}
|
||||
}
|
||||
|
||||
if (isExpired()) {
|
||||
icon = databaseIcons()->applyBadge(icon, DatabaseIcons::Badges::Expired);
|
||||
}
|
||||
|
||||
return icon;
|
||||
}
|
||||
|
||||
int Entry::iconNumber() const
|
||||
{
|
||||
return m_data.iconNumber;
|
||||
|
@ -1217,7 +1183,8 @@ void Entry::setGroup(Group* group)
|
|||
// copy custom icon to the new database
|
||||
if (!iconUuid().isNull() && group->database() && m_group->database()->metadata()->hasCustomIcon(iconUuid())
|
||||
&& !group->database()->metadata()->hasCustomIcon(iconUuid())) {
|
||||
group->database()->metadata()->addCustomIcon(iconUuid(), icon());
|
||||
group->database()->metadata()->addCustomIcon(iconUuid(),
|
||||
m_group->database()->metadata()->customIcon(iconUuid()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue