summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Hartmetz <ahartmetz@gmail.com>2016-10-08 19:36:41 (GMT)
committerAndreas Hartmetz <ahartmetz@gmail.com>2016-10-08 19:40:36 (GMT)
commit1b8c9ca40ac7aff0d37eb3c26ade41c74d44a5c9 (patch)
tree7a9453ea3b95dd95b5aa90da3175c43ecd55799a
parent35fdfb2fcbdc7aca64639cf18e9ac40a42d59873 (diff)
A QSet is sufficient here. QSet is also hash-based.
-rw-r--r--src/ViewManager.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ViewManager.cpp b/src/ViewManager.cpp
index e31041c..0f14ca0 100644
--- a/src/ViewManager.cpp
+++ b/src/ViewManager.cpp
@@ -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);
}
}