summaryrefslogtreecommitdiffstats
path: root/src/file.cpp
diff options
context:
space:
mode:
authorJosh Andler <scislac@gmail.com>2012-03-13 23:48:44 +0000
committerJosh Andler <scislac@gmail.com>2012-03-13 23:48:44 +0000
commit7fc63c1160d6c07d301ad7b2ec95e597fdbdbf6b (patch)
treed66bd07f8b1f38b4b5c62c8ed5556277cef1aef3 /src/file.cpp
parentPatch for IME text placement lp:166632 by Takeyuki Shiramoto (diff)
downloadinkscape-7fc63c1160d6c07d301ad7b2ec95e597fdbdbf6b.tar.gz
inkscape-7fc63c1160d6c07d301ad7b2ec95e597fdbdbf6b.zip
Patch for multi-import by heisenbug from lp:203070
(bzr r11081)
Diffstat (limited to 'src/file.cpp')
-rw-r--r--src/file.cpp34
1 files changed, 30 insertions, 4 deletions
diff --git a/src/file.cpp b/src/file.cpp
index 8dac0f575..dbf8fc7d4 100644
--- a/src/file.cpp
+++ b/src/file.cpp
@@ -1148,6 +1148,9 @@ sp_file_import(Gtk::Window &parentWindow)
return;
}
+ typedef std::vector<Glib::ustring> pathnames;
+ pathnames flist(importDialogInstance->getFilenames());
+
// Get file name and extension type
Glib::ustring fileName = importDialogInstance->getFilename();
Inkscape::Extension::Extension *selection = importDialogInstance->getSelectionType();
@@ -1155,16 +1158,39 @@ sp_file_import(Gtk::Window &parentWindow)
delete importDialogInstance;
importDialogInstance = NULL;
- if (fileName.size() > 0) {
+ //# Iterate through filenames if more than 1
+ if (flist.size() > 1)
+ {
+ for (unsigned int i = 0; i < flist.size(); i++)
+ {
+ fileName = flist[i];
+
+ Glib::ustring newFileName = Glib::filename_to_utf8(fileName);
+ if (!newFileName.empty())
+ fileName = newFileName;
+ else
+ g_warning("ERROR CONVERTING IMPORT FILENAME TO UTF-8");
+
+#ifdef INK_DUMP_FILENAME_CONV
+ g_message("Importing File %s\n", fileName.c_str());
+#endif
+ file_import(doc, fileName, selection);
+ }
+
+ return;
+ }
+
+
+ if (!fileName.empty()) {
Glib::ustring newFileName = Glib::filename_to_utf8(fileName);
- if ( newFileName.size() > 0)
+ if (!newFileName.empty())
fileName = newFileName;
else
- g_warning( "ERROR CONVERTING OPEN FILENAME TO UTF-8" );
+ g_warning("ERROR CONVERTING IMPORT FILENAME TO UTF-8");
- import_path = Glib::path_get_dirname (fileName);
+ import_path = Glib::path_get_dirname(fileName);
import_path.append(G_DIR_SEPARATOR_S);
prefs->setString("/dialogs/import/path", import_path);