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