From 01ec4ffba1a2013dee932d0790dd76f9ab393ef7 Mon Sep 17 00:00:00 2001 From: Patrick Storz Date: Thu, 26 Sep 2019 23:03:28 +0200 Subject: Extensions: Fix filename encoding issues in error logging (std::ostream is not properly portable unfortunately) --- src/extension/dependency.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'src/extension/dependency.cpp') diff --git a/src/extension/dependency.cpp b/src/extension/dependency.cpp index 2a04a030a..0f45d02b5 100644 --- a/src/extension/dependency.cpp +++ b/src/extension/dependency.cpp @@ -244,21 +244,19 @@ const gchar* Dependency::get_name() /** \brief Print out a dependency to a string. */ -std::ostream & -operator<< (std::ostream &out_file, const Dependency & in_dep) +Glib::ustring Dependency::info_string() { - out_file << _("Dependency:") << '\n'; - out_file << _(" type: ") << _(in_dep._type_str[in_dep._type]) << '\n'; - out_file << _(" location: ") << _(in_dep._location_str[in_dep._location]) << '\n'; - out_file << _(" string: ") << in_dep._string << '\n'; - - if (in_dep._description != nullptr) { - out_file << _(" description: ") << _(in_dep._description) << '\n'; + Glib::ustring str = Glib::ustring::compose("%1:\n\t%2: %3\n\t%4: %5\n\t%6: %7", + _("Dependency"), + _("type"), _(_type_str[_type]), + _("location"), _(_location_str[_location]), + _("string"), _string); + + if (_description) { + str += Glib::ustring::compose("\n\t%1: %2\n", _(" description: "), _(_description)); } - out_file << std::flush; - - return out_file; + return str; } } } /* namespace Inkscape, Extension */ -- cgit v1.2.3