trivial: Don't accidentally depend on GLib 2.54.3

None of these branches are important enough to provide fallbacks for.
This commit is contained in:
Richard Hughes 2020-12-14 12:04:30 +00:00
parent 68f565c441
commit db8533f743
4 changed files with 8 additions and 0 deletions

View File

@ -173,9 +173,11 @@ fu_device_add_possible_plugin (FuDevice *self, const gchar *plugin)
g_return_if_fail (plugin != NULL);
/* add if it does not already exist */
#if GLIB_CHECK_VERSION(2,54,3)
if (g_ptr_array_find_with_equal_func (priv->possible_plugins, plugin,
g_str_equal, NULL))
return;
#endif
g_ptr_array_add (priv->possible_plugins, g_strdup (plugin));
}

View File

@ -4481,9 +4481,11 @@ fu_engine_get_releases_for_device (FuEngine *self,
for (guint i = 0; i < releases->len; i++) {
FwupdRelease *rel_tmp = FWUPD_RELEASE (g_ptr_array_index (releases, i));
const gchar *branch_tmp = fu_engine_get_branch_fallback (fwupd_release_get_branch (rel_tmp));
#if GLIB_CHECK_VERSION(2,54,3)
if (g_ptr_array_find_with_equal_func (branches, branch_tmp,
g_str_equal, NULL))
continue;
#endif
g_ptr_array_add (branches, g_strdup (branch_tmp));
}
if (branches->len > 1)

View File

@ -2572,9 +2572,11 @@ fu_util_switch_branch (FuUtilPrivate *priv, gchar **values, GError **error)
for (guint i = 0; i < rels->len; i++) {
FwupdRelease *rel_tmp = g_ptr_array_index (rels, i);
const gchar *branch_tmp = fu_util_release_get_branch (rel_tmp);
#if GLIB_CHECK_VERSION(2,54,3)
if (g_ptr_array_find_with_equal_func (branches, branch_tmp,
g_str_equal, NULL))
continue;
#endif
g_ptr_array_add (branches, g_strdup (branch_tmp));
}

View File

@ -1923,9 +1923,11 @@ fu_util_switch_branch (FuUtilPrivate *priv, gchar **values, GError **error)
for (guint i = 0; i < rels->len; i++) {
FwupdRelease *rel_tmp = g_ptr_array_index (rels, i);
const gchar *branch_tmp = fu_util_release_get_branch (rel_tmp);
#if GLIB_CHECK_VERSION(2,54,3)
if (g_ptr_array_find_with_equal_func (branches, branch_tmp,
g_str_equal, NULL))
continue;
#endif
g_ptr_array_add (branches, g_strdup (branch_tmp));
}