/* src/bazaar.p/bz-flatpak-repo.c
 *
 * Copyright 2026 AUTOGEN
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

#include "src/bazaar.p/bz-flatpak-repo.h"



struct _BzFlatpakRepo
{
  GObject parent_instance;

  char *name;
  char *title;
  char *url;
  char *homepage;
  char *comment;
  char *description;
  char *icon;
  char *gpg_key;
  char *default_branch;
  char *filter;
  gboolean is_user;
  gboolean disabled;
  gboolean noenumerate;
  gboolean gpg_verify;
};

G_DEFINE_FINAL_TYPE (BzFlatpakRepo, bz_flatpak_repo, G_TYPE_OBJECT);

enum
{
  PROP_0,

  PROP_NAME,
  PROP_TITLE,
  PROP_URL,
  PROP_HOMEPAGE,
  PROP_COMMENT,
  PROP_DESCRIPTION,
  PROP_ICON,
  PROP_GPG_KEY,
  PROP_DEFAULT_BRANCH,
  PROP_FILTER,
  PROP_IS_USER,
  PROP_DISABLED,
  PROP_NOENUMERATE,
  PROP_GPG_VERIFY,

  LAST_PROP
};
static GParamSpec *props[LAST_PROP] = { 0 };

static void
bz_flatpak_repo_dispose (GObject *object)
{
  BzFlatpakRepo *self = BZ_FLATPAK_REPO (object);

  g_clear_pointer (&self->name, g_free);
  g_clear_pointer (&self->title, g_free);
  g_clear_pointer (&self->url, g_free);
  g_clear_pointer (&self->homepage, g_free);
  g_clear_pointer (&self->comment, g_free);
  g_clear_pointer (&self->description, g_free);
  g_clear_pointer (&self->icon, g_free);
  g_clear_pointer (&self->gpg_key, g_free);
  g_clear_pointer (&self->default_branch, g_free);
  g_clear_pointer (&self->filter, g_free);

  G_OBJECT_CLASS (bz_flatpak_repo_parent_class)->dispose (object);
}

static void
bz_flatpak_repo_get_property (GObject    *object,
                       guint       prop_id,
                       GValue     *value,
                       GParamSpec *pspec)
{
  BzFlatpakRepo *self = BZ_FLATPAK_REPO (object);

  switch (prop_id)
    {
    case PROP_NAME:
      g_value_set_string (value, bz_flatpak_repo_get_name (self));
      break;
    case PROP_TITLE:
      g_value_set_string (value, bz_flatpak_repo_get_title (self));
      break;
    case PROP_URL:
      g_value_set_string (value, bz_flatpak_repo_get_url (self));
      break;
    case PROP_HOMEPAGE:
      g_value_set_string (value, bz_flatpak_repo_get_homepage (self));
      break;
    case PROP_COMMENT:
      g_value_set_string (value, bz_flatpak_repo_get_comment (self));
      break;
    case PROP_DESCRIPTION:
      g_value_set_string (value, bz_flatpak_repo_get_description (self));
      break;
    case PROP_ICON:
      g_value_set_string (value, bz_flatpak_repo_get_icon (self));
      break;
    case PROP_GPG_KEY:
      g_value_set_string (value, bz_flatpak_repo_get_gpg_key (self));
      break;
    case PROP_DEFAULT_BRANCH:
      g_value_set_string (value, bz_flatpak_repo_get_default_branch (self));
      break;
    case PROP_FILTER:
      g_value_set_string (value, bz_flatpak_repo_get_filter (self));
      break;
    case PROP_IS_USER:
      g_value_set_boolean (value, bz_flatpak_repo_get_is_user (self));
      break;
    case PROP_DISABLED:
      g_value_set_boolean (value, bz_flatpak_repo_get_disabled (self));
      break;
    case PROP_NOENUMERATE:
      g_value_set_boolean (value, bz_flatpak_repo_get_noenumerate (self));
      break;
    case PROP_GPG_VERIFY:
      g_value_set_boolean (value, bz_flatpak_repo_get_gpg_verify (self));
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
    }
}

static void
bz_flatpak_repo_set_property (GObject      *object,
                       guint         prop_id,
                       const GValue *value,
                       GParamSpec   *pspec)
{
  BzFlatpakRepo *self = BZ_FLATPAK_REPO (object);

  switch (prop_id)
    {
    case PROP_NAME:
      bz_flatpak_repo_set_name (self, g_value_get_string (value));
      break;
    case PROP_TITLE:
      bz_flatpak_repo_set_title (self, g_value_get_string (value));
      break;
    case PROP_URL:
      bz_flatpak_repo_set_url (self, g_value_get_string (value));
      break;
    case PROP_HOMEPAGE:
      bz_flatpak_repo_set_homepage (self, g_value_get_string (value));
      break;
    case PROP_COMMENT:
      bz_flatpak_repo_set_comment (self, g_value_get_string (value));
      break;
    case PROP_DESCRIPTION:
      bz_flatpak_repo_set_description (self, g_value_get_string (value));
      break;
    case PROP_ICON:
      bz_flatpak_repo_set_icon (self, g_value_get_string (value));
      break;
    case PROP_GPG_KEY:
      bz_flatpak_repo_set_gpg_key (self, g_value_get_string (value));
      break;
    case PROP_DEFAULT_BRANCH:
      bz_flatpak_repo_set_default_branch (self, g_value_get_string (value));
      break;
    case PROP_FILTER:
      bz_flatpak_repo_set_filter (self, g_value_get_string (value));
      break;
    case PROP_IS_USER:
      bz_flatpak_repo_set_is_user (self, g_value_get_boolean (value));
      break;
    case PROP_DISABLED:
      bz_flatpak_repo_set_disabled (self, g_value_get_boolean (value));
      break;
    case PROP_NOENUMERATE:
      bz_flatpak_repo_set_noenumerate (self, g_value_get_boolean (value));
      break;
    case PROP_GPG_VERIFY:
      bz_flatpak_repo_set_gpg_verify (self, g_value_get_boolean (value));
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
    }
}

static void
bz_flatpak_repo_class_init (BzFlatpakRepoClass *klass)
{
  GObjectClass *object_class = G_OBJECT_CLASS (klass);



  object_class->set_property = bz_flatpak_repo_set_property;
  object_class->get_property = bz_flatpak_repo_get_property;
  object_class->dispose      = bz_flatpak_repo_dispose;

  props[PROP_NAME] =
      g_param_spec_string (
          "name",
          NULL, NULL, NULL,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);

  props[PROP_TITLE] =
      g_param_spec_string (
          "title",
          NULL, NULL, NULL,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);

  props[PROP_URL] =
      g_param_spec_string (
          "url",
          NULL, NULL, NULL,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);

  props[PROP_HOMEPAGE] =
      g_param_spec_string (
          "homepage",
          NULL, NULL, NULL,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);

  props[PROP_COMMENT] =
      g_param_spec_string (
          "comment",
          NULL, NULL, NULL,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);

  props[PROP_DESCRIPTION] =
      g_param_spec_string (
          "description",
          NULL, NULL, NULL,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);

  props[PROP_ICON] =
      g_param_spec_string (
          "icon",
          NULL, NULL, NULL,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);

  props[PROP_GPG_KEY] =
      g_param_spec_string (
          "gpg-key",
          NULL, NULL, NULL,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);

  props[PROP_DEFAULT_BRANCH] =
      g_param_spec_string (
          "default-branch",
          NULL, NULL, NULL,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);

  props[PROP_FILTER] =
      g_param_spec_string (
          "filter",
          NULL, NULL, NULL,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);

  props[PROP_IS_USER] =
      g_param_spec_boolean (
          "is-user",
          NULL, NULL, FALSE,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);

  props[PROP_DISABLED] =
      g_param_spec_boolean (
          "disabled",
          NULL, NULL, FALSE,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);

  props[PROP_NOENUMERATE] =
      g_param_spec_boolean (
          "noenumerate",
          NULL, NULL, FALSE,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);

  props[PROP_GPG_VERIFY] =
      g_param_spec_boolean (
          "gpg-verify",
          NULL, NULL, FALSE,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);

  g_object_class_install_properties (object_class, LAST_PROP, props);
}

static void
bz_flatpak_repo_init (BzFlatpakRepo *self)
{
}

BzFlatpakRepo *
bz_flatpak_repo_new (void){
  return g_object_new (BZ_TYPE_FLATPAK_REPO, NULL);
}

const char *
bz_flatpak_repo_get_name (BzFlatpakRepo *self){
  g_return_val_if_fail (BZ_IS_FLATPAK_REPO (self), NULL);
  return self->name;
}

const char *
bz_flatpak_repo_get_title (BzFlatpakRepo *self){
  g_return_val_if_fail (BZ_IS_FLATPAK_REPO (self), NULL);
  return self->title;
}

const char *
bz_flatpak_repo_get_url (BzFlatpakRepo *self){
  g_return_val_if_fail (BZ_IS_FLATPAK_REPO (self), NULL);
  return self->url;
}

const char *
bz_flatpak_repo_get_homepage (BzFlatpakRepo *self){
  g_return_val_if_fail (BZ_IS_FLATPAK_REPO (self), NULL);
  return self->homepage;
}

const char *
bz_flatpak_repo_get_comment (BzFlatpakRepo *self){
  g_return_val_if_fail (BZ_IS_FLATPAK_REPO (self), NULL);
  return self->comment;
}

const char *
bz_flatpak_repo_get_description (BzFlatpakRepo *self){
  g_return_val_if_fail (BZ_IS_FLATPAK_REPO (self), NULL);
  return self->description;
}

const char *
bz_flatpak_repo_get_icon (BzFlatpakRepo *self){
  g_return_val_if_fail (BZ_IS_FLATPAK_REPO (self), NULL);
  return self->icon;
}

const char *
bz_flatpak_repo_get_gpg_key (BzFlatpakRepo *self){
  g_return_val_if_fail (BZ_IS_FLATPAK_REPO (self), NULL);
  return self->gpg_key;
}

const char *
bz_flatpak_repo_get_default_branch (BzFlatpakRepo *self){
  g_return_val_if_fail (BZ_IS_FLATPAK_REPO (self), NULL);
  return self->default_branch;
}

const char *
bz_flatpak_repo_get_filter (BzFlatpakRepo *self){
  g_return_val_if_fail (BZ_IS_FLATPAK_REPO (self), NULL);
  return self->filter;
}

gboolean
bz_flatpak_repo_get_is_user (BzFlatpakRepo *self){
  g_return_val_if_fail (BZ_IS_FLATPAK_REPO (self), FALSE);
  return self->is_user;
}

gboolean
bz_flatpak_repo_get_disabled (BzFlatpakRepo *self){
  g_return_val_if_fail (BZ_IS_FLATPAK_REPO (self), FALSE);
  return self->disabled;
}

gboolean
bz_flatpak_repo_get_noenumerate (BzFlatpakRepo *self){
  g_return_val_if_fail (BZ_IS_FLATPAK_REPO (self), FALSE);
  return self->noenumerate;
}

gboolean
bz_flatpak_repo_get_gpg_verify (BzFlatpakRepo *self){
  g_return_val_if_fail (BZ_IS_FLATPAK_REPO (self), FALSE);
  return self->gpg_verify;
}

void
bz_flatpak_repo_set_name (BzFlatpakRepo *self,
    const char *name){
  g_return_if_fail (BZ_IS_FLATPAK_REPO (self));

  if (name == self->name || (name != NULL && self->name != NULL && g_strcmp0(name, self->name) == 0))
    return;

  g_clear_pointer (&self->name, g_free);
  if (name != NULL)
    self->name = g_strdup (name);

  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_NAME]);
}

void
bz_flatpak_repo_set_title (BzFlatpakRepo *self,
    const char *title){
  g_return_if_fail (BZ_IS_FLATPAK_REPO (self));

  if (title == self->title || (title != NULL && self->title != NULL && g_strcmp0(title, self->title) == 0))
    return;

  g_clear_pointer (&self->title, g_free);
  if (title != NULL)
    self->title = g_strdup (title);

  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_TITLE]);
}

void
bz_flatpak_repo_set_url (BzFlatpakRepo *self,
    const char *url){
  g_return_if_fail (BZ_IS_FLATPAK_REPO (self));

  if (url == self->url || (url != NULL && self->url != NULL && g_strcmp0(url, self->url) == 0))
    return;

  g_clear_pointer (&self->url, g_free);
  if (url != NULL)
    self->url = g_strdup (url);

  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_URL]);
}

void
bz_flatpak_repo_set_homepage (BzFlatpakRepo *self,
    const char *homepage){
  g_return_if_fail (BZ_IS_FLATPAK_REPO (self));

  if (homepage == self->homepage || (homepage != NULL && self->homepage != NULL && g_strcmp0(homepage, self->homepage) == 0))
    return;

  g_clear_pointer (&self->homepage, g_free);
  if (homepage != NULL)
    self->homepage = g_strdup (homepage);

  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_HOMEPAGE]);
}

void
bz_flatpak_repo_set_comment (BzFlatpakRepo *self,
    const char *comment){
  g_return_if_fail (BZ_IS_FLATPAK_REPO (self));

  if (comment == self->comment || (comment != NULL && self->comment != NULL && g_strcmp0(comment, self->comment) == 0))
    return;

  g_clear_pointer (&self->comment, g_free);
  if (comment != NULL)
    self->comment = g_strdup (comment);

  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_COMMENT]);
}

void
bz_flatpak_repo_set_description (BzFlatpakRepo *self,
    const char *description){
  g_return_if_fail (BZ_IS_FLATPAK_REPO (self));

  if (description == self->description || (description != NULL && self->description != NULL && g_strcmp0(description, self->description) == 0))
    return;

  g_clear_pointer (&self->description, g_free);
  if (description != NULL)
    self->description = g_strdup (description);

  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_DESCRIPTION]);
}

void
bz_flatpak_repo_set_icon (BzFlatpakRepo *self,
    const char *icon){
  g_return_if_fail (BZ_IS_FLATPAK_REPO (self));

  if (icon == self->icon || (icon != NULL && self->icon != NULL && g_strcmp0(icon, self->icon) == 0))
    return;

  g_clear_pointer (&self->icon, g_free);
  if (icon != NULL)
    self->icon = g_strdup (icon);

  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_ICON]);
}

void
bz_flatpak_repo_set_gpg_key (BzFlatpakRepo *self,
    const char *gpg_key){
  g_return_if_fail (BZ_IS_FLATPAK_REPO (self));

  if (gpg_key == self->gpg_key || (gpg_key != NULL && self->gpg_key != NULL && g_strcmp0(gpg_key, self->gpg_key) == 0))
    return;

  g_clear_pointer (&self->gpg_key, g_free);
  if (gpg_key != NULL)
    self->gpg_key = g_strdup (gpg_key);

  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_GPG_KEY]);
}

void
bz_flatpak_repo_set_default_branch (BzFlatpakRepo *self,
    const char *default_branch){
  g_return_if_fail (BZ_IS_FLATPAK_REPO (self));

  if (default_branch == self->default_branch || (default_branch != NULL && self->default_branch != NULL && g_strcmp0(default_branch, self->default_branch) == 0))
    return;

  g_clear_pointer (&self->default_branch, g_free);
  if (default_branch != NULL)
    self->default_branch = g_strdup (default_branch);

  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_DEFAULT_BRANCH]);
}

void
bz_flatpak_repo_set_filter (BzFlatpakRepo *self,
    const char *filter){
  g_return_if_fail (BZ_IS_FLATPAK_REPO (self));

  if (filter == self->filter || (filter != NULL && self->filter != NULL && g_strcmp0(filter, self->filter) == 0))
    return;

  g_clear_pointer (&self->filter, g_free);
  if (filter != NULL)
    self->filter = g_strdup (filter);

  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_FILTER]);
}

void
bz_flatpak_repo_set_is_user (BzFlatpakRepo *self,
    gboolean is_user){
  g_return_if_fail (BZ_IS_FLATPAK_REPO (self));

  if (!!is_user == !!self->is_user)
    return;

  self->is_user = is_user;

  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_IS_USER]);
}

void
bz_flatpak_repo_set_disabled (BzFlatpakRepo *self,
    gboolean disabled){
  g_return_if_fail (BZ_IS_FLATPAK_REPO (self));

  if (!!disabled == !!self->disabled)
    return;

  self->disabled = disabled;

  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_DISABLED]);
}

void
bz_flatpak_repo_set_noenumerate (BzFlatpakRepo *self,
    gboolean noenumerate){
  g_return_if_fail (BZ_IS_FLATPAK_REPO (self));

  if (!!noenumerate == !!self->noenumerate)
    return;

  self->noenumerate = noenumerate;

  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_NOENUMERATE]);
}

void
bz_flatpak_repo_set_gpg_verify (BzFlatpakRepo *self,
    gboolean gpg_verify){
  g_return_if_fail (BZ_IS_FLATPAK_REPO (self));

  if (!!gpg_verify == !!self->gpg_verify)
    return;

  self->gpg_verify = gpg_verify;

  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_GPG_VERIFY]);
}

void
bz_flatpak_repo_set_name_take (BzFlatpakRepo *self,
    char *name){
  g_return_if_fail (BZ_IS_FLATPAK_REPO (self));

  if (name != NULL && self->name != NULL && g_strcmp0(name, self->name) == 0){
    g_free (name);
    return;
  }

  g_clear_pointer (&self->name, g_free);
  if (name != NULL)
    self->name = name;

  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_NAME]);
}

void
bz_flatpak_repo_set_title_take (BzFlatpakRepo *self,
    char *title){
  g_return_if_fail (BZ_IS_FLATPAK_REPO (self));

  if (title != NULL && self->title != NULL && g_strcmp0(title, self->title) == 0){
    g_free (title);
    return;
  }

  g_clear_pointer (&self->title, g_free);
  if (title != NULL)
    self->title = title;

  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_TITLE]);
}

void
bz_flatpak_repo_set_url_take (BzFlatpakRepo *self,
    char *url){
  g_return_if_fail (BZ_IS_FLATPAK_REPO (self));

  if (url != NULL && self->url != NULL && g_strcmp0(url, self->url) == 0){
    g_free (url);
    return;
  }

  g_clear_pointer (&self->url, g_free);
  if (url != NULL)
    self->url = url;

  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_URL]);
}

void
bz_flatpak_repo_set_homepage_take (BzFlatpakRepo *self,
    char *homepage){
  g_return_if_fail (BZ_IS_FLATPAK_REPO (self));

  if (homepage != NULL && self->homepage != NULL && g_strcmp0(homepage, self->homepage) == 0){
    g_free (homepage);
    return;
  }

  g_clear_pointer (&self->homepage, g_free);
  if (homepage != NULL)
    self->homepage = homepage;

  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_HOMEPAGE]);
}

void
bz_flatpak_repo_set_comment_take (BzFlatpakRepo *self,
    char *comment){
  g_return_if_fail (BZ_IS_FLATPAK_REPO (self));

  if (comment != NULL && self->comment != NULL && g_strcmp0(comment, self->comment) == 0){
    g_free (comment);
    return;
  }

  g_clear_pointer (&self->comment, g_free);
  if (comment != NULL)
    self->comment = comment;

  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_COMMENT]);
}

void
bz_flatpak_repo_set_description_take (BzFlatpakRepo *self,
    char *description){
  g_return_if_fail (BZ_IS_FLATPAK_REPO (self));

  if (description != NULL && self->description != NULL && g_strcmp0(description, self->description) == 0){
    g_free (description);
    return;
  }

  g_clear_pointer (&self->description, g_free);
  if (description != NULL)
    self->description = description;

  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_DESCRIPTION]);
}

void
bz_flatpak_repo_set_icon_take (BzFlatpakRepo *self,
    char *icon){
  g_return_if_fail (BZ_IS_FLATPAK_REPO (self));

  if (icon != NULL && self->icon != NULL && g_strcmp0(icon, self->icon) == 0){
    g_free (icon);
    return;
  }

  g_clear_pointer (&self->icon, g_free);
  if (icon != NULL)
    self->icon = icon;

  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_ICON]);
}

void
bz_flatpak_repo_set_gpg_key_take (BzFlatpakRepo *self,
    char *gpg_key){
  g_return_if_fail (BZ_IS_FLATPAK_REPO (self));

  if (gpg_key != NULL && self->gpg_key != NULL && g_strcmp0(gpg_key, self->gpg_key) == 0){
    g_free (gpg_key);
    return;
  }

  g_clear_pointer (&self->gpg_key, g_free);
  if (gpg_key != NULL)
    self->gpg_key = gpg_key;

  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_GPG_KEY]);
}

void
bz_flatpak_repo_set_default_branch_take (BzFlatpakRepo *self,
    char *default_branch){
  g_return_if_fail (BZ_IS_FLATPAK_REPO (self));

  if (default_branch != NULL && self->default_branch != NULL && g_strcmp0(default_branch, self->default_branch) == 0){
    g_free (default_branch);
    return;
  }

  g_clear_pointer (&self->default_branch, g_free);
  if (default_branch != NULL)
    self->default_branch = default_branch;

  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_DEFAULT_BRANCH]);
}

void
bz_flatpak_repo_set_filter_take (BzFlatpakRepo *self,
    char *filter){
  g_return_if_fail (BZ_IS_FLATPAK_REPO (self));

  if (filter != NULL && self->filter != NULL && g_strcmp0(filter, self->filter) == 0){
    g_free (filter);
    return;
  }

  g_clear_pointer (&self->filter, g_free);
  if (filter != NULL)
    self->filter = filter;

  g_object_notify_by_pspec (G_OBJECT (self), props[PROP_FILTER]);
}

/* End of src/bazaar.p/bz-flatpak-repo.c */
