From 311b2f499670dfc26782357a4852a14da224eafc Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Wed, 19 Jun 2019 16:02:40 +0200 Subject: improve speed not reloading root if only one style tag --- src/inkscape.cpp | 6 ++++-- src/inkscape.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/inkscape.cpp b/src/inkscape.cpp index b7d2c02c2..205707340 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -675,7 +675,7 @@ Application::add_gtk_css() } } -void Application::readStyleSheets() +void Application::readStyleSheets(bool forceupd) { SPDocument *document = SP_ACTIVE_DOCUMENT; document->setStyleSheet(nullptr); @@ -694,7 +694,9 @@ void Application::readStyleSheets() styleelem->read_content(); } } - document->getRoot()->emitModified( SP_OBJECT_MODIFIED_CASCADE ); + if (forceupd || styles.size > 1) { + document->getRoot()->emitModified( SP_OBJECT_MODIFIED_CASCADE ); + } } /** Sets the keyboard modifier to map to Alt. diff --git a/src/inkscape.h b/src/inkscape.h index cd0568f35..2f0b7ec8f 100644 --- a/src/inkscape.h +++ b/src/inkscape.h @@ -139,7 +139,7 @@ public: void selection_changed (Inkscape::Selection * selection); void subselection_changed (SPDesktop *desktop); void selection_set (Inkscape::Selection * selection); - void readStyleSheets(); + void readStyleSheets(bool forceupd = false); Glib::ustring get_symbolic_colors(); void get_higlight_colors(gchar *colornamedsuccess, gchar *colornamedwarning, gchar *colornamederror); void eventcontext_set (Inkscape::UI::Tools::ToolBase * eventcontext); -- cgit v1.2.3