From d97ae1ddc154d48c538039741376f13099376cd1 Mon Sep 17 00:00:00 2001 From: Jabiertxo Arraiza Cenoz Date: Thu, 26 Jul 2018 08:58:21 +0200 Subject: Open folders in inkscape preferences with XGD. Also added a tentative for Mac --- src/ui/widget/preferences-widget.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/ui/widget/preferences-widget.cpp') diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp index 584c4fb6d..6e1c619d5 100644 --- a/src/ui/widget/preferences-widget.cpp +++ b/src/ui/widget/preferences-widget.cpp @@ -902,14 +902,13 @@ void PrefOpenFolder::init(Glib::ustring const &entry_string, Glib::ustring const void PrefOpenFolder::onRelatedButtonClickedCallback() { g_mkdir_with_parents(relatedEntry->get_text().c_str(), 0700); - GError *error = NULL; + //https://stackoverflow.com/questions/42442189/how-to-open-spawn-a-file-with-glib-gtkmm-in-windows #ifdef WIN32 ShellExecute(NULL, "open", relatedEntry->get_text().c_str(), NULL, NULL, SW_SHOWDEFAULT); +#elif defined(__APPLE__) + system(("open " + relatedEntry->get_text()).c_str()); #else - if (!g_app_info_launch_default_for_uri(g_filename_to_uri(relatedEntry->get_text().c_str(), NULL, &error), NULL, - &error)) { - g_warning("Failed to open uri: %s", error->message); - } + system(("xdg-open " + relatedEntry->get_text()).c_str()); #endif } -- cgit v1.2.3