summaryrefslogtreecommitdiffstats
path: root/src/inkscape-application.cpp
diff options
context:
space:
mode:
authorPatrick Storz <eduard.braun2@gmx.de>2019-07-11 19:51:33 +0000
committerPatrick Storz <eduard.braun2@gmx.de>2019-07-11 20:03:22 +0000
commit3ee1ec3df83291d7f8b81e8af94dd8e637b1aa1e (patch)
tree4b5434dbc659781374b7a39a07c896a2197e66e1 /src/inkscape-application.cpp
parentFix typo in CPack.cmake (diff)
downloadinkscape-3ee1ec3df83291d7f8b81e8af94dd8e637b1aa1e.tar.gz
inkscape-3ee1ec3df83291d7f8b81e8af94dd8e637b1aa1e.zip
CLI: Warn if --export-file is used with multiple input files
Diffstat (limited to 'src/inkscape-application.cpp')
-rw-r--r--src/inkscape-application.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/inkscape-application.cpp b/src/inkscape-application.cpp
index 75a81a4f5..6b0178e74 100644
--- a/src/inkscape-application.cpp
+++ b/src/inkscape-application.cpp
@@ -957,6 +957,15 @@ ConcreteInkscapeApplication<T>::on_open(const Gio::Application::type_vec_files&
if(_pdf_page)
INKSCAPE.set_pdf_page(_pdf_page);
+ if (files.size() > 1 && !_file_export.export_filename.empty()) {
+ std::cerr << "ConcreteInkscapeApplication<Gtk::Application>::on_open: "
+ "Can't use '--export-file' with multiple input files "
+ "(output file would be overwritten for each input file). "
+ "Please use '--export-type' instead and rename manually."
+ << std::endl;
+ return;
+ }
+
for (auto file : files) {
// Open file
SPDocument *document = document_open (file);
@@ -973,13 +982,21 @@ template<>
void
ConcreteInkscapeApplication<Gtk::Application>::on_open(const Gio::Application::type_vec_files& files, const Glib::ustring& hint)
{
- std::cout << "on_open" << std::endl;
on_startup2();
if(_pdf_poppler)
INKSCAPE.set_pdf_poppler(_pdf_poppler);
if(_pdf_page)
INKSCAPE.set_pdf_page(_pdf_page);
+ if (files.size() > 1 && !_file_export.export_filename.empty()) {
+ std::cerr << "ConcreteInkscapeApplication<Gtk::Application>::on_open: "
+ "Can't use '--export-file' with multiple input files "
+ "(output file would be overwritten for each input file). "
+ "Please use '--export-type' instead and rename manually."
+ << std::endl;
+ return;
+ }
+
for (auto file : files) {
if (_with_gui) {
// Create a window for each file.