diff options
| author | Slagvi Public <JandotDarowskiattgmaildottcom> | 2013-07-27 20:14:29 +0000 |
|---|---|---|
| committer | Slagvi Public <JandotDarowskiattgmaildottcom> | 2013-07-27 20:14:29 +0000 |
| commit | 6967bad3f32f3cf9e660f6009be63adf62f94058 (patch) | |
| tree | 371aa9a5489bfd7dd32f903cdf2d2fc1a67fbb45 /src | |
| parent | Templates gui fixes (diff) | |
| download | inkscape-6967bad3f32f3cf9e660f6009be63adf62f94058.tar.gz inkscape-6967bad3f32f3cf9e660f6009be63adf62f94058.zip | |
Templates related bug fixes
(bzr r12379.2.15)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui/dialog/template-load-tab.cpp | 10 | ||||
| -rw-r--r-- | src/ui/dialog/template-widget.cpp | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/ui/dialog/template-load-tab.cpp b/src/ui/dialog/template-load-tab.cpp index 65d5e6447..d993e0233 100644 --- a/src/ui/dialog/template-load-tab.cpp +++ b/src/ui/dialog/template-load-tab.cpp @@ -191,9 +191,17 @@ TemplateLoadTab::TemplateData TemplateLoadTab::_processTemplateFile(const Glib:: { TemplateData result; result.path = path; - result.display_name = Glib::path_get_basename(path); result.is_procedural = false; + // convert path into valid template name + result.display_name = Glib::path_get_basename(path); + gsize n = 0; + while ((n = result.display_name.find_first_of("_", 0)) < Glib::ustring::npos){ + result.display_name.replace(n, 1, 1, ' '); + } + n = result.display_name.rfind(".svg"); + result.display_name.replace(n, 4, 1, ' '); + Inkscape::XML::Document *rdoc; rdoc = sp_repr_read_file(path.data(), SP_SVG_NS_URI); Inkscape::XML::Node *myRoot; diff --git a/src/ui/dialog/template-widget.cpp b/src/ui/dialog/template-widget.cpp index 56346403e..1efa790ab 100644 --- a/src/ui/dialog/template-widget.cpp +++ b/src/ui/dialog/template-widget.cpp @@ -58,7 +58,7 @@ void TemplateWidget::create() if (_current_template.is_procedural) {} else { - sp_file_new(_current_template.path); + sp_file_open(_current_template.path, NULL); } } |
