Ticket #3253: MusicSearch.patch

File MusicSearch.patch, 1.8 KB (added by craig@…, 13 years ago)
  • mythmusic/mythmusic/search.cpp

     
    8080    bool substringSearch = true;
    8181    bool isNumber = false;
    8282    searchText.toULongLong(&isNumber);
    83 
     83    QString searchLimit = gContext->GetSetting("MaxSearchResults"); 
    8484    searchText.replace("'", "''");
    8585
    8686    if (!isNumber)
     
    146146
    147147    queryString += whereClause;
    148148    queryString += " ORDER BY music_artists.artist_name, album_name, name, song_id, filename ";
    149 
     149    queryString += "LIMIT ";
     150    queryString += searchLimit;
    150151    query.prepare(queryString);
    151152
    152153    bool has_entries = true;
  • mythmusic/mythmusic/globalsettings.cpp

     
    286286    return gc;
    287287};
    288288
     289static HostSpinBox *SetSearchMaxResultsReturned()
     290{
     291    HostSpinBox *gc = new HostSpinBox("MaxSearchResults", 0, 20000, 100);
     292    gc->setLabel(QObject::tr("Maximum Search Results"));
     293    gc->setValue(300);
     294    gc->setHelpText(QObject::tr("Used to limit the number of results "
     295                    "returned when using the search feature."));
     296    return gc;
     297};
     298
    289299static HostCheckBox *UseShowRatings()
    290300{
    291301    HostCheckBox *gc = new HostCheckBox("MusicShowRatings");
     
    551561    playersettings->addChild(SetPlayCountWeight());
    552562    playersettings->addChild(SetLastPlayWeight());
    553563    playersettings->addChild(SetRandomWeight());
     564    playersettings->addChild(SetSearchMaxResultsReturned());
    554565    playersettings->addChild(UseShowRatings());
    555566    playersettings->addChild(UseShowWholeTree());
    556567    playersettings->addChild(UseListShuffled());