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
c394f1b4
Commit
c394f1b4
authored
Mar 04, 2020
by
Aleksei Nikiforov
Committed by
Yuri Chornoivan
Mar 04, 2020
Browse files
Hide top level scrollkeeper menu item if it's empty
Differential revision:
https://phabricator.kde.org/D27403
parent
ef8192e5
Changes
3
Hide whitespace changes
Inline
Side-by-side
navigator.cpp
View file @
c394f1b4
...
...
@@ -275,7 +275,7 @@ void Navigator::insertInfoDocs( NavigatorItem *topItem )
void
Navigator
::
insertScrollKeeperDocs
(
NavigatorItem
*
topItem
)
{
ScrollKeeperTreeBuilder
*
builder
=
new
ScrollKeeperTreeBuilder
(
this
);
builder
->
build
(
topItem
);
builder
->
build
OrHide
(
topItem
);
}
void
Navigator
::
selectItem
(
const
QUrl
&
url
)
...
...
scrollkeepertreebuilder.cpp
View file @
c394f1b4
...
...
@@ -45,6 +45,13 @@ void ScrollKeeperTreeBuilder::loadConfig()
mShowEmptyDirs
=
Prefs
::
showEmptyDirs
();
}
void
ScrollKeeperTreeBuilder
::
buildOrHide
(
NavigatorItem
*
parent
)
{
build
(
parent
);
parent
->
setHidden
(
parent
->
childCount
()
==
0
);
}
void
ScrollKeeperTreeBuilder
::
build
(
NavigatorItem
*
parent
)
{
QString
lang
=
QLocale
().
bcp47Name
();
...
...
scrollkeepertreebuilder.h
View file @
c394f1b4
...
...
@@ -36,6 +36,8 @@ class ScrollKeeperTreeBuilder : public QObject
void
build
(
NavigatorItem
*
parent
);
void
buildOrHide
(
NavigatorItem
*
parent
);
private:
void
loadConfig
();
int
insertSection
(
NavigatorItem
*
parent
,
...
...
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