Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Main Repositories
otb
Commits
09e5eedd
Commit
09e5eedd
authored
Jun 28, 2016
by
Stéphane Albert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: Used QString::simplified() text to search of OTB-applications.
parent
6ca9f6d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
Code/Common/Gui/mvdApplicationsToolBox.cxx
Code/Common/Gui/mvdApplicationsToolBox.cxx
+9
-7
Code/Common/Gui/mvdApplicationsToolBox.h
Code/Common/Gui/mvdApplicationsToolBox.h
+2
-1
No files found.
Code/Common/Gui/mvdApplicationsToolBox.cxx
View file @
09e5eedd
...
...
@@ -139,6 +139,8 @@ ApplicationsToolBox
mainItem
->
setText
(
COLUMN_NAME
,
tr
(
"Orfeo Toolbox Algorithms"
)
);
mainItem
->
setExpanded
(
!
m_SearchText
.
isEmpty
()
);
QString
search
(
m_SearchText
.
simplified
()
);
//
// iterate on map: key as high-level item / algorithms as lower-level items
for
(
ApplicationsTagContainer
::
const_iterator
itTag
(
m_AppTags
.
begin
()
);
...
...
@@ -152,8 +154,8 @@ ApplicationsToolBox
// If a current tag applicaton name match the searchText, add the
// tag as an item to the tree
if
(
m_SearchText
.
isEmpty
()
||
IsSearchTextMatchAnyAlgorithm
(
qcurrentTag
)
||
qcurrentTag
.
contains
(
m_S
earch
Text
,
Qt
::
CaseInsensitive
)
)
IsSearchTextMatchAnyAlgorithm
(
qcurrentTag
,
search
)
||
qcurrentTag
.
contains
(
s
earch
,
Qt
::
CaseInsensitive
)
)
{
//
// step #1 -> DocTag is a main item
...
...
@@ -181,8 +183,8 @@ ApplicationsToolBox
// does the current algorithm DocName match the search text
if
(
m_SearchText
.
isEmpty
()
||
title
.
contains
(
m_S
earch
Text
,
Qt
::
CaseInsensitive
)
||
name
.
contains
(
m_S
earch
Text
,
Qt
::
CaseInsensitive
)
)
title
.
contains
(
s
earch
,
Qt
::
CaseInsensitive
)
||
name
.
contains
(
s
earch
,
Qt
::
CaseInsensitive
)
)
{
//
// set current application name as secondary item
...
...
@@ -209,7 +211,7 @@ ApplicationsToolBox
/*******************************************************************************/
bool
ApplicationsToolBox
::
IsSearchTextMatchAnyAlgorithm
(
const
QString
&
tagName
)
::
IsSearchTextMatchAnyAlgorithm
(
const
QString
&
tagName
,
const
QString
&
search
)
{
// find the pair corresponding to the tagName
ApplicationsTagContainer
::
const_iterator
itTag
(
...
...
@@ -227,9 +229,9 @@ ApplicationsToolBox
{
QString
name
(
FromStdString
(
*
itApps
)
);
if
(
name
.
contains
(
m_S
earch
Text
,
Qt
::
CaseInsensitive
)
||
if
(
name
.
contains
(
s
earch
,
Qt
::
CaseInsensitive
)
||
GetApplicationDocNameByApplicationName
(
name
)
.
contains
(
m_S
earch
Text
,
Qt
::
CaseInsensitive
)
)
.
contains
(
s
earch
,
Qt
::
CaseInsensitive
)
)
return
true
;
}
...
...
Code/Common/Gui/mvdApplicationsToolBox.h
View file @
09e5eedd
...
...
@@ -143,7 +143,8 @@ private:
* \brief Helper method to check if searchText matches any of the
* algorithms string contained in the map
*/
bool
IsSearchTextMatchAnyAlgorithm
(
const
QString
&
tagName
);
bool
IsSearchTextMatchAnyAlgorithm
(
const
QString
&
tagName
,
const
QString
&
search
);
/**
* \brief Helper method to get the DocName of an application from an
...
...
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