Commit 42078d5b authored by loh tar's avatar loh tar Committed by Christoph Cullmann

KateSessionManager: Sort the jump list actions alphabetical

Summary: avoid needed but expensive updates of the desktop file
and to bring back the (probably) prefered order

Reviewers: #kate, cullmann

Reviewed By: #kate, cullmann

Subscribers: cullmann, kwrite-devel, #kate

Tags: #kate

Differential Revision:
parent 9577b723
......@@ -537,13 +537,17 @@ void KateSessionManager::updateJumpListActions(const QStringList &sessionList)
// Limit the number of list entries we like to offer
const int maxEntryCount = std::min(sessionList.count(), 10);
// sessionList is ordered by time, but we like it alphabetical to avoid even more a needed update
QStringList sessionSubList = sessionList.mid(0, maxEntryCount);
// we compute the new group names in advance so we can tell whether we changed something
// and avoid touching the desktop file leading to an expensive ksycoca recreation
QStringList sessionActions;
for (int i = 0; i < maxEntryCount; ++i) {
sessionActions << QStringLiteral("Session %1").arg(QString::fromLatin1(QCryptographicHash::hash(
sessionActions << QStringLiteral("Session %1").arg(QString::fromLatin1(QCryptographicHash::hash(
, QCryptographicHash::Md5).toHex()));
......@@ -568,8 +572,8 @@ void KateSessionManager::updateJumpListActions(const QStringList &sessionList)
for (int i = 0; i < maxEntryCount; ++i) {
const QString &action =; // is a transform of sessionList, so count and order is identical
const QString &session =;
const QString &action =; // is a transform of sessionSubList, so count and order is identical
const QString &session =;
KConfigGroup grp = df->actionGroup(action);
grp.writeEntry(QStringLiteral("Name"), session);
Markdown is supported
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