diff options
author | Murray Cumming <murrayc@murrayc.com> | 2017-03-17 12:43:13 +0100 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2017-03-20 09:50:53 +0100 |
commit | 79b20cd2d2c83ac52d8a2c385b2674fa3c514d99 (patch) | |
tree | 7c8d5f4143d87efbabf0e64c146f3399b0e35aae /examples | |
parent | bc8d88079391a8f4f336ea16585b8ed1bcd46358 (diff) | |
download | glibmm-79b20cd2d2c83ac52d8a2c385b2674fa3c514d99.tar.gz |
Gio::Resolver: Use std::vector instead of Glib::ListHandle<>.
Using Glib::ListHandler<>::list_to_array() and
Glib::ListHandler<>::list_to_vector() instead, and only in the
implementation instead of in the API.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/network/resolver.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/examples/network/resolver.cc b/examples/network/resolver.cc index 97dc4d71..106f60ac 100644 --- a/examples/network/resolver.cc +++ b/examples/network/resolver.cc @@ -89,7 +89,7 @@ print_resolved_name(const Glib::ustring& phys, const Glib::ustring& name) static void print_resolved_addresses( - const Glib::ustring& name, const std::list<Glib::RefPtr<Gio::InetAddress>>& addresses) + const Glib::ustring& name, const std::vector<Glib::RefPtr<Gio::InetAddress>>& addresses) { std::lock_guard<std::mutex> lock_guard(response_mutex); std::cout << Glib::ustring::compose("Name: %1\n", name); @@ -103,7 +103,7 @@ print_resolved_addresses( } static void -print_resolved_service(const Glib::ustring& service, const std::list<Gio::SrvTarget>& targets) +print_resolved_service(const Glib::ustring& service, const std::vector<Gio::SrvTarget>& targets) { std::lock_guard<std::mutex> lock_guard(response_mutex); std::cout << Glib::ustring::compose("Service: %1\n", service); @@ -174,11 +174,9 @@ lookup_one_sync(const Glib::ustring& arg) } else { - std::list<Glib::RefPtr<Gio::InetAddress>> addresses; - try { - addresses = resolver->lookup_by_name(arg, cancellable); + const auto addresses = resolver->lookup_by_name(arg, cancellable); print_resolved_addresses(arg, addresses); } catch (const Gio::ResolverError& err) |