Skip to content

Commit

Permalink
trivial: Set the basename automatically from passim_item_set_file()
Browse files Browse the repository at this point in the history
  • Loading branch information
hughsie committed Oct 27, 2023
1 parent 4955108 commit fa0e5b6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libpassim/passim-item.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,11 @@ passim_item_set_file(PassimItem *self, GFile *file)
{
PassimItemPrivate *priv = GET_PRIVATE(self);
g_return_if_fail(PASSIM_IS_ITEM(self));

/* if not already set */
if (file != NULL && priv->basename == NULL)
priv->basename = g_file_get_basename(file);

g_set_object(&priv->file, file);
}

Expand Down

0 comments on commit fa0e5b6

Please sign in to comment.