mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-27 00:09:53 -05:00
Small optimizations.
This commit is contained in:
parent
57b0c17733
commit
1c7e8f6921
@ -362,21 +362,22 @@ void Entry::addHistoryItem(Entry* entry)
|
||||
Q_EMIT modified();
|
||||
}
|
||||
|
||||
void Entry::removeHistoryItems(QList<Entry*> historyEntries)
|
||||
void Entry::removeHistoryItems(const QList<Entry*>& historyEntries)
|
||||
{
|
||||
bool emitModified = historyEntries.count() > 0;
|
||||
if (historyEntries.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Q_FOREACH (Entry* entry, historyEntries) {
|
||||
Q_ASSERT(!entry->parent());
|
||||
Q_ASSERT(entry->uuid() == uuid());
|
||||
int numberOfRemovedEntries = m_history.removeAll(entry);
|
||||
Q_ASSERT(numberOfRemovedEntries > 0);
|
||||
Q_UNUSED(numberOfRemovedEntries);
|
||||
Q_ASSERT(m_history.contains(entry));
|
||||
|
||||
m_history.removeOne(entry);
|
||||
delete entry;
|
||||
}
|
||||
|
||||
if (emitModified) {
|
||||
Q_EMIT modified();
|
||||
}
|
||||
Q_EMIT modified();
|
||||
}
|
||||
|
||||
void Entry::truncateHistory()
|
||||
|
@ -108,7 +108,7 @@ public:
|
||||
QList<Entry*> historyItems();
|
||||
const QList<Entry*>& historyItems() const;
|
||||
void addHistoryItem(Entry* entry);
|
||||
void removeHistoryItems(QList<Entry*> historyEntries);
|
||||
void removeHistoryItems(const QList<Entry*>& historyEntries);
|
||||
void truncateHistory();
|
||||
Entry* clone() const;
|
||||
QString resolvePlaceholders(const QString& str) const;
|
||||
|
@ -267,7 +267,7 @@ void Group::setLastTopVisibleEntry(Entry* entry)
|
||||
set(m_lastTopVisibleEntry, entry);
|
||||
}
|
||||
|
||||
void Group::setExpires(const bool& value)
|
||||
void Group::setExpires(bool value)
|
||||
{
|
||||
if (m_timeInfo.expires() != value) {
|
||||
m_timeInfo.setExpires(value);
|
||||
|
@ -69,7 +69,7 @@ public:
|
||||
void setAutoTypeEnabled(TriState enable);
|
||||
void setSearchingEnabled(TriState enable);
|
||||
void setLastTopVisibleEntry(Entry* entry);
|
||||
void setExpires(const bool& value);
|
||||
void setExpires(bool value);
|
||||
void setExpiryTime(const QDateTime& dateTime);
|
||||
|
||||
void setUpdateTimeinfo(bool value);
|
||||
|
Loading…
Reference in New Issue
Block a user