summaryrefslogtreecommitdiff
path: root/libs/gtkmm2ext/gtk_ui.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-02-28 07:26:13 +0100
committerRobin Gareus <robin@gareus.org>2020-02-28 07:26:13 +0100
commitfa0a7d67391f7c968b31daf628bb3581bcba67d7 (patch)
treefa97c7780ee25c5ac6e6994a1480ba8c39ba2a3b /libs/gtkmm2ext/gtk_ui.cc
parenta4851954536bb7706fbf25fcf44242cd5454b5fd (diff)
Allow to limit error dump
This is in preparation of displaying verbose errors to the user.
Diffstat (limited to 'libs/gtkmm2ext/gtk_ui.cc')
-rw-r--r--libs/gtkmm2ext/gtk_ui.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/libs/gtkmm2ext/gtk_ui.cc b/libs/gtkmm2ext/gtk_ui.cc
index bbef7a0825..e6212a35bd 100644
--- a/libs/gtkmm2ext/gtk_ui.cc
+++ b/libs/gtkmm2ext/gtk_ui.cc
@@ -511,12 +511,18 @@ UI::do_request (UIRequest* req)
======================================================================*/
void
-UI::dump_errors (std::ostream& ostr)
+UI::dump_errors (std::ostream& ostr, size_t limit)
{
Glib::Threads::Mutex::Lock lm (error_lock);
ostr << endl << X_("Errors/Messages:") << endl;
for (list<string>::const_iterator i = error_stack.begin(); i != error_stack.end(); ++i) {
ostr << *i << endl;
+ if (limit > 0) {
+ if (--limit == 0) {
+ ostr << "..." << endl;
+ break;
+ }
+ }
}
ostr << endl;
}