summaryrefslogtreecommitdiffstats
path: root/src/ui/widget/preferences-widget.cpp
diff options
context:
space:
mode:
authorJabiertxo Arraiza Cenoz <jtx@jtx.markerlab.es>2018-07-26 06:58:21 +0000
committerJabiertxo Arraiza Cenoz <jtx@jtx.markerlab.es>2018-07-26 06:58:21 +0000
commitd97ae1ddc154d48c538039741376f13099376cd1 (patch)
treed4f696059dc88d181107dfb7047fd9f1ce6b119a /src/ui/widget/preferences-widget.cpp
parentFixes pointed by maren in original MR (diff)
downloadinkscape-d97ae1ddc154d48c538039741376f13099376cd1.tar.gz
inkscape-d97ae1ddc154d48c538039741376f13099376cd1.zip
Open folders in inkscape preferences with XGD. Also added a tentative for Mac
Diffstat (limited to 'src/ui/widget/preferences-widget.cpp')
-rw-r--r--src/ui/widget/preferences-widget.cpp9
1 files changed, 4 insertions, 5 deletions
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
}