From b109ebf3802f44f7ba00ea3018ab31de9aa3255d Mon Sep 17 00:00:00 2001 From: eidheim Date: Wed, 1 Jul 2015 12:36:20 +0200 Subject: [PATCH] Fixed GLib-GObject-WARNING messages for older GTK+ versions without underline-rgba property. --- juci/source.cc | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/juci/source.cc b/juci/source.cc index 13484d0..230a574 100644 --- a/juci/source.cc +++ b/juci/source.cc @@ -360,13 +360,17 @@ void Source::ClangView::update_diagnostics() { diagnostic_tooltips.add(diagnostic.severity_spelling+": "+diagnostic.spelling, get_source_buffer()->create_mark(start), get_source_buffer()->create_mark(end)); auto tag=buffer->create_tag(); tag->property_underline()=Pango::Underline::UNDERLINE_ERROR; - if(diagnostic.severity<=CXDiagnostic_Warning) { - //TODO: get color from config.json - tag->set_property("underline-rgba", Gdk::RGBA("orange")); - } - else { - //TODO: get color from config.json - tag->set_property("underline-rgba", Gdk::RGBA("red")); + auto tag_class=G_OBJECT_GET_CLASS(tag->gobj()); //For older GTK+ 3 versions: + auto param_spec=g_object_class_find_property(tag_class, "underline-rgba"); + if(param_spec!=NULL) { + if(diagnostic.severity<=CXDiagnostic_Warning) { + //TODO: get color from config.json + tag->set_property("underline-rgba", Gdk::RGBA("orange")); + } + else { + //TODO: get color from config.json + tag->set_property("underline-rgba", Gdk::RGBA("red")); + } } buffer->apply_tag(tag, start, end); }