┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kfileitemmodel.cpp
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2012-08-24 18:51:27 +0200
committerFrank Reininghaus <[email protected]>2012-08-24 19:00:03 +0200
commit89a678241d7f0b341bebd19c006541bd7f28f2ab (patch)
tree281c98fdc40f8b05ba34421b655df8088574ff5b /src/kitemviews/kfileitemmodel.cpp
parent707dfbec0e2c0277b008e22abd7ab5373a09c8d7 (diff)
Fix regression that caused "(I18N_EMPTY_MESSAGE)" sub menus in menus
For top-level roles like "Name" and "Size", the group translation is 0. In that case, the "group" member of the corresponding RoleInfo struct must be an empty string. This is expected by the code which generates Dolphin's menus, which group the top-level roles into a sub menu with the name "(I18N_EMPTY_MESSAGE)" otherwise. This is a recent regression caused by 199fabbaa8d8a12fb49e4c9922c38ec8b033923c. Thanks to Christoph Feck for investigating this issue! CCBUG: 305228 (cherry picked from commit 168d0511c754008cc679589566d961beb9f6cc10)
Diffstat (limited to 'src/kitemviews/kfileitemmodel.cpp')
-rw-r--r--src/kitemviews/kfileitemmodel.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp
index 1bf9e65d4..6936af431 100644
--- a/src/kitemviews/kfileitemmodel.cpp
+++ b/src/kitemviews/kfileitemmodel.cpp
@@ -561,7 +561,14 @@ QList<KFileItemModel::RoleInfo> KFileItemModel::rolesInformation()
RoleInfo info;
info.role = map[i].role;
info.translation = i18nc(map[i].roleTranslationContext, map[i].roleTranslation);
- info.group = i18nc(map[i].groupTranslationContext, map[i].groupTranslation);
+ if (map[i].groupTranslation) {
+ info.group = i18nc(map[i].groupTranslationContext, map[i].groupTranslation);
+ } else {
+ // For top level roles, groupTranslation is 0. We must make sure that
+ // info.group is an empty string then because the code that generates
+ // menus tries to put the actions into sub menus otherwise.
+ info.group = QString();
+ }
info.requiresNepomuk = map[i].requiresNepomuk;
info.requiresIndexer = map[i].requiresIndexer;
rolesInfo.append(info);