Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
System
KHelpCenter
Commits
65dfa07f
Commit
65dfa07f
authored
Mar 04, 2020
by
Aleksei Nikiforov
Committed by
Yuri Chornoivan
Mar 04, 2020
Browse files
Hide group menu items if they have no children
Differential revision:
https://phabricator.kde.org/D27405
parent
4bb32e2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
navigatorappgroupitem.cpp
View file @
65dfa07f
...
...
@@ -89,6 +89,7 @@ void NavigatorAppGroupItem::populate( bool recursive )
return
;
}
KServiceGroup
::
List
list
=
root
->
entries
();
bool
no_children_present
=
true
;
for
(
KServiceGroup
::
List
::
ConstIterator
it
=
list
.
constBegin
();
...
...
@@ -106,6 +107,7 @@ void NavigatorAppGroupItem::populate( bool recursive )
DocEntry
*
entry
=
new
DocEntry
(
s
->
name
(),
url
,
s
->
icon
()
);
NavigatorAppItem
*
item
=
new
NavigatorAppItem
(
entry
,
this
);
item
->
setAutoDeleteDocEntry
(
true
);
no_children_present
=
false
;
}
break
;
}
...
...
@@ -119,6 +121,7 @@ void NavigatorAppGroupItem::populate( bool recursive )
appItem
=
new
NavigatorAppGroupItem
(
entry
,
this
,
g
->
relPath
()
);
appItem
->
setAutoDeleteDocEntry
(
true
);
if
(
recursive
)
appItem
->
populate
(
recursive
);
no_children_present
=
false
;
break
;
}
default:
...
...
@@ -127,6 +130,7 @@ void NavigatorAppGroupItem::populate( bool recursive )
}
sortChildren
(
0
,
Qt
::
AscendingOrder
/* ascending */
);
mPopulated
=
true
;
setHidden
(
no_children_present
);
}
QString
NavigatorAppGroupItem
::
documentationURL
(
const
KService
*
s
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment