Replace deprecated g_basename with g_path_get_basename.