Allow EntryModel to be used with entries from different databases.

This commit is contained in:
Felix Geyer 2012-07-21 18:39:18 +02:00
parent 39b9260719
commit 34ad5d61f6

View File

@ -76,8 +76,14 @@ void EntryModel::setEntryList(const QList<Entry*>& entries)
m_entries = entries; m_entries = entries;
m_orgEntries = entries; m_orgEntries = entries;
if (entries.count() > 0) { QSet<Database*> databases;
m_allGroups = entries.at(0)->group()->database()->rootGroup()->groupsRecursive(true);
Q_FOREACH (Entry* entry, m_entries) {
databases.insert(entry->group()->database());
}
Q_FOREACH (Database* db, databases) {
m_allGroups.append(db->rootGroup()->groupsRecursive(true));
} }
Q_FOREACH (const Group* group, m_allGroups) { Q_FOREACH (const Group* group, m_allGroups) {