Skip to content
GitLab
Menu
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
56127687
Commit
56127687
authored
Oct 12, 2020
by
Laurent Montel
😁
Browse files
More const'ify
parent
ff1d7a54
Changes
4
Hide whitespace changes
Inline
Side-by-side
navigator.cpp
View file @
56127687
...
...
@@ -221,7 +221,7 @@ History no X-KDE-PluginKeyword in kcmhistory.desktop
for
(
KService
::
List
::
const_iterator
it
=
list
.
constBegin
();
it
!=
list
.
constEnd
();
++
it
)
{
KService
::
Ptr
s
(
*
it
);
QString
desktopFile
=
QStandardPaths
::
locate
(
QStandardPaths
::
GenericDataLocation
,
QLatin1String
(
"kservices5/"
)
+
s
->
entryPath
()
);
const
QString
desktopFile
=
QStandardPaths
::
locate
(
QStandardPaths
::
GenericDataLocation
,
QLatin1String
(
"kservices5/"
)
+
s
->
entryPath
()
);
createItemFromDesktopFile
(
topItem
,
desktopFile
);
no_children_present
=
false
;
}
...
...
@@ -261,7 +261,7 @@ void Navigator::createItemFromDesktopFile( NavigatorItem *topItem,
QString
docPath
=
desktopFile
.
readDocPath
();
if
(
!
docPath
.
isNull
()
)
{
// First parameter is ignored if second is an absolute path
QUrl
url
(
QStringLiteral
(
"help:/"
)
+
docPath
);
const
QUrl
url
(
QStringLiteral
(
"help:/"
)
+
docPath
);
QString
icon
=
desktopFile
.
readIcon
();
if
(
icon
.
isEmpty
()
)
icon
=
QStringLiteral
(
"text-plain"
);
DocEntry
*
entry
=
new
DocEntry
(
desktopFile
.
readName
(),
url
.
url
(),
icon
);
...
...
@@ -307,7 +307,7 @@ void Navigator::selectItem( const QUrl &url )
NavigatorItem
*
item
;
item
=
static_cast
<
NavigatorItem
*>
(
mContentsTree
->
currentItem
()
);
if
(
item
&&
mSelected
)
{
QUrl
currentURL
(
item
->
entry
()
->
url
()
);
const
QUrl
currentURL
(
item
->
entry
()
->
url
()
);
if
(
(
currentURL
==
url
)
||
(
currentURL
==
alternativeURL
)
)
{
qCDebug
(
KHC_LOG
)
<<
"URL already shown."
;
return
;
...
...
@@ -329,7 +329,7 @@ void Navigator::selectItem( const QUrl &url )
QTreeWidgetItemIterator
it
(
mContentsTree
);
while
(
(
*
it
)
)
{
NavigatorItem
*
item
=
static_cast
<
NavigatorItem
*>
(
(
*
it
)
);
QUrl
itemUrl
(
item
->
entry
()
->
url
()
);
const
QUrl
itemUrl
(
item
->
entry
()
->
url
()
);
if
(
(
itemUrl
==
url
)
||
(
itemUrl
==
alternativeURL
)
)
{
// If the current item was not selected and remained unchanged it
// needs to be explicitly selected
...
...
@@ -374,9 +374,7 @@ void Navigator::slotItemSelected( QTreeWidgetItem *currentItem )
item
->
setExpanded
(
!
item
->
isExpanded
()
);
QUrl
url
(
item
->
entry
()
->
url
()
);
const
QUrl
url
(
item
->
entry
()
->
url
()
);
if
(
url
.
scheme
()
==
QLatin1String
(
"khelpcenter"
)
)
{
mView
->
closeUrl
();
...
...
@@ -429,7 +427,7 @@ void Navigator::showOverview( NavigatorItem *item, const QUrl &url )
title
=
item
->
entry
()
->
name
();
name
=
item
->
entry
()
->
name
();
QString
info
=
item
->
entry
()
->
info
();
const
QString
info
=
item
->
entry
()
->
info
();
if
(
!
info
.
isEmpty
()
)
content
=
QLatin1String
(
"<p>"
)
+
info
+
QLatin1String
(
"</p>
\n
"
);
childCount
=
item
->
childCount
();
...
...
@@ -500,10 +498,10 @@ void Navigator::slotSearch()
if
(
mSearchEngine
->
isRunning
()
)
return
;
QString
words
=
mSearchEdit
->
text
();
QString
method
=
mSearchWidget
->
method
();
int
pages
=
mSearchWidget
->
pages
();
QStringList
scope
=
mSearchWidget
->
scope
();
const
QString
words
=
mSearchEdit
->
text
();
const
QString
method
=
mSearchWidget
->
method
();
const
int
pages
=
mSearchWidget
->
pages
();
const
QStringList
scope
=
mSearchWidget
->
scope
();
qCDebug
(
KHC_LOG
)
<<
"Navigator::slotSearch() words: "
<<
words
;
qCDebug
(
KHC_LOG
)
<<
"Navigator::slotSearch() scope: "
<<
scope
;
...
...
searchwidget.cpp
View file @
56127687
...
...
@@ -41,8 +41,7 @@
namespace
KHC
{
SearchWidget
::
SearchWidget
(
SearchEngine
*
engine
,
QWidget
*
parent
)
:
QWidget
(
parent
),
mEngine
(
engine
),
mScopeCount
(
0
)
:
QWidget
(
parent
),
mEngine
(
engine
)
{
QBoxLayout
*
topLayout
=
new
QVBoxLayout
(
this
);
topLayout
->
setContentsMargins
(
2
,
2
,
2
,
2
);
...
...
@@ -286,9 +285,9 @@ class ScopeTraverser : public DocEntryTraverser
}
private:
SearchEngine
*
mEngine
;
SearchEngine
*
mEngine
=
nullptr
;
int
mLevel
;
QTreeWidgetItem
*
mParentItem
;
QTreeWidgetItem
*
mParentItem
=
nullptr
;
QHash
<
DocEntry
*
,
QTreeWidgetItem
*>
mItems
;
enum
{
MaxNestingLevel
=
2
};
...
...
searchwidget.h
View file @
56127687
...
...
@@ -76,14 +76,14 @@ class SearchWidget : public QWidget
void
scopeClicked
(
QTreeWidgetItem
*
);
private:
SearchEngine
*
mEngine
=
nullptr
;
SearchEngine
*
const
mEngine
;
QComboBox
*
mMethodCombo
=
nullptr
;
QComboBox
*
mPagesCombo
=
nullptr
;
QComboBox
*
mScopeCombo
=
nullptr
;
QTreeWidget
*
mScopeListView
=
nullptr
;
int
mScopeCount
;
int
mScopeCount
=
0
;
};
}
...
...
toc.cpp
View file @
56127687
...
...
@@ -237,9 +237,9 @@ void TOC::fillTree()
for
(
int
sectCount
=
0
;
sectCount
<
sections
.
count
();
sectCount
++
)
{
QDomElement
sectElem
=
sections
.
item
(
sectCount
).
toElement
();
QDomElement
sectTitleElem
=
childElement
(
sectElem
,
QStringLiteral
(
"title"
)
);
QString
sectTitle
=
sectTitleElem
.
text
().
simplified
();
const
QString
sectTitle
=
sectTitleElem
.
text
().
simplified
();
QDomElement
sectRefElem
=
childElement
(
sectElem
,
QStringLiteral
(
"anchor"
)
);
QString
sectRef
=
sectRefElem
.
text
().
trimmed
();
const
QString
sectRef
=
sectRefElem
.
text
().
trimmed
();
sectItem
=
new
TOCSectionItem
(
this
,
chapItem
,
sectItem
,
sectTitle
,
sectRef
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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