summaryrefslogtreecommitdiffstats
path: root/src/file.cpp
diff options
context:
space:
mode:
authorKris De Gussem <kris.degussem@gmail.com>2014-03-16 12:03:34 +0000
committerKris <Kris.De.Gussem@hotmail.com>2014-03-16 12:03:34 +0000
commitd952905a04ce27d521e7ae42a3c167259913553f (patch)
treed0c942bc5f479159c6eab85618b18dc3341bf214 /src/file.cpp
parentFix build failure with GTK 3.0 (diff)
downloadinkscape-d952905a04ce27d521e7ae42a3c167259913553f.tar.gz
inkscape-d952905a04ce27d521e7ae42a3c167259913553f.zip
string class usage
(bzr r13157)
Diffstat (limited to 'src/file.cpp')
-rw-r--r--src/file.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/file.cpp b/src/file.cpp
index 6c8c5ff85..51e629c7d 100644
--- a/src/file.cpp
+++ b/src/file.cpp
@@ -855,7 +855,7 @@ sp_file_save_dialog(Gtk::Window &parentWindow, SPDocument *doc, Inkscape::Extens
int i = 1;
if ( !doc->getURI() ) {
// We are saving for the first time; create a unique default filename
- save_loc = save_loc + Glib::ustring(_("drawing")) + filename_extension;
+ save_loc = save_loc + _("drawing") + filename_extension;
while (Inkscape::IO::file_test(save_loc.c_str(), G_FILE_TEST_EXISTS)) {
save_loc = save_path;
@@ -922,9 +922,9 @@ sp_file_save_dialog(Gtk::Window &parentWindow, SPDocument *doc, Inkscape::Extens
Inkscape::Extension::Output *omod = dynamic_cast<Inkscape::Extension::Output *>(selectionType);
if (omod) {
- Glib::ustring save_extension = (std::string)omod->get_extension();
- if ( !hasEnding(fileName, save_extension.c_str()) ) {
- fileName += save_extension.c_str();
+ Glib::ustring save_extension = (omod->get_extension()) ? (omod->get_extension()) : "";
+ if ( !hasEnding(fileName, save_extension) ) {
+ fileName += save_extension;
}
}
@@ -1403,9 +1403,7 @@ sp_file_export_dialog(Gtk::Window &parentWindow)
if (export_path.empty())
export_path = g_get_home_dir();
- export_loc = export_path;
- export_loc.append(G_DIR_SEPARATOR_S);
- export_loc += Glib::ustring(_("drawing")) + filename_extension;
+ export_loc = export_path + G_DIR_SEPARATOR_S + _("drawing") + filename_extension;
}
else