]> git.meshlink.io Git - catta/blobdiff - avahi-gobject/ga-entry-group.c
man: more spelling fixes
[catta] / avahi-gobject / ga-entry-group.c
index 9b79e8366c545aced37a9827e8eec2cc815b2593..101acbffbea5bb31047dd5b581f81553e24c5978 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * ga-entry-group.c - Source for GaEntryGroup
- * Copyright (C) 2005 Collabora Ltd.
+ * Copyright (C) 2006-2007 Collabora Ltd.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -27,7 +27,7 @@
 #include <string.h>
 #include <avahi-common/malloc.h>
 
-#include "ga-errors.h"
+#include "ga-error.h"
 #include "ga-entry-group.h"
 #include "ga-entry-group-enumtypes.h"
 
@@ -185,7 +185,7 @@ static void _free_service(gpointer data) {
 
 static GQuark detail_for_state(AvahiEntryGroupState state) {
     static struct {
-        AvahiClientState state;
+        AvahiEntryGroupState state;
         const gchar *name;
         GQuark quark;
     } states[] = {
@@ -386,7 +386,7 @@ GaEntryGroupService *ga_entry_group_add_service_full_strlist(GaEntryGroup *
                                                domain, host, port, txt);
     if (ret) {
         if (error != NULL) {
-            *error = g_error_new(GA_ERRORS, ret,
+            *error = g_error_new(GA_ERROR, ret,
                                  "Adding service to group failed: %s",
                                  avahi_strerror(ret));
         }
@@ -492,7 +492,7 @@ gboolean ga_entry_group_add_record_full(GaEntryGroup * group,
                                        size);
     if (ret) {
         if (error != NULL) {
-            *error = g_error_new(GA_ERRORS, ret,
+            *error = g_error_new(GA_ERROR, ret,
                                  "Setting raw record failed: %s",
                                  avahi_strerror(ret));
         }
@@ -519,7 +519,7 @@ gboolean ga_entry_group_service_thaw(GaEntryGroupService * service, GError ** er
              service->name, service->type, service->domain, txt);
     if (ret) {
         if (error != NULL) {
-            *error = g_error_new(GA_ERRORS, ret,
+            *error = g_error_new(GA_ERROR, ret,
                                  "Updating txt record failed: %s",
                                  avahi_strerror(ret));
         }
@@ -556,8 +556,12 @@ gboolean ga_entry_group_service_set_arbitrary(GaEntryGroupService * service,
 gboolean ga_entry_group_service_remove_key(GaEntryGroupService * service,
                                   const gchar * key, GError ** error) {
     GaEntryGroupServicePrivate *priv = (GaEntryGroupServicePrivate *) service;
+    GaEntryGroupServiceEntry entry;
 
-    g_hash_table_remove(priv->entries, key);
+    entry.value = (void*) key;
+    entry.size = strlen(key);
+
+    g_hash_table_remove(priv->entries, &entry);
 
     if (!priv->frozen)
         return ga_entry_group_service_thaw(service, error);
@@ -570,6 +574,7 @@ gboolean ga_entry_group_attach(GaEntryGroup * group,
                       GaClient * client, GError ** error) {
     GaEntryGroupPrivate *priv = GA_ENTRY_GROUP_GET_PRIVATE(group);
 
+    g_return_val_if_fail(client->avahi_client, FALSE);
     g_assert(priv->client == NULL || priv->client == client);
     g_assert(priv->group == NULL);
 
@@ -581,7 +586,7 @@ gboolean ga_entry_group_attach(GaEntryGroup * group,
     if (priv->group == NULL) {
         if (error != NULL) {
             int aerrno = avahi_client_errno(client->avahi_client);
-            *error = g_error_new(GA_ERRORS, aerrno,
+            *error = g_error_new(GA_ERROR, aerrno,
                                  "Attaching group failed: %s",
                                  avahi_strerror(aerrno));
         }
@@ -596,7 +601,7 @@ gboolean ga_entry_group_commit(GaEntryGroup * group, GError ** error) {
     ret = avahi_entry_group_commit(priv->group);
     if (ret) {
         if (error != NULL) {
-            *error = g_error_new(GA_ERRORS, ret,
+            *error = g_error_new(GA_ERROR, ret,
                                  "Committing group failed: %s",
                                  avahi_strerror(ret));
         }
@@ -611,7 +616,7 @@ gboolean ga_entry_group_reset(GaEntryGroup * group, GError ** error) {
     ret = avahi_entry_group_reset(priv->group);
     if (ret) {
         if (error != NULL) {
-            *error = g_error_new(GA_ERRORS, ret,
+            *error = g_error_new(GA_ERROR, ret,
                                  "Resetting group failed: %s",
                                  avahi_strerror(ret));
         }