Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-11-19 00:54:07 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-11-19 00:54:07 +0300
commit5dc2ecdf05da4d24a7a57627caece6e22118c2d5 (patch)
treef69fc9137741edb5aa61f021d6a94cac001b785e /source/blender/editors/space_file
parent3e096b47ba863a6738a8e310a79afae12c42aff2 (diff)
parentf74fa98e537d820302c3f787ec68a91a3dd254b9 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r--source/blender/editors/space_file/fsmenu.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c
index 6fd2c3515fa..9b1aae03219 100644
--- a/source/blender/editors/space_file/fsmenu.c
+++ b/source/blender/editors/space_file/fsmenu.c
@@ -57,6 +57,7 @@
#ifdef __linux__
#include <mntent.h>
+#include "BLI_fileops_types.h"
#endif
#include "fsmenu.h" /* include ourselves */
@@ -628,6 +629,33 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks)
fprintf(stderr, "could not close the list of mounted filesystems\n");
}
}
+ /* Check gvfs shares. */
+ const char * const xdg_runtime_dir = BLI_getenv("XDG_RUNTIME_DIR");
+ if (xdg_runtime_dir != NULL) {
+ struct direntry *dir;
+ char name[FILE_MAX];
+ BLI_join_dirfile(name, sizeof(name), xdg_runtime_dir, "gvfs/");
+ const uint dir_len = BLI_filelist_dir_contents(name, &dir);
+ for (uint i = 0; i < dir_len; i++) {
+ if ((dir[i].type & S_IFDIR)) {
+ const char *dirname = dir[i].relname;
+ if (dirname[0] != '.') {
+ /* Dir names contain a lot of unwanted text.
+ * Assuming every entry ends with the share name */
+ const char *label = strstr(dirname, "share=");
+ if (label != NULL) {
+ /* Move pointer so "share=" is trimmed off or use full dirname as label. */
+ const char *label_test = label + 6;
+ label = *label_test ? label_test : dirname;
+ }
+ BLI_snprintf(line, sizeof(line), "%s%s/", name, dirname);
+ fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, line, label, FS_INSERT_SORTED);
+ found = 1;
+ }
+ }
+ }
+ BLI_filelist_free(dir, dir_len);
+ }
#endif
/* fallback */