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:
authorMatt Ebb <matt@mke3.net>2009-05-02 07:09:40 +0400
committerMatt Ebb <matt@mke3.net>2009-05-02 07:09:40 +0400
commit76cedc4b9abe5a50db03a1ccd1875213effae264 (patch)
treed6b4e5794c5fac6685c2ff0213cffc7e6eeba282 /source/blender/editors/space_file/fsmenu.c
parent792449f8f0c3fac5ac4cb29db4abaa9c4cf89cd5 (diff)
* Added a list of OS X volumes to the file selector bookmarks pane, consistent with the drive letters on Windows. Currently this list only gets refreshed on Blender startup, hopefully this can be worked on but for now at least it's better than having to manually navigate to /Volumes/...
http://mke3.net/blender/devel/2.5/fileselect_volumes.png
Diffstat (limited to 'source/blender/editors/space_file/fsmenu.c')
-rw-r--r--source/blender/editors/space_file/fsmenu.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c
index 6ef946c9697..59e8dcf82e6 100644
--- a/source/blender/editors/space_file/fsmenu.c
+++ b/source/blender/editors/space_file/fsmenu.c
@@ -47,6 +47,12 @@
#include "BLI_winstuff.h"
#endif
+#ifdef __APPLE__
+#include <CoreServices/CoreServices.h>
+
+#include "BKE_utildefines.h"
+#endif
+
#include "fsmenu.h" /* include ourselves */
@@ -303,6 +309,27 @@ void fsmenu_read_file(struct FSMenu* fsmenu, const char *filename)
}
#endif
+#ifdef __APPLE__
+ {
+ OSErr err=noErr;
+ int i;
+
+ /* loop through all the OS X Volumes, and add them to the SYSTEM section */
+ for (i=1; err!=nsvErr; i++)
+ {
+ FSRef dir;
+ unsigned char path[FILE_MAXDIR+FILE_MAXFILE];
+
+ err = FSGetVolumeInfo(kFSInvalidVolumeRefNum, i, NULL, kFSVolInfoNone, NULL, NULL, &dir);
+ if (err != noErr)
+ continue;
+
+ FSRefMakePath(&dir, path, FILE_MAXDIR+FILE_MAXFILE);
+ fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, (char *)path, 1, 0);
+ }
+ }
+#endif
+
fp = fopen(filename, "r");
if (!fp) return;