summaryrefslogtreecommitdiffstats
path: root/Source/CursesDialog
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-09-21 14:33:08 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2010-09-21 14:33:08 (GMT)
commit9da64e7c6b8caa2251f675ad7fd183fcc44ad696 (patch)
tree8c5c42faa7c79865c9225ba3dedb7fcbfe6b4b40 /Source/CursesDialog
parent39d99c24583574c542e1cd74b8a92a5c21d3454d (diff)
parent5d7c3c0a594a57705f42ad6e1fa454234bfe7b56 (diff)
downloadCMake-9da64e7c6b8caa2251f675ad7fd183fcc44ad696.zip
CMake-9da64e7c6b8caa2251f675ad7fd183fcc44ad696.tar.gz
CMake-9da64e7c6b8caa2251f675ad7fd183fcc44ad696.tar.bz2
Merge topic 'fix-ccmake-search'
5d7c3c0 ccmake: Fix search with '/'
Diffstat (limited to 'Source/CursesDialog')
-rw-r--r--Source/CursesDialog/cmCursesMainForm.cxx14
-rw-r--r--Source/CursesDialog/cmCursesMainForm.h5
2 files changed, 7 insertions, 12 deletions
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index 389ec7f..7f3e360 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -902,7 +902,7 @@ void cmCursesMainForm::HandleInput()
this->SearchMode = false;
if ( this->SearchString.size() > 0 )
{
- this->JumpToCacheEntry(-1, this->SearchString.c_str());
+ this->JumpToCacheEntry(this->SearchString.c_str());
this->OldSearchString = this->SearchString;
}
this->SearchString = "";
@@ -1076,7 +1076,7 @@ void cmCursesMainForm::HandleInput()
{
if ( this->OldSearchString.size() > 0 )
{
- this->JumpToCacheEntry(-1, this->OldSearchString.c_str());
+ this->JumpToCacheEntry(this->OldSearchString.c_str());
}
}
// switch advanced on/off
@@ -1191,7 +1191,7 @@ int cmCursesMainForm::LoadCache(const char *)
return r;
}
-void cmCursesMainForm::JumpToCacheEntry(int idx, const char* astr)
+void cmCursesMainForm::JumpToCacheEntry(const char* astr)
{
std::string str;
if ( astr )
@@ -1199,18 +1199,14 @@ void cmCursesMainForm::JumpToCacheEntry(int idx, const char* astr)
str = cmSystemTools::LowerCase(astr);
}
- if ( size_t(idx) > this->NumberOfVisibleEntries )
- {
- return;
- }
- if ( idx < 0 && str.size() == 0)
+ if(str.empty())
{
return;
}
FIELD* cur = current_field(this->Form);
int start_index = field_index(cur);
int findex = start_index;
- while ( (findex / 3) != idx )
+ for(;;)
{
if ( str.size() > 0 )
{
diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h
index 4084415..3e191b4 100644
--- a/Source/CursesDialog/cmCursesMainForm.h
+++ b/Source/CursesDialog/cmCursesMainForm.h
@@ -122,9 +122,8 @@ protected:
// Remove an entry from the interface and the cache.
void RemoveEntry(const char* value);
- // Jump to the cache value with index idx. If string str is
- // specified, it will stop on widget that contain that string.
- void JumpToCacheEntry(int idx, const char* str);
+ // Jump to the cache entry whose name matches the string.
+ void JumpToCacheEntry(const char* str);
// Copies of cache entries stored in the user interface
std::vector<cmCursesCacheEntryComposite*>* Entries;