Skip to content

Commit

Permalink
Revert "Add app descriptions to search"
Browse files Browse the repository at this point in the history
  • Loading branch information
gornostal committed Apr 15, 2020
1 parent ee9e9da commit da854e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
2 changes: 0 additions & 2 deletions tests/search/apps/test_AppDb.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,5 +181,3 @@ def test_search_name():
assert search_name('Amazon', r'unity-webapps-runner --amazon --app-id=ubuntu-amazon-default') == \
'Amazon unity-webapps-runner'
assert search_name('Back Up', r'env VAR1=VAL1 VAR2=VAL2 deja-dup --backup') == 'Back Up deja-dup'
assert search_name('Chromium', '/usr/bin/chromium %U', description='Access the Internet') == \
'Chromium Access the Internet'
16 changes: 5 additions & 11 deletions ulauncher/search/apps/AppDb.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,16 @@ def put_app(self, app):
:param Gio.DesktopAppInfo app:
"""
name = app.get_string('X-GNOME-FullName') or app.get_name()
description = app.get_description() or ''
exec_name = app.get_string('Exec') or ''
description = app.get_description() or ''
if not description and (app.get_generic_name() != name):
description = app.get_generic_name() or ''
record = {
"desktop_file": app.get_filename(),
"desktop_file_short": os.path.basename(app.get_filename()),
"description": description,
"description": app.get_description() or '',
"name": name,
"search_name": search_name(name, exec_name, description=description)
"search_name": search_name(name, exec_name)
}
self._app_icon_cache.add_icon(record['desktop_file'], app.get_icon(), app.get_string('Icon'))

Expand Down Expand Up @@ -156,7 +155,7 @@ def find(self, query, result_list=None):
return result_list


def search_name(name, exec_name, description=None):
def search_name(name, exec_name):
"""
Returns string that will be used for search
We want to make sure app can be searchable by its exec_name
Expand All @@ -178,11 +177,6 @@ def search_name(name, exec_name, description=None):
common_words = exec_name_split & name_split

if common_words:
result = name
else:
result = '%s %s' % (name, exec_name)

if description:
result = '%s %s' % (result, description)
return name

return result
return '%s %s' % (name, exec_name)

0 comments on commit da854e7

Please sign in to comment.