summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f3f4bbc)
raw | patch | inline | side by side (parent: f3f4bbc)
author | mental <mental@users.sourceforge.net> | |
Sun, 21 May 2006 20:36:01 +0000 (20:36 +0000) | ||
committer | mental <mental@users.sourceforge.net> | |
Sun, 21 May 2006 20:36:01 +0000 (20:36 +0000) |
ChangeLog | patch | blob | history | |
src/dialogs/filedialog.cpp | patch | blob | history | |
src/gc-core.h | patch | blob | history | |
src/gc.cpp | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index f14540efc43b09eb2de33d7b76e117ef5a529f56..a9639be4e9671a08312564a03d8aa72ff0c0efdf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2006-05-21 MenTaLguY <mental@rydia.net>
+
+ * src/gc-core.h, src/gc.cpp:
+
+ add GC::request_early_collection() to force a collection from the idle
+ loop at opportune times
+
+ * src/dialogs/filedialog.cpp:
+
+ call GC::request_early_collection() after switching preview images
+
2006-05-21 Jon A. Cruz <jon@joncruz.org>
* src/layer-manager.cpp, src/layer-manager.h,
index bf9eaceb55b3a7613ae60b166317dce42e37c2c9..fb6e599a8e25745e4a38a23a0ba8f2dbcab2205d 100644 (file)
#include "inkscape.h"
#include "svg-view-widget.h"
#include "filedialog.h"
+#include "gc-core.h"
#undef INK_DUMP_FILENAME_CONV
sp_document_unref(doc);
+ Inkscape::GC::request_early_collection();
+
return true;
}
void FileOpenDialogImpl::updatePreviewCallback()
{
Glib::ustring fileName = get_preview_filename();
-
if (fileName.length() < 1)
return;
-
svgPreview.set(fileName, dialogType);
}
set_modal (TRUE); //Window
sp_transientize((GtkWidget *)gobj()); //Make transient
gint b = run(); //Dialog
+ svgPreview.showNoPreview();
hide();
if (b == Gtk::RESPONSE_OK)
set_modal (TRUE); //Window
sp_transientize((GtkWidget *)gobj()); //Make transient
gint b = run(); //Dialog
+ svgPreview.showNoPreview();
hide();
if (b == Gtk::RESPONSE_OK)
diff --git a/src/gc-core.h b/src/gc-core.h
index cec617d426bb2857e5f1b5fd6db8d583f9f90532..faf7eb4de9b1b4a63426c33dc5126186b39ad43c 100644 (file)
--- a/src/gc-core.h
+++ b/src/gc-core.h
Core::init();
}
+void request_early_collection();
+
}
}
diff --git a/src/gc.cpp b/src/gc.cpp
index 7333b4641bd0b3e2bedda6d0a8664c8d9a1dfeaf..8d89de26a69784f9c2d62ec5576e7db50c760210 100644 (file)
--- a/src/gc.cpp
+++ b/src/gc.cpp
#include "gc-core.h"
#include <stdexcept>
#include <glib/gmessages.h>
+#include <sigc++/functors/ptr_fun.h>
+#include <glibmm/main.h>
namespace Inkscape {
namespace GC {
_ops.do_init();
}
+
+namespace {
+
+bool collection_requested=false;
+bool collection_task() {
+ Core::gcollect();
+ Core::gcollect();
+ collection_requested=false;
+ return false;
+}
+
+}
+
+void request_early_collection() {
+ if (!collection_requested) {
+ collection_requested=true;
+ Glib::signal_idle().connect(sigc::ptr_fun(&collection_task));
+ }
+}
+
}
}