[gnome-shell/T29763: 99/249] shell-app: Add API to retrieve the GenericName from the desktop file



commit 43eed14fe67659b1930409765d0771334b3385c9
Author: Mario Sanchez Prada <mario endlessm com>
Date:   Thu Nov 2 15:19:31 2017 +0000

    shell-app: Add API to retrieve the GenericName from the desktop file
    
    This will be used at least by the App Center to show an alternative
    text ("More Apps") in the desktop, which is also searchable.
    
    https://phabricator.endlessm.com/T18933

 src/shell-app.c | 9 +++++++++
 src/shell-app.h | 1 +
 2 files changed, 10 insertions(+)
---
diff --git a/src/shell-app.c b/src/shell-app.c
index 9d9663d13d..21bd4bd651 100644
--- a/src/shell-app.c
+++ b/src/shell-app.c
@@ -282,6 +282,15 @@ shell_app_get_name (ShellApp *app)
     }
 }
 
+const char *
+shell_app_get_generic_name (ShellApp *app)
+{
+  if (app->info)
+    return g_desktop_app_info_get_generic_name (G_DESKTOP_APP_INFO (app->info));
+  else
+    return NULL;
+}
+
 const char *
 shell_app_get_description (ShellApp *app)
 {
diff --git a/src/shell-app.h b/src/shell-app.h
index 833c984c68..618e682fc4 100644
--- a/src/shell-app.h
+++ b/src/shell-app.h
@@ -24,6 +24,7 @@ GDesktopAppInfo *shell_app_get_app_info (ShellApp *app);
 
 ClutterActor *shell_app_create_icon_texture (ShellApp *app, int size);
 const char *shell_app_get_name (ShellApp *app);
+const char *shell_app_get_generic_name (ShellApp *app);
 const char *shell_app_get_description (ShellApp *app);
 GIcon *shell_app_get_icon (ShellApp *app);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]