diff options
Diffstat (limited to 'src/ui/widget/preferences-widget.cpp')
| -rw-r--r-- | src/ui/widget/preferences-widget.cpp | 9 |
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 } |
