mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-14 16:57:32 -05:00
Split EditWidgetIcons::save() into state() and reset().
This commit is contained in:
parent
61ce733c6f
commit
8f87b5cfd4
@ -61,11 +61,8 @@ EditWidgetIcons::~EditWidgetIcons()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
IconStruct EditWidgetIcons::save()
|
IconStruct EditWidgetIcons::state() const
|
||||||
{
|
{
|
||||||
Q_ASSERT(m_database);
|
|
||||||
Q_ASSERT(!m_currentUuid.isNull());
|
|
||||||
|
|
||||||
IconStruct iconStruct;
|
IconStruct iconStruct;
|
||||||
if (m_ui->defaultIconsRadio->isChecked()) {
|
if (m_ui->defaultIconsRadio->isChecked()) {
|
||||||
QModelIndex index = m_ui->defaultIconsView->currentIndex();
|
QModelIndex index = m_ui->defaultIconsView->currentIndex();
|
||||||
@ -86,9 +83,13 @@ IconStruct EditWidgetIcons::save()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return iconStruct;
|
||||||
|
}
|
||||||
|
|
||||||
|
void EditWidgetIcons::reset()
|
||||||
|
{
|
||||||
m_database = nullptr;
|
m_database = nullptr;
|
||||||
m_currentUuid = Uuid();
|
m_currentUuid = Uuid();
|
||||||
return iconStruct;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditWidgetIcons::load(Uuid currentUuid, Database* database, IconStruct iconStruct)
|
void EditWidgetIcons::load(Uuid currentUuid, Database* database, IconStruct iconStruct)
|
||||||
|
@ -46,7 +46,8 @@ public:
|
|||||||
explicit EditWidgetIcons(QWidget* parent = nullptr);
|
explicit EditWidgetIcons(QWidget* parent = nullptr);
|
||||||
~EditWidgetIcons();
|
~EditWidgetIcons();
|
||||||
|
|
||||||
IconStruct save();
|
IconStruct state() const;
|
||||||
|
void reset();
|
||||||
void load(Uuid currentUuid, Database* database, IconStruct iconStruct);
|
void load(Uuid currentUuid, Database* database, IconStruct iconStruct);
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
|
@ -430,7 +430,7 @@ void EditEntryWidget::saveEntry()
|
|||||||
m_entry->attributes()->copyCustomKeysFrom(m_entryAttributes);
|
m_entry->attributes()->copyCustomKeysFrom(m_entryAttributes);
|
||||||
m_entry->attachments()->copyDataFrom(m_entryAttachments);
|
m_entry->attachments()->copyDataFrom(m_entryAttachments);
|
||||||
|
|
||||||
IconStruct iconStruct = m_iconsWidget->save();
|
IconStruct iconStruct = m_iconsWidget->state();
|
||||||
|
|
||||||
if (iconStruct.number < 0) {
|
if (iconStruct.number < 0) {
|
||||||
m_entry->setIcon(Entry::DefaultIconNumber);
|
m_entry->setIcon(Entry::DefaultIconNumber);
|
||||||
@ -489,6 +489,7 @@ void EditEntryWidget::clear()
|
|||||||
m_entryAttachments->clear();
|
m_entryAttachments->clear();
|
||||||
m_autoTypeAssoc->clear();
|
m_autoTypeAssoc->clear();
|
||||||
m_historyModel->clear();
|
m_historyModel->clear();
|
||||||
|
m_iconsWidget->reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditEntryWidget::togglePasswordGeneratorButton(bool checked)
|
void EditEntryWidget::togglePasswordGeneratorButton(bool checked)
|
||||||
|
@ -113,7 +113,7 @@ void EditGroupWidget::save()
|
|||||||
m_group->setDefaultAutoTypeSequence(m_mainUi->autoTypeSequenceCustomEdit->text());
|
m_group->setDefaultAutoTypeSequence(m_mainUi->autoTypeSequenceCustomEdit->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
IconStruct iconStruct = m_editGroupWidgetIcons->save();
|
IconStruct iconStruct = m_editGroupWidgetIcons->state();
|
||||||
|
|
||||||
if (iconStruct.number < 0) {
|
if (iconStruct.number < 0) {
|
||||||
m_group->setIcon(Group::DefaultIconNumber);
|
m_group->setIcon(Group::DefaultIconNumber);
|
||||||
@ -144,6 +144,7 @@ void EditGroupWidget::clear()
|
|||||||
{
|
{
|
||||||
m_group = nullptr;
|
m_group = nullptr;
|
||||||
m_database = nullptr;
|
m_database = nullptr;
|
||||||
|
m_editGroupWidgetIcons->reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditGroupWidget::addTriStateItems(QComboBox* comboBox, bool inheritDefault)
|
void EditGroupWidget::addTriStateItems(QComboBox* comboBox, bool inheritDefault)
|
||||||
|
Loading…
Reference in New Issue
Block a user