mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-02-18 05:14:16 -05:00
Merge branch 'master' of https://github.com/keepassx/keepassx
This commit is contained in:
commit
65eb71e645
@ -37,7 +37,7 @@ Database::Database()
|
||||
{
|
||||
m_data.cipher = KeePass2::CIPHER_AES;
|
||||
m_data.compressionAlgo = CompressionGZip;
|
||||
m_data.transformRounds = 50000;
|
||||
m_data.transformRounds = 100000;
|
||||
m_data.hasKey = false;
|
||||
|
||||
setRootGroup(new Group());
|
||||
|
@ -616,7 +616,17 @@ QList<Entry*> Group::search(const QString& searchTerm, Qt::CaseSensitivity caseS
|
||||
bool resolveInherit)
|
||||
{
|
||||
QList<Entry*> searchResult;
|
||||
if (includeInSearch(resolveInherit)) {
|
||||
bool search;
|
||||
if (resolveInherit) {
|
||||
search = resolveSearchingEnabled();
|
||||
}
|
||||
else if (searchingEnabled() == Disable) {
|
||||
search = false;
|
||||
}
|
||||
else {
|
||||
search = true;
|
||||
}
|
||||
if (search) {
|
||||
Q_FOREACH (Entry* entry, m_entries) {
|
||||
if (entry->match(searchTerm, caseSensitivity)) {
|
||||
searchResult.append(entry);
|
||||
@ -629,7 +639,7 @@ QList<Entry*> Group::search(const QString& searchTerm, Qt::CaseSensitivity caseS
|
||||
return searchResult;
|
||||
}
|
||||
|
||||
bool Group::includeInSearch(bool resolveInherit)
|
||||
bool Group::resolveSearchingEnabled() const
|
||||
{
|
||||
switch (m_data.searchingEnabled) {
|
||||
case Inherit:
|
||||
@ -637,12 +647,27 @@ bool Group::includeInSearch(bool resolveInherit)
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
if (resolveInherit) {
|
||||
return m_parent->includeInSearch(true);
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
return m_parent->resolveSearchingEnabled();
|
||||
}
|
||||
case Enable:
|
||||
return true;
|
||||
case Disable:
|
||||
return false;
|
||||
default:
|
||||
Q_ASSERT(false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool Group::resolveAutoTypeEnabled() const
|
||||
{
|
||||
switch (m_data.autoTypeEnabled) {
|
||||
case Inherit:
|
||||
if (!m_parent) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return m_parent->resolveAutoTypeEnabled();
|
||||
}
|
||||
case Enable:
|
||||
return true;
|
||||
|
@ -65,6 +65,8 @@ public:
|
||||
QString defaultAutoTypeSequence() const;
|
||||
Group::TriState autoTypeEnabled() const;
|
||||
Group::TriState searchingEnabled() const;
|
||||
bool resolveSearchingEnabled() const;
|
||||
bool resolveAutoTypeEnabled() const;
|
||||
Entry* lastTopVisibleEntry() const;
|
||||
bool isExpired() const;
|
||||
|
||||
@ -147,7 +149,6 @@ private:
|
||||
void cleanupParent();
|
||||
void recCreateDelObjects();
|
||||
void updateTimeinfo();
|
||||
bool includeInSearch(bool resolveInherit);
|
||||
|
||||
QPointer<Database> m_db;
|
||||
Uuid m_uuid;
|
||||
|
@ -37,9 +37,6 @@ EditGroupWidget::EditGroupWidget(QWidget* parent)
|
||||
add(tr("Icon"), m_editGroupWidgetIcons);
|
||||
add(tr("Properties"), m_editWidgetProperties);
|
||||
|
||||
addTriStateItems(m_mainUi->searchComboBox);
|
||||
addTriStateItems(m_mainUi->autotypeComboBox);
|
||||
|
||||
connect(m_mainUi->expireCheck, SIGNAL(toggled(bool)), m_mainUi->expireDatePicker, SLOT(setEnabled(bool)));
|
||||
|
||||
connect(this, SIGNAL(accepted()), SLOT(save()));
|
||||
@ -62,6 +59,15 @@ void EditGroupWidget::loadGroup(Group* group, bool create, Database* database)
|
||||
setHeadline(tr("Edit group"));
|
||||
}
|
||||
|
||||
if (m_group->parentGroup()) {
|
||||
addTriStateItems(m_mainUi->searchComboBox, m_group->parentGroup()->resolveSearchingEnabled());
|
||||
addTriStateItems(m_mainUi->autotypeComboBox, m_group->parentGroup()->resolveAutoTypeEnabled());
|
||||
}
|
||||
else {
|
||||
addTriStateItems(m_mainUi->searchComboBox, true);
|
||||
addTriStateItems(m_mainUi->autotypeComboBox, true);
|
||||
}
|
||||
|
||||
m_mainUi->editName->setText(m_group->name());
|
||||
m_mainUi->editNotes->setPlainText(m_group->notes());
|
||||
m_mainUi->expireCheck->setChecked(group->timeInfo().expires());
|
||||
@ -120,9 +126,18 @@ void EditGroupWidget::cancel()
|
||||
Q_EMIT editFinished(false);
|
||||
}
|
||||
|
||||
void EditGroupWidget::addTriStateItems(QComboBox* comboBox)
|
||||
void EditGroupWidget::addTriStateItems(QComboBox* comboBox, bool inheritDefault)
|
||||
{
|
||||
comboBox->addItem(tr("Inherit"));
|
||||
QString inheritDefaultString;
|
||||
if (inheritDefault) {
|
||||
inheritDefaultString = tr("Enable");
|
||||
}
|
||||
else {
|
||||
inheritDefaultString = tr("Disable");
|
||||
}
|
||||
|
||||
comboBox->clear();
|
||||
comboBox->addItem(tr("Inherit from parent group (%1)").arg(inheritDefaultString));
|
||||
comboBox->addItem(tr("Enable"));
|
||||
comboBox->addItem(tr("Disable"));
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ private Q_SLOTS:
|
||||
void cancel();
|
||||
|
||||
private:
|
||||
void addTriStateItems(QComboBox* comboBox);
|
||||
void addTriStateItems(QComboBox* comboBox, bool inheritValue);
|
||||
int indexFromTriState(Group::TriState triState);
|
||||
Group::TriState triStateFromIndex(int index);
|
||||
|
||||
|
@ -66,7 +66,7 @@
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="autotypeLabel">
|
||||
<property name="text">
|
||||
<string>Autotype</string>
|
||||
<string>Auto-type</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
x
Reference in New Issue
Block a user