ekiga r6928 - in trunk: . lib/engine/components/avahi-publisher
- From: jpuydt svn gnome org
- To: svn-commits-list gnome org
- Subject: ekiga r6928 - in trunk: . lib/engine/components/avahi-publisher
- Date: Thu, 11 Sep 2008 13:34:34 +0000 (UTC)
Author: jpuydt
Date: Thu Sep 11 13:34:34 2008
New Revision: 6928
URL: http://svn.gnome.org/viewvc/ekiga?rev=6928&view=rev
Log:
Made the avahi publisher cope with name changes correctly, fixing #551661.
Modified:
trunk/ChangeLog
trunk/lib/engine/components/avahi-publisher/avahi-publisher.cpp
trunk/lib/engine/components/avahi-publisher/avahi-publisher.h
Modified: trunk/lib/engine/components/avahi-publisher/avahi-publisher.cpp
==============================================================================
--- trunk/lib/engine/components/avahi-publisher/avahi-publisher.cpp (original)
+++ trunk/lib/engine/components/avahi-publisher/avahi-publisher.cpp Thu Sep 11 13:34:34 2008
@@ -71,7 +71,10 @@
core(core_), details(details_), call_core(call_core_),
client(NULL), group(NULL)
{
- name = avahi_strdup (details.get_display_name ().c_str ());
+ display_name = details.get_display_name ();
+ details.updated.connect (sigc::mem_fun (this,
+ &Avahi::PresencePublisher::on_details_updated));
+ name = avahi_strdup (display_name.c_str ());
glib_poll = avahi_glib_poll_new (NULL, G_PRIORITY_DEFAULT);
create_client ();
}
@@ -287,3 +290,17 @@
return result;
}
+
+void
+Avahi::PresencePublisher::on_details_updated ()
+{
+ if (display_name != details.get_display_name ()) {
+
+ display_name = details.get_display_name ();
+ remove_services ();
+ avahi_free (name);
+ name = avahi_strdup (display_name.c_str ());
+ avahi_entry_group_new (client,
+ (AvahiEntryGroupCallback)entry_group_cb, this);
+ }
+}
Modified: trunk/lib/engine/components/avahi-publisher/avahi-publisher.h
==============================================================================
--- trunk/lib/engine/components/avahi-publisher/avahi-publisher.h (original)
+++ trunk/lib/engine/components/avahi-publisher/avahi-publisher.h Thu Sep 11 13:34:34 2008
@@ -95,9 +95,11 @@
void add_services ();
void remove_services ();
AvahiEntryGroup* group;
+ std::string display_name;
gchar* name;
- AvahiStringList* prepare_txt_record ();;
+ AvahiStringList* prepare_txt_record ();
+ void on_details_updated ();
};
};
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]