Ticket #691: mythplugins_691.patch
File mythplugins_691.patch, 2.0 KB (added by , 18 years ago) |
---|
-
mythmusic/mythmusic/search.cpp
104 104 QString queryString("SELECT filename, artist, album, title, intid " 105 105 "FROM musicmetadata "); 106 106 107 QStringList list = QStringList::split( 108 QRegExp("[>,]"), searchText); 107 109 if (!searchText.isEmpty()) 108 110 { 109 QStringList list = QStringList::split(110 QRegExp("[>,]"), searchText);111 111 whereClause = ""; 112 112 if (substringSearch) // alpha 113 113 { … … 163 163 QString text(aComposer + ": " + aTitle + "; " + 164 164 query.value(3).toString() ); 165 165 166 // Highlight matches as appropriate 167 if(!searchText.isEmpty()) { 168 if (substringSearch) // alpha 169 { 170 for (uint i = 0; i < list.count(); i++) 171 { 172 QString stxt = list[i].stripWhiteSpace(); 173 int index = -1; 174 while( (index = text.findRev(stxt, index, false)) != -1 ) { 175 text.insert(index + stxt.length(), "]"); 176 text.insert(index, "["); 177 } 178 } 179 } 180 else // numeric 181 { 182 for (uint i = 0; i < list.count(); i++) 183 { 184 QString stxt = list[i].stripWhiteSpace(); 185 int index = -1; 186 while( (index = text.findRev(QRegExp(stxt, false), index)) != -1 ) { 187 text.insert(index + stxt.contains('['), "]"); 188 text.insert(index, "["); 189 } 190 } 191 } 192 } 193 166 194 // Insert item into listbox, including song identifier 167 195 listbox->insertItem(new SearchListBoxItem( 168 196 QString::fromUtf8(text),