Ranking: Prioritizee name before command/binary name

This seems to work better for flatpak apps and should
argueably be more natural.
This commit is contained in:
Albert S. 2021-04-28 23:15:24 +02:00
parent 4315de0e76
commit f1b17c0842
1 changed files with 4 additions and 4 deletions

View File

@ -405,19 +405,19 @@ void Window::keyPressEvent(QKeyEvent *event)
int Window::rankConfig(const EntryConfig &config, QString filter) const
{
if(config.command.startsWith(filter, Qt::CaseInsensitive))
if(config.name.startsWith(filter, Qt::CaseInsensitive))
{
return 0;
}
else if(config.command.contains(filter, Qt::CaseInsensitive))
else if(config.command.startsWith(filter, Qt::CaseInsensitive))
{
return 1;
}
else if(config.name.startsWith(filter, Qt::CaseInsensitive))
else if(config.name.contains(filter, Qt::CaseInsensitive))
{
return 2;
}
else if(config.name.contains(filter, Qt::CaseInsensitive))
else if(config.command.contains(filter, Qt::CaseInsensitive))
{
return 3;
}