diff options
author | Sebastien Estienne <sebastien.estienne@gmail.com> | 2006-01-21 00:13:01 +0000 |
---|---|---|
committer | Sebastien Estienne <sebastien.estienne@gmail.com> | 2006-01-21 00:13:01 +0000 |
commit | 9dfa1e044da46bb6672018583ccb4fb77d75b004 (patch) | |
tree | 67e5f7568b05c271e644b2c1c1dd0a670fdbdb3a /src | |
parent | 2eaed15aa9c5a335d0e4b4f21ce0d5a44817ab26 (diff) |
* use hostname instead of ip if nss-mdns is available
git-svn-id: file:///home/lennart/svn/public/service-discovery-applet/trunk@86 3be567f1-68ff-0310-b24a-ad7cc433fd2f
Diffstat (limited to 'src')
-rwxr-xr-x | src/service-discovery-applet.in | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/service-discovery-applet.in b/src/service-discovery-applet.in index 0ff8691..295ce5d 100755 --- a/src/service-discovery-applet.in +++ b/src/service-discovery-applet.in @@ -254,6 +254,10 @@ class ServiceDiscoveryApplet(gnomeapplet.Applet): self.server = dbus.Interface(self.system_bus.get_object(avahi.DBUS_NAME, avahi.DBUS_PATH_SERVER), avahi.DBUS_INTERFACE_SERVER) + try: + self.use_host_names = self.server.IsNSSSupportAvailable() + except: + self.use_host_names = False self.sdaNotifications = Notifications(self) @@ -286,7 +290,7 @@ class ServiceDiscoveryApplet(gnomeapplet.Applet): txts = avahi.txt_array_to_string_array(txt) txts = sdapplet.pluginutils.pair_to_dict(txts) - self.plugin.plugins[type][0].connect(name, type, host, address, port, txts) + self.plugin.plugins[type][0].connect(self.use_host_names, name, type, host, address, port, txts) def print_error(self, err): # FIXME we should use notifications @@ -317,7 +321,7 @@ class ServiceDiscoveryApplet(gnomeapplet.Applet): return except dbus.dbus_bindings.DBusException: pass - + # if we found a service, remove "No service found" if self.zc_types == {}: for menuitem in self.service_menu.get_children(): |