Commit 1b8c9ca4 authored by Andreas Hartmetz's avatar Andreas Hartmetz
Browse files

A QSet is sufficient here. QSet is also hash-based.

parent 35fdfb2f
......@@ -901,7 +901,7 @@ void ViewManager::saveSessions(KConfigGroup& group)
{
// find all unique session restore IDs
QList<int> ids;
QHash<Session*, int> unique;
QSet<Session*> unique;
// first: sessions in the active container, preserving the order
ViewContainer* container = _viewSplitter->activeContainer();
......@@ -915,8 +915,10 @@ void ViewManager::saveSessions(KConfigGroup& group)
Q_ASSERT(view);
Session* session = _sessionMap[view];
ids << SessionManager::instance()->getRestoreId(session);
if (view == activeview) group.writeEntry("Active", tab);
unique.insert(session, 1);
unique.insert(session);
if (view == activeview) {
group.writeEntry("Active", tab);
}
tab++;
}
......@@ -925,7 +927,7 @@ void ViewManager::saveSessions(KConfigGroup& group)
foreach(Session * session, _sessionMap) {
if (!unique.contains(session)) {
ids << SessionManager::instance()->getRestoreId(session);
unique.insert(session, 1);
unique.insert(session);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment