diff options
-rw-r--r-- | gio/src/appinfo.ccg | 15 | ||||
-rw-r--r-- | gio/src/appinfo.hg | 2 |
2 files changed, 7 insertions, 10 deletions
diff --git a/gio/src/appinfo.ccg b/gio/src/appinfo.ccg index c0caaca1..b75af725 100644 --- a/gio/src/appinfo.ccg +++ b/gio/src/appinfo.ccg @@ -19,19 +19,17 @@ #include <giomm/slot_async.h> #include <gio/gio.h> -namespace Glib +namespace { -namespace Container_Helpers -{ -/* Specialization for pointers to the GAppInfo interface. +/* Special type traits for pointers to the GAppInfo interface. * The partial specialization in glibmm/glib/glibmm/containerhandle_shared.h * is not well suited for interfaces which do not already have a wrapper. * Its to_cpp_type() calls Glib::wrap_auto() instead id Glib::wrap_auto_interface(). - * This specialization is used by Glib::ListHandler<>::list_to_vector() in + * These type traits are used by Glib::ListHandler<>::list_to_vector() in * Gio::AppInfo::get_all() and Gio::AppInfo::get_all_for_type(). + * https://gitlab.gnome.org/GNOME/glibmm/-/issues/94 */ -template <> -struct TypeTraits<Glib::RefPtr<Gio::AppInfo>> +struct TypeTraits_AppInfo { using T = Gio::AppInfo; using CppType = Glib::RefPtr<T>; @@ -48,8 +46,7 @@ struct TypeTraits<Glib::RefPtr<Gio::AppInfo>> g_object_unref(ptr); } }; -} // namespace Container_Helpers -} // namespace Glib +} // anonymous namespace namespace Gio { diff --git a/gio/src/appinfo.hg b/gio/src/appinfo.hg index ed7a6dc0..06d8d515 100644 --- a/gio/src/appinfo.hg +++ b/gio/src/appinfo.hg @@ -220,7 +220,7 @@ public: _WRAP_METHOD(bool set_as_last_used_for_type(const std::string& content_type), g_app_info_set_as_last_used_for_type, errthrow) -#m4 _CONVERSION(`GList*',`std::vector<Glib::RefPtr<AppInfo>>',`Glib::ListHandler<Glib::RefPtr<AppInfo>>::list_to_vector($3, Glib::OWNERSHIP_DEEP)') +#m4 _CONVERSION(`GList*',`std::vector<Glib::RefPtr<AppInfo>>',`Glib::ListHandler<Glib::RefPtr<AppInfo>, TypeTraits_AppInfo>::list_to_vector($3, Glib::OWNERSHIP_DEEP)') _WRAP_METHOD(static std::vector<Glib::RefPtr<AppInfo>> get_all(), g_app_info_get_all) _WRAP_METHOD(static std::vector<Glib::RefPtr<AppInfo>> get_all_for_type(const std::string& content_type), g_app_info_get_all_for_type) |