[gnome-builder] libide/tweaks: add get item helper
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide/tweaks: add get item helper
- Date: Sat, 27 Aug 2022 11:18:50 +0000 (UTC)
commit 8522eb9827b93d4d5201a38619fd21eca9fdbb00
Author: Christian Hergert <chergert redhat com>
Date: Sat Aug 27 03:45:01 2022 -0700
libide/tweaks: add get item helper
src/libide/tweaks/ide-tweaks-factory.c | 18 +++++++++++++++++-
src/libide/tweaks/ide-tweaks-factory.h | 2 ++
2 files changed, 19 insertions(+), 1 deletion(-)
---
diff --git a/src/libide/tweaks/ide-tweaks-factory.c b/src/libide/tweaks/ide-tweaks-factory.c
index c318babed..da6bfc2ac 100644
--- a/src/libide/tweaks/ide-tweaks-factory.c
+++ b/src/libide/tweaks/ide-tweaks-factory.c
@@ -76,7 +76,7 @@ ide_tweaks_factory_get_property (GObject *object,
break;
case PROP_ITEM:
- g_value_set_object (value, self->item);
+ g_value_set_object (value, ide_tweaks_factory_get_item (self));
break;
default:
@@ -298,3 +298,19 @@ ide_tweaks_factory_visit (IdeTweaksFactory *self,
return ret;
}
+
+/**
+ * ide_tweaks_factory_get_item:
+ * @self: a #IdeTweaksFactory
+ *
+ * Gets the item for the factory while it is being built.
+ *
+ * Returns: (transfer none) (nullable) (type GObject): a #GObject or %NULL
+ */
+gpointer
+ide_tweaks_factory_get_item (IdeTweaksFactory *self)
+{
+ g_return_val_if_fail (IDE_IS_TWEAKS_FACTORY (self), NULL);
+
+ return self->item;
+}
diff --git a/src/libide/tweaks/ide-tweaks-factory.h b/src/libide/tweaks/ide-tweaks-factory.h
index 8ff6b5885..0ad1c9e4b 100644
--- a/src/libide/tweaks/ide-tweaks-factory.h
+++ b/src/libide/tweaks/ide-tweaks-factory.h
@@ -37,6 +37,8 @@ IDE_AVAILABLE_IN_ALL
void ide_tweaks_factory_set_model (IdeTweaksFactory *self,
GListModel *model);
IDE_AVAILABLE_IN_ALL
+gpointer ide_tweaks_factory_get_item (IdeTweaksFactory *self);
+IDE_AVAILABLE_IN_ALL
gboolean ide_tweaks_factory_visit (IdeTweaksFactory *self,
IdeTweaksItemVisitor visitor,
gpointer visitor_data);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]