[gnome-builder] device: add IdeDeviceError
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] device: add IdeDeviceError
- Date: Sun, 17 Jul 2016 10:21:54 +0000 (UTC)
commit 0c4ac6ee4b4bb79cd8f323aa428e4052beae1c55
Author: Christian Hergert <chergert redhat com>
Date: Sun Jul 17 02:25:14 2016 -0700
device: add IdeDeviceError
libide/devices/ide-device.c | 11 +++++++++++
libide/devices/ide-device.h | 21 ++++++++++++++-------
2 files changed, 25 insertions(+), 7 deletions(-)
---
diff --git a/libide/devices/ide-device.c b/libide/devices/ide-device.c
index e3e8220..70aba6f 100644
--- a/libide/devices/ide-device.c
+++ b/libide/devices/ide-device.c
@@ -250,3 +250,14 @@ ide_device_prepare_configuration (IdeDevice *self,
if (IDE_DEVICE_GET_CLASS (self)->prepare_configuration)
IDE_DEVICE_GET_CLASS (self)->prepare_configuration (self, configuration);
}
+
+GQuark
+ide_device_error_quark (void)
+{
+ static GQuark quark = 0;
+
+ if G_UNLIKELY (quark == 0)
+ quark = g_quark_from_static_string ("ide_device_error_quark");
+
+ return quark;
+}
diff --git a/libide/devices/ide-device.h b/libide/devices/ide-device.h
index 595436c..8215084 100644
--- a/libide/devices/ide-device.h
+++ b/libide/devices/ide-device.h
@@ -24,7 +24,13 @@
G_BEGIN_DECLS
-#define IDE_TYPE_DEVICE (ide_device_get_type())
+typedef enum
+{
+ IDE_DEVICE_ERROR_NO_SUCH_DEVICE = 1,
+} IdeDeviceError;
+
+#define IDE_TYPE_DEVICE (ide_device_get_type())
+#define IDE_DEVICE_ERROR (ide_device_error_quark())
G_DECLARE_DERIVABLE_TYPE (IdeDevice, ide_device, IDE, DEVICE, IdeObject)
@@ -37,12 +43,13 @@ struct _IdeDeviceClass
IdeConfiguration *configuration);
};
-const gchar *ide_device_get_display_name (IdeDevice *self);
-void ide_device_set_display_name (IdeDevice *self,
- const gchar *display_name);
-const gchar *ide_device_get_id (IdeDevice *self);
-void ide_device_set_id (IdeDevice *self,
- const gchar *id);
+GQuark ide_device_error_quark (void) G_GNUC_CONST;
+const gchar *ide_device_get_display_name (IdeDevice *self);
+void ide_device_set_display_name (IdeDevice *self,
+ const gchar *display_name);
+const gchar *ide_device_get_id (IdeDevice *self);
+void ide_device_set_id (IdeDevice *self,
+ const gchar *id);
const gchar *ide_device_get_system_type (IdeDevice *self);
void ide_device_prepare_configuration (IdeDevice *self,
IdeConfiguration *configuration);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]