From 9fed4ad6fa69cea5879e54231985bf911d456daf Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sat, 3 Apr 2010 02:28:11 -0700 Subject: [PATCH] Disconnect Glyphs UI while updating the model. 5X+ performance boost on CJK fonts. Partially fixes bug #553911. --- src/ui/dialog/glyphs.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ui/dialog/glyphs.cpp b/src/ui/dialog/glyphs.cpp index 8677bcda2..133cf01ea 100644 --- a/src/ui/dialog/glyphs.cpp +++ b/src/ui/dialog/glyphs.cpp @@ -377,6 +377,10 @@ void GlyphsPanel::rebuild() } #endif // GLIB_CHECK_VERSION(2,14,0) + // Disconnect the model while we update it. Simple work-around for 5x+ performance boost. + Glib::RefPtr tmp = Gtk::ListStore::create(*getColumns()); + iconView->set_model(tmp); + std::vector present; for (gunichar ch = 1; ch < 65535; ch++) { int glyphId = font->MapUnicodeChar(ch); @@ -401,6 +405,9 @@ void GlyphsPanel::rebuild() (*row)[columns->code] = *it; (*row)[columns->name] = tmp; } + + // Reconnect the model once it has been updated: + iconView->set_model(store); } } -- 2.30.2