[gnome-builder/wip/nacho/doap-contrib: 2/3] Use doap as namespace for the doap code



commit 5d79e8aeb7abfadc191c1185ad6bc96d7ef4ae63
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Mon Jan 18 17:34:42 2016 +0100

    Use doap as namespace for the doap code
    
    Also IdeDoap is now called DoapDocument. This change makes
    it ide free

 contrib/doap/Makefile.am                          |    8 +-
 contrib/doap/{ide-doap.c => doap-document.c}      |  216 ++++++++++----------
 contrib/doap/doap-document.h                      |   56 ++++++
 contrib/doap/{ide-doap-person.c => doap-person.c} |   78 ++++----
 contrib/doap/{ide-doap-person.h => doap-person.h} |   24 ++--
 contrib/doap/ide-doap.h                           |   56 ------
 libide/greeter/ide-greeter-project-row.c          |    4 +-
 libide/ide-context.c                              |   16 +-
 libide/ide-enums.c.in                             |    2 +-
 libide/ide-project-info.c                         |   28 ++--
 libide/ide-project-info.h                         |    4 +-
 plugins/autotools/ide-autotools-project-miner.c   |   14 +-
 12 files changed, 253 insertions(+), 253 deletions(-)
---
diff --git a/contrib/doap/Makefile.am b/contrib/doap/Makefile.am
index aa75ca6..f321b82 100644
--- a/contrib/doap/Makefile.am
+++ b/contrib/doap/Makefile.am
@@ -5,10 +5,10 @@ libdoap_la_CPPFLAGS = \
        $(NULL)
 
 libdoap_la_SOURCES = \
-       ide-doap.c \
-       ide-doap.h \
-       ide-doap-person.c \
-       ide-doap-person.h \
+       doap-document.c \
+       doap-document.h \
+       doap-person.c \
+       doap-person.h \
        $(NULL)
 
 libdoap_la_CFLAGS = \
diff --git a/contrib/doap/ide-doap.c b/contrib/doap/doap-document.c
similarity index 65%
rename from contrib/doap/ide-doap.c
rename to contrib/doap/doap-document.c
index add5b67..1265221 100644
--- a/contrib/doap/ide-doap.c
+++ b/contrib/doap/doap-document.c
@@ -1,4 +1,4 @@
-/* ide-doap.c
+/* doap-document.c
  *
  * Copyright (C) 2015 Christian Hergert <christian hergert me>
  *
@@ -16,11 +16,11 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#define G_LOG_DOMAIN "ide-doap"
+#define G_LOG_DOMAIN "doap"
 
 #include <glib/gi18n.h>
 
-#include "ide-doap.h"
+#include "doap-document.h"
 
 #include "xml-reader.h"
 
@@ -28,7 +28,7 @@
  * TODO: We don't do any XMLNS checking or anything here.
  */
 
-struct _IdeDoap
+struct _DoapDocument
 {
   GObject parent_instance;
 
@@ -44,8 +44,8 @@ struct _IdeDoap
   GList     *maintainers;
 };
 
-G_DEFINE_QUARK (ide_doap_error, ide_doap_error)
-G_DEFINE_TYPE (IdeDoap, ide_doap, G_TYPE_OBJECT)
+G_DEFINE_QUARK (doap_document_error, doap_document_error)
+G_DEFINE_TYPE (DoapDocument, doap_document, G_TYPE_OBJECT)
 
 enum {
   PROP_0,
@@ -62,77 +62,77 @@ enum {
 
 static GParamSpec *properties [LAST_PROP];
 
-IdeDoap *
-ide_doap_new (void)
+DoapDocument *
+doap_document_new (void)
 {
-  return g_object_new (IDE_TYPE_DOAP, NULL);
+  return g_object_new (DOAP_TYPE_DOCUMENT, NULL);
 }
 
 const gchar *
-ide_doap_get_name (IdeDoap *self)
+doap_document_get_name (DoapDocument *self)
 {
-  g_return_val_if_fail (IDE_IS_DOAP (self), NULL);
+  g_return_val_if_fail (DOAP_IS_DOCUMENT (self), NULL);
 
   return self->name;
 }
 
 const gchar *
-ide_doap_get_shortdesc (IdeDoap *self)
+doap_document_get_shortdesc (DoapDocument *self)
 {
-  g_return_val_if_fail (IDE_IS_DOAP (self), NULL);
+  g_return_val_if_fail (DOAP_IS_DOCUMENT (self), NULL);
 
   return self->shortdesc;
 }
 
 const gchar *
-ide_doap_get_description (IdeDoap *self)
+doap_document_get_description (DoapDocument *self)
 {
-  g_return_val_if_fail (IDE_IS_DOAP (self), NULL);
+  g_return_val_if_fail (DOAP_IS_DOCUMENT (self), NULL);
 
   return self->description;
 }
 
 const gchar *
-ide_doap_get_bug_database (IdeDoap *self)
+doap_document_get_bug_database (DoapDocument *self)
 {
-  g_return_val_if_fail (IDE_IS_DOAP (self), NULL);
+  g_return_val_if_fail (DOAP_IS_DOCUMENT (self), NULL);
 
   return self->bug_database;
 }
 
 const gchar *
-ide_doap_get_download_page (IdeDoap *self)
+doap_document_get_download_page (DoapDocument *self)
 {
-  g_return_val_if_fail (IDE_IS_DOAP (self), NULL);
+  g_return_val_if_fail (DOAP_IS_DOCUMENT (self), NULL);
 
   return self->download_page;
 }
 
 const gchar *
-ide_doap_get_homepage (IdeDoap *self)
+doap_document_get_homepage (DoapDocument *self)
 {
-  g_return_val_if_fail (IDE_IS_DOAP (self), NULL);
+  g_return_val_if_fail (DOAP_IS_DOCUMENT (self), NULL);
 
   return self->homepage;
 }
 
 const gchar *
-ide_doap_get_category (IdeDoap *self)
+doap_document_get_category (DoapDocument *self)
 {
-  g_return_val_if_fail (IDE_IS_DOAP (self), NULL);
+  g_return_val_if_fail (DOAP_IS_DOCUMENT (self), NULL);
 
   return self->category;
 }
 
 /**
- * ide_doap_get_languages:
+ * doap_document_get_languages:
  *
  * Returns: (transfer none): A #GStrv.
  */
 gchar **
-ide_doap_get_languages (IdeDoap *self)
+doap_document_get_languages (DoapDocument *self)
 {
-  g_return_val_if_fail (IDE_IS_DOAP (self), NULL);
+  g_return_val_if_fail (DOAP_IS_DOCUMENT (self), NULL);
 
   if (self->languages != NULL)
     return (gchar **)self->languages->pdata;
@@ -141,10 +141,10 @@ ide_doap_get_languages (IdeDoap *self)
 }
 
 static void
-ide_doap_set_bug_database (IdeDoap     *self,
-                           const gchar *bug_database)
+doap_document_set_bug_database (DoapDocument *self,
+                                const gchar  *bug_database)
 {
-  g_return_if_fail (IDE_IS_DOAP (self));
+  g_return_if_fail (DOAP_IS_DOCUMENT (self));
 
   if (g_strcmp0 (self->bug_database, bug_database) != 0)
     {
@@ -155,10 +155,10 @@ ide_doap_set_bug_database (IdeDoap     *self,
 }
 
 static void
-ide_doap_set_category (IdeDoap     *self,
-                       const gchar *category)
+doap_document_set_category (DoapDocument *self,
+                            const gchar  *category)
 {
-  g_return_if_fail (IDE_IS_DOAP (self));
+  g_return_if_fail (DOAP_IS_DOCUMENT (self));
 
   if (g_strcmp0 (self->category, category) != 0)
     {
@@ -169,10 +169,10 @@ ide_doap_set_category (IdeDoap     *self,
 }
 
 static void
-ide_doap_set_description (IdeDoap     *self,
-                          const gchar *description)
+doap_document_set_description (DoapDocument *self,
+                               const gchar  *description)
 {
-  g_return_if_fail (IDE_IS_DOAP (self));
+  g_return_if_fail (DOAP_IS_DOCUMENT (self));
 
   if (g_strcmp0 (self->description, description) != 0)
     {
@@ -183,10 +183,10 @@ ide_doap_set_description (IdeDoap     *self,
 }
 
 static void
-ide_doap_set_download_page (IdeDoap     *self,
-                            const gchar *download_page)
+doap_document_set_download_page (DoapDocument *self,
+                                 const gchar  *download_page)
 {
-  g_return_if_fail (IDE_IS_DOAP (self));
+  g_return_if_fail (DOAP_IS_DOCUMENT (self));
 
   if (g_strcmp0 (self->download_page, download_page) != 0)
     {
@@ -197,10 +197,10 @@ ide_doap_set_download_page (IdeDoap     *self,
 }
 
 static void
-ide_doap_set_homepage (IdeDoap     *self,
-                       const gchar *homepage)
+doap_document_set_homepage (DoapDocument *self,
+                            const gchar  *homepage)
 {
-  g_return_if_fail (IDE_IS_DOAP (self));
+  g_return_if_fail (DOAP_IS_DOCUMENT (self));
 
   if (g_strcmp0 (self->homepage, homepage) != 0)
     {
@@ -211,10 +211,10 @@ ide_doap_set_homepage (IdeDoap     *self,
 }
 
 static void
-ide_doap_set_name (IdeDoap     *self,
-                   const gchar *name)
+doap_document_set_name (DoapDocument *self,
+                        const gchar  *name)
 {
-  g_return_if_fail (IDE_IS_DOAP (self));
+  g_return_if_fail (DOAP_IS_DOCUMENT (self));
 
   if (g_strcmp0 (self->name, name) != 0)
     {
@@ -225,10 +225,10 @@ ide_doap_set_name (IdeDoap     *self,
 }
 
 static void
-ide_doap_set_shortdesc (IdeDoap     *self,
-                        const gchar *shortdesc)
+doap_document_set_shortdesc (DoapDocument *self,
+                             const gchar  *shortdesc)
 {
-  g_return_if_fail (IDE_IS_DOAP (self));
+  g_return_if_fail (DOAP_IS_DOCUMENT (self));
 
   if (g_strcmp0 (self->shortdesc, shortdesc) != 0)
     {
@@ -239,25 +239,25 @@ ide_doap_set_shortdesc (IdeDoap     *self,
 }
 
 /**
- * ide_doap_get_maintainers:
+ * doap_document_get_maintainers:
  *
  *
  *
- * Returns: (transfer none) (element-type IdeDoapPerson*): A #GList of #IdeDoapPerson.
+ * Returns: (transfer none) (element-type DoapDocumentPerson*): A #GList of #DoapDocumentPerson.
  */
 GList *
-ide_doap_get_maintainers (IdeDoap *self)
+doap_document_get_maintainers (DoapDocument *self)
 {
-  g_return_val_if_fail (IDE_IS_DOAP (self), NULL);
+  g_return_val_if_fail (DOAP_IS_DOCUMENT (self), NULL);
 
   return self->maintainers;
 }
 
 static void
-ide_doap_add_language (IdeDoap     *self,
-                       const gchar *language)
+doap_document_add_language (DoapDocument *self,
+                            const gchar  *language)
 {
-  g_return_if_fail (IDE_IS_DOAP (self));
+  g_return_if_fail (DOAP_IS_DOCUMENT (self));
   g_return_if_fail (language != NULL);
 
   if (self->languages == NULL)
@@ -275,26 +275,26 @@ ide_doap_add_language (IdeDoap     *self,
 }
 
 static void
-ide_doap_set_languages (IdeDoap  *self,
-                        gchar   **languages)
+doap_document_set_languages (DoapDocument  *self,
+                             gchar        **languages)
 {
   gsize i;
 
-  g_return_if_fail (IDE_IS_DOAP (self));
+  g_return_if_fail (DOAP_IS_DOCUMENT (self));
 
   if ((self->languages != NULL) && (self->languages->len > 0))
     g_ptr_array_remove_range (self->languages, 0, self->languages->len);
 
   g_object_freeze_notify (G_OBJECT (self));
   for (i = 0; languages [i]; i++)
-    ide_doap_add_language (self, languages [i]);
+    doap_document_add_language (self, languages [i]);
   g_object_thaw_notify (G_OBJECT (self));
 }
 
 static void
-ide_doap_finalize (GObject *object)
+doap_document_finalize (GObject *object)
 {
-  IdeDoap *self = (IdeDoap *)object;
+  DoapDocument *self = (DoapDocument *)object;
 
   g_clear_pointer (&self->bug_database, g_free);
   g_clear_pointer (&self->category, g_free);
@@ -308,49 +308,49 @@ ide_doap_finalize (GObject *object)
   g_list_free_full (self->maintainers, g_object_unref);
   self->maintainers = NULL;
 
-  G_OBJECT_CLASS (ide_doap_parent_class)->finalize (object);
+  G_OBJECT_CLASS (doap_document_parent_class)->finalize (object);
 }
 
 static void
-ide_doap_get_property (GObject    *object,
-                       guint       prop_id,
-                       GValue     *value,
-                       GParamSpec *pspec)
+doap_document_get_property (GObject    *object,
+                            guint       prop_id,
+                            GValue     *value,
+                            GParamSpec *pspec)
 {
-  IdeDoap *self = IDE_DOAP (object);
+  DoapDocument *self = DOAP_DOCUMENT (object);
 
   switch (prop_id)
     {
     case PROP_BUG_DATABASE:
-      g_value_set_string (value, ide_doap_get_bug_database (self));
+      g_value_set_string (value, doap_document_get_bug_database (self));
       break;
 
     case PROP_CATEGORY:
-      g_value_set_string (value, ide_doap_get_category (self));
+      g_value_set_string (value, doap_document_get_category (self));
       break;
 
     case PROP_DESCRIPTION:
-      g_value_set_string (value, ide_doap_get_description (self));
+      g_value_set_string (value, doap_document_get_description (self));
       break;
 
     case PROP_DOWNLOAD_PAGE:
-      g_value_set_string (value, ide_doap_get_download_page (self));
+      g_value_set_string (value, doap_document_get_download_page (self));
       break;
 
     case PROP_HOMEPAGE:
-      g_value_set_string (value, ide_doap_get_homepage (self));
+      g_value_set_string (value, doap_document_get_homepage (self));
       break;
 
     case PROP_LANGUAGES:
-      g_value_set_boxed (value, ide_doap_get_languages (self));
+      g_value_set_boxed (value, doap_document_get_languages (self));
       break;
 
     case PROP_NAME:
-      g_value_set_string (value, ide_doap_get_name (self));
+      g_value_set_string (value, doap_document_get_name (self));
       break;
 
     case PROP_SHORTDESC:
-      g_value_set_string (value, ide_doap_get_shortdesc (self));
+      g_value_set_string (value, doap_document_get_shortdesc (self));
       break;
 
     default:
@@ -359,45 +359,45 @@ ide_doap_get_property (GObject    *object,
 }
 
 static void
-ide_doap_set_property (GObject      *object,
-                       guint         prop_id,
-                       const GValue *value,
-                       GParamSpec   *pspec)
+doap_document_set_property (GObject      *object,
+                            guint         prop_id,
+                            const GValue *value,
+                            GParamSpec   *pspec)
 {
-  IdeDoap *self = IDE_DOAP (object);
+  DoapDocument *self = DOAP_DOCUMENT (object);
 
   switch (prop_id)
     {
     case PROP_BUG_DATABASE:
-      ide_doap_set_bug_database (self, g_value_get_string (value));
+      doap_document_set_bug_database (self, g_value_get_string (value));
       break;
 
     case PROP_CATEGORY:
-      ide_doap_set_category (self, g_value_get_string (value));
+      doap_document_set_category (self, g_value_get_string (value));
       break;
 
     case PROP_DESCRIPTION:
-      ide_doap_set_description (self, g_value_get_string (value));
+      doap_document_set_description (self, g_value_get_string (value));
       break;
 
     case PROP_DOWNLOAD_PAGE:
-      ide_doap_set_download_page (self, g_value_get_string (value));
+      doap_document_set_download_page (self, g_value_get_string (value));
       break;
 
     case PROP_HOMEPAGE:
-      ide_doap_set_homepage (self, g_value_get_string (value));
+      doap_document_set_homepage (self, g_value_get_string (value));
       break;
 
     case PROP_LANGUAGES:
-      ide_doap_set_languages (self, g_value_get_boxed (value));
+      doap_document_set_languages (self, g_value_get_boxed (value));
       break;
 
     case PROP_NAME:
-      ide_doap_set_name (self, g_value_get_string (value));
+      doap_document_set_name (self, g_value_get_string (value));
       break;
 
     case PROP_SHORTDESC:
-      ide_doap_set_shortdesc (self, g_value_get_string (value));
+      doap_document_set_shortdesc (self, g_value_get_string (value));
       break;
 
     default:
@@ -406,13 +406,13 @@ ide_doap_set_property (GObject      *object,
 }
 
 static void
-ide_doap_class_init (IdeDoapClass *klass)
+doap_document_class_init (DoapDocumentClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-  object_class->finalize = ide_doap_finalize;
-  object_class->get_property = ide_doap_get_property;
-  object_class->set_property = ide_doap_set_property;
+  object_class->finalize = doap_document_finalize;
+  object_class->get_property = doap_document_get_property;
+  object_class->set_property = doap_document_set_property;
 
   properties [PROP_BUG_DATABASE] =
     g_param_spec_string ("bug-database",
@@ -474,15 +474,15 @@ ide_doap_class_init (IdeDoapClass *klass)
 }
 
 static void
-ide_doap_init (IdeDoap *self)
+doap_document_init (DoapDocument *self)
 {
 }
 
 static gboolean
-ide_doap_parse_maintainer (IdeDoap   *self,
-                           XmlReader *reader)
+doap_document_parse_maintainer (DoapDocument *self,
+                                XmlReader    *reader)
 {
-  g_assert (IDE_IS_DOAP (self));
+  g_assert (DOAP_IS_DOCUMENT (self));
   g_assert (XML_IS_READER (reader));
 
   if (!xml_reader_read (reader))
@@ -492,13 +492,13 @@ ide_doap_parse_maintainer (IdeDoap   *self,
     {
       if (xml_reader_is_a_local (reader, "Person") && xml_reader_read (reader))
         {
-          g_autoptr(IdeDoapPerson) person = ide_doap_person_new ();
+          g_autoptr(DoapPerson) person = doap_person_new ();
 
           do
             {
               if (xml_reader_is_a_local (reader, "name"))
                 {
-                  ide_doap_person_set_name (person, xml_reader_read_string (reader));
+                  doap_person_set_name (person, xml_reader_read_string (reader));
                 }
               else if (xml_reader_is_a_local (reader, "mbox"))
                 {
@@ -506,13 +506,13 @@ ide_doap_parse_maintainer (IdeDoap   *self,
 
                   str = xml_reader_get_attribute (reader, "rdf:resource");
                   if (str != NULL && str[0] != '\0' && g_str_has_prefix (str, "mailto:";))
-                    ide_doap_person_set_email (person, str + strlen ("mailto:";));
+                    doap_person_set_email (person, str + strlen ("mailto:";));
                   g_free (str);
                 }
             }
           while (xml_reader_read_to_next (reader));
 
-          if (ide_doap_person_get_name (person) || ide_doap_person_get_email (person))
+          if (doap_person_get_name (person) || doap_person_get_email (person))
             self->maintainers = g_list_append (self->maintainers, g_object_ref (person));
         }
     }
@@ -522,14 +522,14 @@ ide_doap_parse_maintainer (IdeDoap   *self,
 }
 
 gboolean
-ide_doap_load_from_file (IdeDoap       *self,
-                         GFile         *file,
-                         GCancellable  *cancellable,
-                         GError       **error)
+doap_document_load_from_file (DoapDocument  *self,
+                              GFile         *file,
+                              GCancellable  *cancellable,
+                              GError       **error)
 {
   g_autoptr(XmlReader) reader = NULL;
 
-  g_return_val_if_fail (IDE_IS_DOAP (self), FALSE);
+  g_return_val_if_fail (DOAP_IS_DOCUMENT (self), FALSE);
   g_return_val_if_fail (G_IS_FILE (file), FALSE);
   g_return_val_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable), FALSE);
 
@@ -541,8 +541,8 @@ ide_doap_load_from_file (IdeDoap       *self,
   if (!xml_reader_read_start_element (reader, "Project"))
     {
       g_set_error (error,
-                   IDE_DOAP_ERROR,
-                   IDE_DOAP_ERROR_INVALID_FORMAT,
+                   DOAP_DOCUMENT_ERROR,
+                   DOAP_DOCUMENT_ERROR_INVALID_FORMAT,
                    "Project element is missing from doap.");
       return FALSE;
     }
@@ -586,12 +586,12 @@ ide_doap_load_from_file (IdeDoap       *self,
 
           str = xml_reader_read_string (reader);
           if (str != NULL && str[0] != '\0')
-            ide_doap_add_language (self, g_strstrip (str));
+            doap_document_add_language (self, g_strstrip (str));
           g_free (str);
         }
       else if (g_strcmp0 (element_name, "maintainer") == 0)
         {
-          if (!ide_doap_parse_maintainer (self, reader))
+          if (!doap_document_parse_maintainer (self, reader))
             break;
         }
     }
diff --git a/contrib/doap/doap-document.h b/contrib/doap/doap-document.h
new file mode 100644
index 0000000..979c374
--- /dev/null
+++ b/contrib/doap/doap-document.h
@@ -0,0 +1,56 @@
+/* ide-doap.h
+ *
+ * Copyright (C) 2015 Christian Hergert <christian hergert me>
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DOAP_DOCUMENT_H
+#define DOAP_DOCUMENT_H
+
+#include <gio/gio.h>
+
+#include "doap-person.h"
+
+G_BEGIN_DECLS
+
+#define DOAP_DOCUMENT_ERROR (doap_document_error_quark())
+#define DOAP_TYPE_DOCUMENT  (doap_document_get_type())
+
+G_DECLARE_FINAL_TYPE (DoapDocument, doap_document, DOAP, DOCUMENT, GObject)
+
+typedef enum
+{
+  DOAP_DOCUMENT_ERROR_INVALID_FORMAT = 1,
+} DoapDocumentError;
+
+DoapDocument  *doap_document_new               (void);
+GQuark         doap_document_error_quark       (void);
+gboolean       doap_document_load_from_file    (DoapDocument        *self,
+                                                GFile               *file,
+                                                GCancellable        *cancellable,
+                                                GError             **error);
+const gchar   *doap_document_get_name          (DoapDocument        *self);
+const gchar   *doap_document_get_shortdesc     (DoapDocument        *self);
+const gchar   *doap_document_get_description   (DoapDocument        *self);
+const gchar   *doap_document_get_bug_database  (DoapDocument        *self);
+const gchar   *doap_document_get_download_page (DoapDocument        *self);
+const gchar   *doap_document_get_homepage      (DoapDocument        *self);
+const gchar   *doap_document_get_category      (DoapDocument        *self);
+gchar        **doap_document_get_languages     (DoapDocument        *self);
+GList         *doap_document_get_maintainers   (DoapDocument        *self);
+
+G_END_DECLS
+
+#endif /* DOAP_DOCUMENT_H */
diff --git a/contrib/doap/ide-doap-person.c b/contrib/doap/doap-person.c
similarity index 57%
rename from contrib/doap/ide-doap-person.c
rename to contrib/doap/doap-person.c
index ca1d84d..fee25e2 100644
--- a/contrib/doap/ide-doap-person.c
+++ b/contrib/doap/doap-person.c
@@ -1,4 +1,4 @@
-/* ide-doap-person.c
+/* doap-person.c
  *
  * Copyright (C) 2015 Christian Hergert <christian hergert me>
  *
@@ -18,9 +18,9 @@
 
 #include <glib/gi18n.h>
 
-#include "ide-doap-person.h"
+#include "doap-person.h"
 
-struct _IdeDoapPerson
+struct _DoapPerson
 {
   GObject parent_instance;
 
@@ -28,7 +28,7 @@ struct _IdeDoapPerson
   gchar *name;
 };
 
-G_DEFINE_TYPE (IdeDoapPerson, ide_doap_person, G_TYPE_OBJECT)
+G_DEFINE_TYPE (DoapPerson, doap_person, G_TYPE_OBJECT)
 
 enum {
   PROP_0,
@@ -39,25 +39,25 @@ enum {
 
 static GParamSpec *properties [LAST_PROP];
 
-IdeDoapPerson *
-ide_doap_person_new (void)
+DoapPerson *
+doap_person_new (void)
 {
-  return g_object_new (IDE_TYPE_DOAP_PERSON, NULL);
+  return g_object_new (DOAP_TYPE_PERSON, NULL);
 }
 
 const gchar *
-ide_doap_person_get_name (IdeDoapPerson *self)
+doap_person_get_name (DoapPerson *self)
 {
-  g_return_val_if_fail (IDE_IS_DOAP_PERSON (self), NULL);
+  g_return_val_if_fail (DOAP_IS_PERSON (self), NULL);
 
   return self->name;
 }
 
 void
-ide_doap_person_set_name (IdeDoapPerson *self,
-                          const gchar   *name)
+doap_person_set_name (DoapPerson  *self,
+                      const gchar *name)
 {
-  g_return_if_fail (IDE_IS_DOAP_PERSON (self));
+  g_return_if_fail (DOAP_IS_PERSON (self));
 
   if (g_strcmp0 (self->name, name) != 0)
     {
@@ -68,18 +68,18 @@ ide_doap_person_set_name (IdeDoapPerson *self,
 }
 
 const gchar *
-ide_doap_person_get_email (IdeDoapPerson *self)
+doap_person_get_email (DoapPerson *self)
 {
-  g_return_val_if_fail (IDE_IS_DOAP_PERSON (self), NULL);
+  g_return_val_if_fail (DOAP_IS_PERSON (self), NULL);
 
   return self->email;
 }
 
 void
-ide_doap_person_set_email (IdeDoapPerson *self,
-                           const gchar   *email)
+doap_person_set_email (DoapPerson  *self,
+                       const gchar *email)
 {
-  g_return_if_fail (IDE_IS_DOAP_PERSON (self));
+  g_return_if_fail (DOAP_IS_PERSON (self));
 
   if (g_strcmp0 (self->email, email) != 0)
     {
@@ -90,32 +90,32 @@ ide_doap_person_set_email (IdeDoapPerson *self,
 }
 
 static void
-ide_doap_person_finalize (GObject *object)
+doap_person_finalize (GObject *object)
 {
-  IdeDoapPerson *self = (IdeDoapPerson *)object;
+  DoapPerson *self = (DoapPerson *)object;
 
   g_clear_pointer (&self->email, g_free);
   g_clear_pointer (&self->name, g_free);
 
-  G_OBJECT_CLASS (ide_doap_person_parent_class)->finalize (object);
+  G_OBJECT_CLASS (doap_person_parent_class)->finalize (object);
 }
 
 static void
-ide_doap_person_get_property (GObject    *object,
-                              guint       prop_id,
-                              GValue     *value,
-                              GParamSpec *pspec)
+doap_person_get_property (GObject    *object,
+                          guint       prop_id,
+                          GValue     *value,
+                          GParamSpec *pspec)
 {
-  IdeDoapPerson *self = IDE_DOAP_PERSON (object);
+  DoapPerson *self = DOAP_PERSON (object);
 
   switch (prop_id)
     {
     case PROP_EMAIL:
-      g_value_set_string (value, ide_doap_person_get_email (self));
+      g_value_set_string (value, doap_person_get_email (self));
       break;
 
     case PROP_NAME:
-      g_value_set_string (value, ide_doap_person_get_name (self));
+      g_value_set_string (value, doap_person_get_name (self));
       break;
 
     default:
@@ -124,21 +124,21 @@ ide_doap_person_get_property (GObject    *object,
 }
 
 static void
-ide_doap_person_set_property (GObject      *object,
-                              guint         prop_id,
-                              const GValue *value,
-                              GParamSpec   *pspec)
+doap_person_set_property (GObject      *object,
+                          guint         prop_id,
+                          const GValue *value,
+                          GParamSpec   *pspec)
 {
-  IdeDoapPerson *self = IDE_DOAP_PERSON (object);
+  DoapPerson *self = DOAP_PERSON (object);
 
   switch (prop_id)
     {
     case PROP_EMAIL:
-      ide_doap_person_set_email (self, g_value_get_string (value));
+      doap_person_set_email (self, g_value_get_string (value));
       break;
 
     case PROP_NAME:
-      ide_doap_person_set_name (self, g_value_get_string (value));
+      doap_person_set_name (self, g_value_get_string (value));
       break;
 
     default:
@@ -147,13 +147,13 @@ ide_doap_person_set_property (GObject      *object,
 }
 
 static void
-ide_doap_person_class_init (IdeDoapPersonClass *klass)
+doap_person_class_init (DoapPersonClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-  object_class->finalize = ide_doap_person_finalize;
-  object_class->get_property = ide_doap_person_get_property;
-  object_class->set_property = ide_doap_person_set_property;
+  object_class->finalize = doap_person_finalize;
+  object_class->get_property = doap_person_get_property;
+  object_class->set_property = doap_person_set_property;
 
   properties [PROP_EMAIL] =
     g_param_spec_string ("email",
@@ -173,6 +173,6 @@ ide_doap_person_class_init (IdeDoapPersonClass *klass)
 }
 
 static void
-ide_doap_person_init (IdeDoapPerson *self)
+doap_person_init (DoapPerson *self)
 {
 }
diff --git a/contrib/doap/ide-doap-person.h b/contrib/doap/doap-person.h
similarity index 54%
rename from contrib/doap/ide-doap-person.h
rename to contrib/doap/doap-person.h
index c5f6439..634dcf5 100644
--- a/contrib/doap/ide-doap-person.h
+++ b/contrib/doap/doap-person.h
@@ -16,25 +16,25 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef IDE_DOAP_PERSON_H
-#define IDE_DOAP_PERSON_H
+#ifndef DOAP_PERSON_H
+#define DOAP_PERSON_H
 
 #include <glib-object.h>
 
 G_BEGIN_DECLS
 
-#define IDE_TYPE_DOAP_PERSON (ide_doap_person_get_type())
+#define DOAP_TYPE_PERSON (doap_person_get_type())
 
-G_DECLARE_FINAL_TYPE (IdeDoapPerson, ide_doap_person, IDE, DOAP_PERSON, GObject)
+G_DECLARE_FINAL_TYPE (DoapPerson, doap_person, DOAP, PERSON, GObject)
 
-IdeDoapPerson *ide_doap_person_new       (void);
-const gchar   *ide_doap_person_get_name  (IdeDoapPerson *self);
-void           ide_doap_person_set_name  (IdeDoapPerson *self,
-                                          const gchar   *name);
-const gchar   *ide_doap_person_get_email (IdeDoapPerson *self);
-void           ide_doap_person_set_email (IdeDoapPerson *self,
-                                          const gchar   *email);
+DoapPerson    *doap_person_new       (void);
+const gchar   *doap_person_get_name  (DoapPerson  *self);
+void           doap_person_set_name  (DoapPerson  *self,
+                                      const gchar *name);
+const gchar   *doap_person_get_email (DoapPerson  *self);
+void           doap_person_set_email (DoapPerson  *self,
+                                      const gchar *email);
 
 G_END_DECLS
 
-#endif /* IDE_DOAP_PERSON_H */
+#endif /* DOAP_PERSON_H */
diff --git a/libide/greeter/ide-greeter-project-row.c b/libide/greeter/ide-greeter-project-row.c
index b90151b..ee15861 100644
--- a/libide/greeter/ide-greeter-project-row.c
+++ b/libide/greeter/ide-greeter-project-row.c
@@ -77,7 +77,7 @@ ide_greeter_project_row_create_search_text (IdeGreeterProjectRow *self,
                                             IdeProjectInfo       *project_info)
 {
   const gchar *tmp;
-  IdeDoap *doap;
+  DoapDocument *doap;
   GString *str;
 
   g_assert (IDE_IS_GREETER_PROJECT_ROW (self));
@@ -104,7 +104,7 @@ ide_greeter_project_row_create_search_text (IdeGreeterProjectRow *self,
 
   if (doap != NULL)
     {
-      if ((tmp = ide_doap_get_description (doap)))
+      if ((tmp = doap_document_get_description (doap)))
         {
           g_string_append (str, tmp);
           g_string_append (str, " ");
diff --git a/libide/ide-context.c b/libide/ide-context.c
index 97d5de9..f78f407 100644
--- a/libide/ide-context.c
+++ b/libide/ide-context.c
@@ -46,7 +46,7 @@
 #include "ide-vcs.h"
 #include "ide-recent-projects.h"
 
-#include "ide-doap.h"
+#include "doap-document.h"
 
 #define RESTORE_FILES_MAX_FILES 20
 
@@ -58,7 +58,7 @@ struct _IdeContext
   IdeBufferManager         *buffer_manager;
   IdeBuildSystem           *build_system;
   IdeDeviceManager         *device_manager;
-  IdeDoap                  *doap;
+  DoapDocument             *doap;
   GtkRecentManager         *recent_manager;
   IdeScriptManager         *script_manager;
   IdeSearchEngine          *search_engine;
@@ -845,16 +845,16 @@ ide_context_load_doap_worker (GTask        *task,
           if (!ide_str_empty0 (filename) && g_str_has_suffix (filename, ".doap"))
             {
               g_autoptr(GFile) file = NULL;
-              g_autoptr(IdeDoap) doap = NULL;
+              g_autoptr(DoapDocument) doap = NULL;
 
               file = g_file_get_child (directory, filename);
-              doap = ide_doap_new ();
+              doap = doap_document_new ();
 
-              if (ide_doap_load_from_file (doap, file, cancellable, NULL))
+              if (doap_document_load_from_file (doap, file, cancellable, NULL))
                 {
                   const gchar *doap_name;
 
-                  if ((doap_name = ide_doap_get_name (doap)))
+                  if ((doap_name = doap_document_get_name (doap)))
                     {
                       g_free (name);
                       name = g_strdup (doap_name);
@@ -1277,7 +1277,7 @@ ide_context_init_add_recent (gpointer             source_object,
 
   /* attach project description to recent info */
   if (self->doap != NULL)
-    g_bookmark_file_set_description (projects_file, uri, ide_doap_get_shortdesc (self->doap));
+    g_bookmark_file_set_description (projects_file, uri, doap_document_get_shortdesc (self->doap));
 
   /* attach discovered languages to recent info */
   groups = g_ptr_array_new_with_free_func (g_free);
@@ -1287,7 +1287,7 @@ ide_context_init_add_recent (gpointer             source_object,
       gchar **languages;
       gsize i;
 
-      if ((languages = ide_doap_get_languages (self->doap)))
+      if ((languages = doap_document_get_languages (self->doap)))
         {
           for (i = 0; languages [i]; i++)
             g_ptr_array_add (groups,
diff --git a/libide/ide-enums.c.in b/libide/ide-enums.c.in
index 4b782b4..839e24f 100644
--- a/libide/ide-enums.c.in
+++ b/libide/ide-enums.c.in
@@ -8,13 +8,13 @@
 #include "ide-buffer.h"
 #include "ide-build-result.h"
 #include "ide-diagnostic.h"
-#include "ide-doap.h"
 #include "ide-highlighter.h"
 #include "ide-indent-style.h"
 #include "ide-layout-stack-split.h"
 #include "ide-source-view.h"
 #include "ide-symbol.h"
 #include "ide-thread-pool.h"
+#include "doap-document.h"
 
 /*** END file-header ***/
 
diff --git a/libide/ide-project-info.c b/libide/ide-project-info.c
index 05b3ef3..b23ade4 100644
--- a/libide/ide-project-info.c
+++ b/libide/ide-project-info.c
@@ -39,19 +39,19 @@
 
 struct _IdeProjectInfo
 {
-  GObject     parent_instance;
+  GObject       parent_instance;
 
-  IdeDoap    *doap;
-  GDateTime  *last_modified_at;
-  GFile      *directory;
-  GFile      *file;
-  gchar      *name;
-  gchar      *description;
-  gchar     **languages;
+  DoapDocument *doap;
+  GDateTime    *last_modified_at;
+  GFile        *directory;
+  GFile        *file;
+  gchar        *name;
+  gchar        *description;
+  gchar       **languages;
 
-  gint        priority;
+  gint          priority;
 
-  guint       is_recent : 1;
+  guint         is_recent : 1;
 };
 
 G_DEFINE_TYPE (IdeProjectInfo, ide_project_info, G_TYPE_OBJECT)
@@ -78,7 +78,7 @@ static GParamSpec *properties [LAST_PROP];
  *
  * Returns: (nullable) (transfer none): An #IdeDoap or %NULL.
  */
-IdeDoap *
+DoapDocument *
 ide_project_info_get_doap (IdeProjectInfo *self)
 {
   g_return_val_if_fail (IDE_IS_PROJECT_INFO (self), NULL);
@@ -88,10 +88,10 @@ ide_project_info_get_doap (IdeProjectInfo *self)
 
 void
 ide_project_info_set_doap (IdeProjectInfo *self,
-                           IdeDoap        *doap)
+                           DoapDocument   *doap)
 {
   g_return_if_fail (IDE_IS_PROJECT_INFO (self));
-  g_return_if_fail (!doap || IDE_IS_DOAP (doap));
+  g_return_if_fail (!doap || DOAP_IS_DOCUMENT (doap));
 
   if (g_set_object (&self->doap, doap))
     g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_DOAP]);
@@ -443,7 +443,7 @@ ide_project_info_class_init (IdeProjectInfoClass *klass)
     g_param_spec_object ("doap",
                          "DOAP",
                          "A DOAP describing the project.",
-                         IDE_TYPE_DOAP,
+                         DOAP_TYPE_DOCUMENT,
                          (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
   properties [PROP_FILE] =
diff --git a/libide/ide-project-info.h b/libide/ide-project-info.h
index 0c0b41b..9f161ed 100644
--- a/libide/ide-project-info.h
+++ b/libide/ide-project-info.h
@@ -21,7 +21,7 @@
 
 #include <gio/gio.h>
 
-#include "ide-doap.h"
+#include "doap-document.h"
 
 G_BEGIN_DECLS
 
@@ -32,7 +32,7 @@ G_DECLARE_FINAL_TYPE (IdeProjectInfo, ide_project_info, IDE, PROJECT_INFO, GObje
 gint         ide_project_info_compare              (IdeProjectInfo  *info1,
                                                     IdeProjectInfo  *info2);
 GFile        *ide_project_info_get_file             (IdeProjectInfo  *self);
-IdeDoap      *ide_project_info_get_doap             (IdeProjectInfo  *self);
+DoapDocument *ide_project_info_get_doap             (IdeProjectInfo  *self);
 const gchar  *ide_project_info_get_description      (IdeProjectInfo  *self);
 GFile        *ide_project_info_get_directory        (IdeProjectInfo  *self);
 gboolean      ide_project_info_get_is_recent        (IdeProjectInfo  *self);
diff --git a/plugins/autotools/ide-autotools-project-miner.c b/plugins/autotools/ide-autotools-project-miner.c
index 311e3e7..ad09efd 100644
--- a/plugins/autotools/ide-autotools-project-miner.c
+++ b/plugins/autotools/ide-autotools-project-miner.c
@@ -44,7 +44,7 @@ enum {
 
 static GParamSpec *properties [LAST_PROP];
 
-static IdeDoap *
+static DoapDocument *
 ide_autotools_project_miner_find_doap (IdeAutotoolsProjectMiner *self,
                                        GCancellable             *cancellable,
                                        GFile                    *directory)
@@ -75,9 +75,9 @@ ide_autotools_project_miner_find_doap (IdeAutotoolsProjectMiner *self,
       if (name != NULL && g_str_has_suffix (name, ".doap"))
         {
           g_autoptr(GFile) doap_file = g_file_get_child (directory, name);
-          IdeDoap *doap = ide_doap_new ();
+          DoapDocument *doap = doap_document_new ();
 
-          if (!ide_doap_load_from_file (doap, doap_file, cancellable, NULL))
+          if (!doap_document_load_from_file (doap, doap_file, cancellable, NULL))
             {
               g_object_unref (doap);
               continue;
@@ -103,7 +103,7 @@ ide_autotools_project_miner_discovered (IdeAutotoolsProjectMiner *self,
   g_autoptr(GFileInfo) index_info = NULL;
   g_autoptr(IdeProjectInfo) project_info = NULL;
   g_autoptr(GDateTime) last_modified_at = NULL;
-  g_autoptr(IdeDoap) doap = NULL;
+  g_autoptr(DoapDocument) doap = NULL;
   const gchar *filename;
   const gchar *shortdesc = NULL;
   gchar **languages = NULL;
@@ -143,7 +143,7 @@ ide_autotools_project_miner_discovered (IdeAutotoolsProjectMiner *self,
 
   if (doap != NULL)
     {
-      const gchar *doap_name = ide_doap_get_name (doap);
+      const gchar *doap_name = doap_document_get_name (doap);
 
       if (!ide_str_empty0 (doap_name))
         {
@@ -151,8 +151,8 @@ ide_autotools_project_miner_discovered (IdeAutotoolsProjectMiner *self,
           name = g_strdup (doap_name);
         }
 
-      shortdesc = ide_doap_get_shortdesc (doap);
-      languages = ide_doap_get_languages (doap);
+      shortdesc = doap_document_get_shortdesc (doap);
+      languages = doap_document_get_languages (doap);
     }
 
   project_info = g_object_new (IDE_TYPE_PROJECT_INFO,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]