Changeset 20727 for gsdl/trunk/runtime-src/src/colservr/mgppqueryfilter.cpp
- Timestamp:
- 2009-09-28T14:59:17+13:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/runtime-src/src/colservr/mgppqueryfilter.cpp
r16445 r20727 45 45 filtopt.type = FilterOption_t::enumeratedt; 46 46 filtopt.repeatable = FilterOption_t::onePerTerm; 47 filtopt.defaultValue = ""; 47 48 filterOptions["Level"] = filtopt; 48 49 … … 71 72 if (key == "indexfieldmap") { 72 73 indexfieldmap.importmap (cfgline); 73 74 // update the list of indexes in the filter information75 74 text_tarray options; 76 75 indexfieldmap.gettoarray (options); 77 76 filterOptions["IndexField"].validValues = options; 78 77 78 } else if (key == "levelmap") { 79 levelmap.importmap (cfgline); 79 80 } else if (key == "indexlevels") { 81 filterOptions["Level"].validValues.erase(filterOptions["Level"].validValues.begin(), filterOptions["Level"].validValues.end()); 80 82 text_tarray::const_iterator here = cfgline.begin(); 81 83 text_tarray::const_iterator end = cfgline.end(); 82 bool first=true;83 filterOptions["Level"].validValues.erase(filterOptions["Level"].validValues.begin(), filterOptions["Level"].validValues.end());84 84 while (here != end) { 85 85 if (!(*here).empty()) { 86 if (first) {87 first = false;88 // the default is the first value89 filterOptions["Level"].defaultValue = *here;90 }91 86 filterOptions["Level"].validValues.push_back(*here); 92 87 } … … 99 94 } else if (key == "defaultindex") { // used for fields in mgpp 100 95 indexfieldmap.from2to (cfgline[0], filterOptions["IndexField"].defaultValue); 96 } else if (key == "defaultlevel") { 97 levelmap.from2to (cfgline[0], filterOptions["Level"].defaultValue); 101 98 } 102 99 … … 117 114 } 118 115 } 116 if (filterOptions["Levels"].defaultValue.empty()) { 117 // use first level as default if no default is set explicitly 118 if (!filterOptions["Level"].validValues[0].empty()) 119 filterOptions["Levels"].defaultValue = filterOptions["Level"].validValues[0]; 120 } 121 119 122 return true; 120 123 }
Note:
See TracChangeset
for help on using the changeset viewer.