diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2014-01-06 21:42:55 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2014-01-06 21:42:55 +0000 |
| commit | 1a3923ceee80f32e42c677381138723b99278e1b (patch) | |
| tree | 8eea49aa902c703d855277437825d6cd6707954a /src/file.cpp | |
| parent | Fix transforming shapes with path effect applied (bug #1247324) (diff) | |
| download | inkscape-1a3923ceee80f32e42c677381138723b99278e1b.tar.gz inkscape-1a3923ceee80f32e42c677381138723b99278e1b.zip | |
c-string buffer > Glib::ustring usage
(bzr r12885)
Diffstat (limited to 'src/file.cpp')
| -rw-r--r-- | src/file.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/file.cpp b/src/file.cpp index cd52d0b86..babc4df99 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -855,23 +855,18 @@ sp_file_save_dialog(Gtk::Window &parentWindow, SPDocument *doc, Inkscape::Extens Glib::ustring save_loc = save_path; save_loc.append(G_DIR_SEPARATOR_S); - // TODO fixed buffer is bad: - char formatBuf[256]; int i = 1; if ( !doc->getURI() ) { // We are saving for the first time; create a unique default filename - snprintf(formatBuf, 255, _("drawing%s"), filename_extension.c_str()); - save_loc.append(formatBuf); + save_loc = save_loc + Glib::ustring(_("drawing")) + filename_extension; while (Inkscape::IO::file_test(save_loc.c_str(), G_FILE_TEST_EXISTS)) { save_loc = save_path; save_loc.append(G_DIR_SEPARATOR_S); - snprintf(formatBuf, 255, _("drawing-%d%s"), i++, filename_extension.c_str()); - save_loc.append(formatBuf); + save_loc = save_loc + Glib::ustring::compose(_("drawing-%1"), i++) + filename_extension; } } else { - snprintf(formatBuf, 255, _("%s"), Glib::path_get_basename(doc->getURI()).c_str()); - save_loc.append(formatBuf); + save_loc.append(Glib::path_get_basename(doc->getURI())); } // convert save_loc from utf-8 to locale |
