mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-02-25 17:01:17 -05:00
Add AutoTypeAssociations::removeEmpty().
This commit is contained in:
parent
7abaf0e215
commit
7db6850528
@ -64,6 +64,17 @@ void AutoTypeAssociations::remove(int index)
|
||||
Q_EMIT modified();
|
||||
}
|
||||
|
||||
void AutoTypeAssociations::removeEmpty()
|
||||
{
|
||||
QMutableListIterator<AutoTypeAssociations::Association> i(m_associations);
|
||||
while (i.hasNext()) {
|
||||
const Association& assoc = i.next();
|
||||
if (assoc.window.isEmpty() && assoc.sequence.isEmpty()) {
|
||||
i.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AutoTypeAssociations::update(int index, const AutoTypeAssociations::Association& association)
|
||||
{
|
||||
Q_ASSERT(index >= 0 && index < m_associations.size());
|
||||
|
@ -40,6 +40,7 @@ public:
|
||||
void copyDataFrom(const AutoTypeAssociations* other);
|
||||
void add(const AutoTypeAssociations::Association& association);
|
||||
void remove(int index);
|
||||
void removeEmpty();
|
||||
void update(int index, const AutoTypeAssociations::Association& association);
|
||||
AutoTypeAssociations::Association get(int index) const;
|
||||
QList<AutoTypeAssociations::Association> getAll() const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user