mirror of
https://github.com/flatpak/flatpak.git
synced 2026-01-29 01:51:20 -05:00
Make sure we have IDs and display names
Return non-NULL strings from flatpak_dir_get_id() and flatpak_dir_get_display_name() for user installations, to save library users the hassle of dealing with NULL return values. Closes: #2583 Approved by: alexlarsson
This commit is contained in:
committed by
Atomic Bot
parent
eaebab1285
commit
f7a566e2ab
@@ -1670,6 +1670,9 @@ flatpak_dir_get_changed_path (FlatpakDir *self)
|
||||
const char *
|
||||
flatpak_dir_get_id (FlatpakDir *self)
|
||||
{
|
||||
if (self->user)
|
||||
return "user";
|
||||
|
||||
if (self->extra_data != NULL)
|
||||
return self->extra_data->id;
|
||||
|
||||
@@ -1709,6 +1712,9 @@ flatpak_dir_get_name_cached (FlatpakDir *self)
|
||||
const char *
|
||||
flatpak_dir_get_display_name (FlatpakDir *self)
|
||||
{
|
||||
if (self->user)
|
||||
return _("User installation");
|
||||
|
||||
if (self->extra_data != NULL)
|
||||
return self->extra_data->display_name;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user