summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2018-01-26 19:32:29 +0000
committerEduard Braun <eduard.braun2@gmx.de>2018-01-26 19:32:29 +0000
commit906deef80961e9949d3bec7ef1d2a8b1c1fc8f65 (patch)
tree6a71c1a29d92e56a803e4480314ce384dd2d68ac /src
parentFix handling of filenames of linked images in .odg export (diff)
downloadinkscape-906deef80961e9949d3bec7ef1d2a8b1c1fc8f65.tar.gz
inkscape-906deef80961e9949d3bec7ef1d2a8b1c1fc8f65.zip
OCAL dialog: make requests non-blocking on windows
- Revert 738e2fcae54ef8764d33d3a47bf7868641efdcfd (which introduced asynchronous call) - Instead properly catch exceptions from load_contents_finish() which were probably what caused the crashes in the first place Fixed bug: - https://bugs.launchpad.net/inkscape/+bug/1745521
Diffstat (limited to 'src')
-rw-r--r--src/ui/dialog/ocaldialogs.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/ui/dialog/ocaldialogs.cpp b/src/ui/dialog/ocaldialogs.cpp
index 13ce4e4cd..4302161dc 100644
--- a/src/ui/dialog/ocaldialogs.cpp
+++ b/src/ui/dialog/ocaldialogs.cpp
@@ -964,12 +964,6 @@ void ImportDialog::on_entry_search_activated()
// Open the RSS feed
Glib::RefPtr<Gio::File> xml_file = Gio::File::create_for_uri(xml_uri);
-#ifdef WIN32
- if (!xml_file->query_exists()) {
- widget_status->set_error(_("Could not connect to the Open Clip Art Library"));
- return;
- }
-#endif
xml_file->load_contents_async(
sigc::bind<Glib::RefPtr<Gio::File> , Glib::ustring>(
sigc::mem_fun(*this, &ImportDialog::on_xml_file_read),
@@ -982,11 +976,18 @@ void ImportDialog::on_xml_file_read(const Glib::RefPtr<Gio::AsyncResult>& result
{
widget_status->end_process();
+ bool success;
char* data;
gsize length;
- bool sucess = xml_file->load_contents_finish(result, data, length);
- if (!sucess) {
+ try {
+ success = xml_file->load_contents_finish(result, data, length);
+ } catch(Glib::Error &e) {
+ success = false;
+ g_warning("ImportDialog::on_xml_file_read():\n\tFailed to retrieve '%s'\n\t%s",
+ xml_uri.c_str(), e.what().c_str());
+ }
+ if (!success) {
widget_status->set_error(_("Could not connect to the Open Clip Art Library"));
return;
}