diff options
| author | John Smith <john.smith7545@yahoo.com> | 2012-08-30 00:22:17 +0000 |
|---|---|---|
| committer | John Smith <john.smith7545@yahoo.com> | 2012-08-30 00:22:17 +0000 |
| commit | a51385827276535559541fb2e4c5145876a7d08a (patch) | |
| tree | 34ed06d096b1bb02a3b7736c70e7d582346b0e35 /src/file.cpp | |
| parent | Fix for 980520 : Conflicting accelerator keys (diff) | |
| download | inkscape-a51385827276535559541fb2e4c5145876a7d08a.tar.gz inkscape-a51385827276535559541fb2e4c5145876a7d08a.zip | |
Fix for 170550 : open blank document on 'close'
(bzr r11632)
Diffstat (limited to 'src/file.cpp')
| -rw-r--r-- | src/file.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/file.cpp b/src/file.cpp index fd039323b..3b24876c4 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -145,7 +145,7 @@ SPDesktop *sp_file_new(const Glib::ustring &templ) return dt; } -SPDesktop* sp_file_new_default() +Glib::ustring sp_file_default_template_uri() { std::list<gchar *> sources; sources.push_back( profile_path("templates") ); // first try user's local dir @@ -181,12 +181,22 @@ SPDesktop* sp_file_new_default() g_free(*it); } - SPDesktop* desk = sp_file_new(foundTemplate ? foundTemplate : ""); + Glib::ustring templateUri = foundTemplate ? foundTemplate : ""; + if (foundTemplate) { g_free(foundTemplate); foundTemplate = 0; } + + return templateUri; +} + +SPDesktop* sp_file_new_default() +{ + Glib::ustring templateUri = sp_file_default_template_uri(); + SPDesktop* desk = sp_file_new(sp_file_default_template_uri()); rdf_add_from_preferences( SP_ACTIVE_DOCUMENT ); + return desk; } |
