Skip to content

Commit

Permalink
app-info: Make use of the XdpAppInfo subclasses
Browse files Browse the repository at this point in the history
Implement existing functions using the new private fields of XdpAppInfo
and the new vfuncs of the class. Also instantiate the subclasses.

This allows us to remove the app info kind and the kind specific fields
from XdpAppInfo and delegates all of that to the subclasses.
  • Loading branch information
swick committed Aug 6, 2024
1 parent 0b06a3d commit c4e4754
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 769 deletions.
4 changes: 2 additions & 2 deletions src/background.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,9 +812,9 @@ handle_request_background_in_thread_func (GTask *task,
guint32 response = 2;
g_autoptr(GVariant) results = NULL;
g_autoptr(GError) error = NULL;
g_autoptr(GAppInfo) info = NULL;
GAppInfo *info = NULL;

info = xdp_app_info_load_app_info (request->app_info);
info = xdp_app_info_get_gappinfo (request->app_info);
app_id = info ? xdp_get_app_id_from_desktop_id (g_app_info_get_id (info)) : g_strdup (id);

title = g_strdup_printf (_("Allow %s to run in the background?"), info ? g_app_info_get_display_name (info) : id);
Expand Down
4 changes: 1 addition & 3 deletions src/location.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,11 +532,9 @@ handle_start_in_thread_func (GTask *task,

if (g_strcmp0 (id, "") != 0)
{
g_autoptr(GAppInfo) info = NULL;
GAppInfo *info = xdp_app_info_get_gappinfo (request->app_info);
const gchar *name = NULL;

info = xdp_app_info_load_app_info (request->app_info);

if (info)
{
name = g_app_info_get_display_name (G_APP_INFO (info));
Expand Down
4 changes: 1 addition & 3 deletions src/wallpaper.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,9 @@ handle_set_wallpaper_in_thread_func (GTask *task,

if (g_strcmp0 (id, "") != 0)
{
g_autoptr(GAppInfo) info = NULL;
GAppInfo *info = xdp_app_info_get_gappinfo (request->app_info);
const gchar *name = NULL;

info = xdp_app_info_load_app_info (request->app_info);

if (info)
{
name = g_app_info_get_display_name (G_APP_INFO (info));
Expand Down
Loading

0 comments on commit c4e4754

Please sign in to comment.