From 7fb3c67bb66ed1bc2647c4695cf441f9683fd064 Mon Sep 17 00:00:00 2001 From: Jabiertxo Arraiza Cenoz Date: Wed, 25 Jul 2018 13:12:18 +0200 Subject: Working on open folders on WIN --- src/ui/widget/preferences-widget.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (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 d8a548be2..431b0d0ea 100644 --- a/src/ui/widget/preferences-widget.cpp +++ b/src/ui/widget/preferences-widget.cpp @@ -904,8 +904,14 @@ void PrefOpenFolder::init(Glib::ustring const &entry_string, Glib::ustring const void PrefOpenFolder::onRelatedButtonClickedCallback() { g_mkdir_with_parents (relatedEntry->get_text().c_str(), 0700); +#ifdef WIN32 + Uri uri = new System::Uri(relatedEntry->get_text()); + Glib::ustring uri_open = (uri.AbsoluteUri).c_str() +#else + Glib::ustring uri_open = ("file://" + relatedEntry->get_text()).c_str(); +#endif GError *error = NULL; - if (!g_app_info_launch_default_for_uri (("file://" + relatedEntry->get_text()).c_str(), NULL, &error)) { + if (!g_app_info_launch_default_for_uri (uri_open.c_str(), NULL, &error)) { g_warning ("Failed to open uri: %s", error->message); } } -- cgit v1.2.3