diff options
| author | Jabiertxo Arraiza Cenoz <jtx@jtx.markerlab.es> | 2018-07-25 11:12:18 +0000 |
|---|---|---|
| committer | Jabiertxo Arraiza Cenoz <jtx@jtx.markerlab.es> | 2018-07-25 11:12:18 +0000 |
| commit | 7fb3c67bb66ed1bc2647c4695cf441f9683fd064 (patch) | |
| tree | 7509297393b3285fabb7db4270a4b652b63055e9 /src | |
| parent | Fix codding style (diff) | |
| download | inkscape-7fb3c67bb66ed1bc2647c4695cf441f9683fd064.tar.gz inkscape-7fb3c67bb66ed1bc2647c4695cf441f9683fd064.zip | |
Working on open folders on WIN
Diffstat (limited to 'src')
| -rw-r--r-- | src/io/resource.cpp | 7 | ||||
| -rw-r--r-- | src/ui/widget/preferences-widget.cpp | 8 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/io/resource.cpp b/src/io/resource.cpp index 65fd01d0e..9f584f58c 100644 --- a/src/io/resource.cpp +++ b/src/io/resource.cpp @@ -105,7 +105,8 @@ gchar *_get_path(Domain domain, Type type, char const *filename) path = profile_path(name); } break; } - + + if (filename && path) { gchar *temp=g_build_filename(path, filename, NULL); g_free(path); @@ -115,6 +116,8 @@ gchar *_get_path(Domain domain, Type type, char const *filename) return path; } + + Util::ptr_shared get_path(Domain domain, Type type, char const *filename) { char *path = _get_path(domain, type, filename); @@ -422,7 +425,7 @@ char *profile_path(const char *filename) int problem = errno; g_warning("Unable to create profile directory (%s) (%d)", g_strerror(problem), problem); } else { - gchar const *userDirs[] = {"keys", "templates", "icons", "extensions", "palettes", nullptr}; + gchar const *userDirs[] = {"keys", "templates", "icons", "extensions", "ui", "symbols", "themes", "palettes", nullptr}; for (gchar const** name = userDirs; *name; ++name) { gchar *dir = g_build_filename(prefdir, *name, NULL); g_mkdir_with_parents(dir, mode); 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); } } |
