summaryrefslogtreecommitdiffstats
path: root/src/inkscape.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2011-04-07 23:42:04 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2011-04-07 23:42:04 +0000
commit945ce419c806c73d70203dec33ececafbe108a92 (patch)
treecfcdb59bf47e9db7f9e01f7eebb59924bdeaea94 /src/inkscape.cpp
parentMerge from trunk (again) (diff)
parentExtensions. SVG+media fix (see Bug #400356). (diff)
downloadinkscape-945ce419c806c73d70203dec33ececafbe108a92.tar.gz
inkscape-945ce419c806c73d70203dec33ececafbe108a92.zip
Merge from trunk
(bzr r9508.1.73)
Diffstat (limited to 'src/inkscape.cpp')
-rw-r--r--src/inkscape.cpp28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/inkscape.cpp b/src/inkscape.cpp
index 430977567..1007c315a 100644
--- a/src/inkscape.cpp
+++ b/src/inkscape.cpp
@@ -875,23 +875,31 @@ gboolean inkscape_use_gui()
* Menus management
*
*/
-bool inkscape_load_menus (Inkscape::Application */*inkscape*/)
+bool inkscape_load_menus( Inkscape::Application * inkscape )
{
- // TODO fix that fn is being leaked
gchar *fn = profile_path(MENUS_FILE);
- gchar *menus_xml = NULL;
+ gchar *menus_xml = 0;
gsize len = 0;
- if (g_file_get_contents(fn, &menus_xml, &len, NULL)) {
+ if ( inkscape != inkscape_get_instance() ) {
+ g_warning("BAD BAD BAD THINGS");
+ }
+
+ if ( g_file_get_contents(fn, &menus_xml, &len, NULL) ) {
// load the menus_xml file
- INKSCAPE->menus = sp_repr_read_mem(menus_xml, len, NULL);
+ inkscape->menus = sp_repr_read_mem(menus_xml, len, NULL);
+
g_free(menus_xml);
- if (INKSCAPE->menus) {
- return true;
- }
+ menus_xml = 0;
}
- INKSCAPE->menus = sp_repr_read_mem(menus_skeleton, MENUS_SKELETON_SIZE, NULL);
- return (INKSCAPE->menus != 0);
+ g_free(fn);
+ fn = 0;
+
+ if ( !inkscape->menus ) {
+ inkscape->menus = sp_repr_read_mem(menus_skeleton, MENUS_SKELETON_SIZE, NULL);
+ }
+
+ return (inkscape->menus != 0);
}