diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-11-07 01:06:23 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-11-07 01:06:23 +0000 |
| commit | 97f5dce9b826bcb8cf57b99e9961c725db3e7063 (patch) | |
| tree | 2d01320eadce54e69c2cc7e13abbbee152e2d991 /src | |
| parent | Fixes to Filter Dialog (diff) | |
| download | inkscape-97f5dce9b826bcb8cf57b99e9961c725db3e7063.tar.gz inkscape-97f5dce9b826bcb8cf57b99e9961c725db3e7063.zip | |
Fixes to CPU
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui/dialog/symbols.cpp | 11 | ||||
| -rw-r--r-- | src/ui/dialog/symbols.h | 4 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index 727fdf4f2..51d801d6a 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -368,8 +368,6 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) : getSymbolsFilename(); icons_found = false; - Glib::signal_idle().connect( sigc::mem_fun(*this, &SymbolsDialog::callbackSymbols)); - addSymbolsInDoc(current_document); /* Defaults to current document */ sigc::connection desktopChangeConn = desk_track.connectDesktopChanged( sigc::mem_fun(*this, &SymbolsDialog::setTargetDesktop) ); @@ -385,6 +383,7 @@ SymbolsDialog::~SymbolsDialog() for (std::vector<sigc::connection>::iterator it = instanceConns.begin(); it != instanceConns.end(); ++it) { it->disconnect(); } + idleconn.disconnect(); instanceConns.clear(); desk_track.disconnect(); } @@ -447,6 +446,8 @@ void SymbolsDialog::rebuild() { search->set_text(""); } if (symbol_document) { + idleconn.disconnect(); + idleconn = Glib::signal_idle().connect( sigc::mem_fun(*this, &SymbolsDialog::callbackSymbols)); addSymbolsInDoc(symbol_document); } } @@ -895,6 +896,8 @@ void SymbolsDialog::clearSearch() SPDocument* symbol_document = selectedSymbols(); if (symbol_document) { //We are not in search all docs + idleconn.disconnect(); + idleconn = Glib::signal_idle().connect( sigc::mem_fun(*this, &SymbolsDialog::callbackSymbols)); icons_found = false; addSymbolsInDoc(symbol_document); } else { @@ -920,6 +923,8 @@ void SymbolsDialog::beforeSearch(GdkEventKey* evt) progress_bar->set_fraction(0.0); enableWidgets(false); SPDocument* symbol_document = selectedSymbols(); + idleconn.disconnect(); + idleconn = Glib::signal_idle().connect( sigc::mem_fun(*this, &SymbolsDialog::callbackSymbols)); if (symbol_document) { //We are not in search all docs search->set_text(_("Searching...")); @@ -1062,7 +1067,7 @@ bool SymbolsDialog::callbackSymbols(){ search->set_text(search_str); sensitive = true; enableWidgets(true); - return true; + return false; } return true; } diff --git a/src/ui/dialog/symbols.h b/src/ui/dialog/symbols.h index ebd56d5e0..a4d1f93fb 100644 --- a/src/ui/dialog/symbols.h +++ b/src/ui/dialog/symbols.h @@ -144,7 +144,9 @@ private: DesktopTracker desk_track; SPDocument* current_document; SPDocument* preview_document; /* Document to render single symbol */ - + + sigc::connection idleconn; + /* For rendering the template drawing */ unsigned key; Inkscape::Drawing renderDrawing; |
