diff options
| author | dmitry.zhulanov@gmail.com <> | 2017-06-03 07:05:27 +0000 |
|---|---|---|
| committer | dmitry.zhulanov@gmail.com <> | 2017-06-03 07:05:27 +0000 |
| commit | 454c66cd88665d3e9e7374e134e2215fbc8c2d38 (patch) | |
| tree | 168d76e75e5635c63b8302ada660828d44ce1fe2 /src/main-cmdlinexact.cpp | |
| parent | fix crash in XFileOpen (diff) | |
| download | inkscape-454c66cd88665d3e9e7374e134e2215fbc8c2d38.tar.gz inkscape-454c66cd88665d3e9e7374e134e2215fbc8c2d38.zip | |
check if file exist
Fixed bugs:
- https://launchpad.net/bugs/1692699
(bzr r15700.1.3)
Diffstat (limited to 'src/main-cmdlinexact.cpp')
| -rw-r--r-- | src/main-cmdlinexact.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main-cmdlinexact.cpp b/src/main-cmdlinexact.cpp index 676bf7b44..000ad6fec 100644 --- a/src/main-cmdlinexact.cpp +++ b/src/main-cmdlinexact.cpp @@ -41,7 +41,7 @@ #include <document-undo.h> #include <ui/view/view-widget.h> #include <ui/interface.h> -#include <verbs.h> +#include <io/sys.h> #define DPI_BASE Inkscape::Util::Quantity::convert(1, "in", "px") @@ -98,6 +98,11 @@ std::vector<std::string> vectorFromString(const std::string &csv) void xFileOpen( const Glib::ustring &uri ) { + if (!Inkscape::IO::file_test(uri.c_str(), (GFileTest)(G_FILE_TEST_EXISTS))) { + printf("document is not exists: %s\n", uri.c_str()); + return; + } + if (s_verbose) { printf("open %s\n", uri.c_str()); fflush(stdout); @@ -120,7 +125,6 @@ void xFileOpen( const Glib::ustring &uri ) std::string exeption_mgs = e.what(); printf("Error: open %s:%s\n",uri.c_str(), exeption_mgs.c_str() ); fflush(stdout); - return; } // Set viewBox if it doesn't exist |
