2.5 compile errors.
[blender-staging.git] / source / blender / editors / space_file / fsmenu.c
index 6ef946c9697d7dd892119e267d5eb9f534fda1ef..59e8dcf82e609bc9ecad27d4ad33b7b9e8c4b4e9 100644 (file)
 #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;