[gnome-shell/T27795: 129/138] shell-app: Add API to retrieve the GenericName from the desktop file



commit 053636be4679c1525867204ea96e2db865a56147
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 4e82243591..bf194f5c6c 100644
--- a/src/shell-app.c
+++ b/src/shell-app.c
@@ -267,6 +267,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]