Commit 24a637a0 authored by Christian Hergert's avatar Christian Hergert
Browse files

configuration: add supports_device and supports_runtime

These are can be used to check to see if a configuration supports a
particular device or runtime. Ideally these will be used to filter the
list of available runtimes/devices in the build preferences so you can
only select valid options.
parent 44ebfd3f
......@@ -1425,3 +1425,37 @@ ide_configuration_get_ready (IdeConfiguration *self)
return priv->device_ready && priv->runtime_ready;
}
gboolean
ide_configuration_supports_device (IdeConfiguration *self,
IdeDevice *device)
{
gboolean ret = TRUE;
IDE_ENTRY;
g_return_val_if_fail (IDE_IS_CONFIGURATION (self), FALSE);
g_return_val_if_fail (IDE_IS_DEVICE (device), FALSE);
if (IDE_CONFIGURATION_GET_CLASS (self)->supports_device)
ret = IDE_CONFIGURATION_GET_CLASS (self)->supports_device (self, device);
IDE_RETURN (ret);
}
gboolean
ide_configuration_supports_runtime (IdeConfiguration *self,
IdeRuntime *runtime)
{
gboolean ret = TRUE;
IDE_ENTRY;
g_return_val_if_fail (IDE_IS_CONFIGURATION (self), FALSE);
g_return_val_if_fail (IDE_IS_RUNTIME (runtime), FALSE);
if (IDE_CONFIGURATION_GET_CLASS (self)->supports_runtime)
ret = IDE_CONFIGURATION_GET_CLASS (self)->supports_runtime (self, runtime);
IDE_RETURN (ret);
}
......@@ -34,6 +34,11 @@ struct _IdeConfigurationClass
{
IdeObjectClass parent;
gboolean (*supports_device) (IdeConfiguration *self,
IdeDevice *device);
gboolean (*supports_runtime) (IdeConfiguration *self,
IdeRuntime *runtime);
gpointer _reserved1;
gpointer _reserved2;
gpointer _reserved3;
......@@ -103,6 +108,10 @@ guint ide_configuration_get_sequence (IdeConfiguration
const gchar *ide_configuration_get_app_id (IdeConfiguration *self);
void ide_configuration_set_app_id (IdeConfiguration *self,
const gchar *app_id);
gboolean ide_configuration_supports_device (IdeConfiguration *self,
IdeDevice *device);
gboolean ide_configuration_supports_runtime (IdeConfiguration *self,
IdeRuntime *runtime);
const gchar *ide_configuration_get_internal_string (IdeConfiguration *self,
const gchar *key);
void ide_configuration_set_internal_string (IdeConfiguration *self,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment