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
orang tua 4315de0e76
melakukan f1b17c0842

Melihat File

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