summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rbutil/rbutilqt/base/utils.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/rbutil/rbutilqt/base/utils.cpp b/rbutil/rbutilqt/base/utils.cpp
index 6a817e86da..d2ed49bae3 100644
--- a/rbutil/rbutilqt/base/utils.cpp
+++ b/rbutil/rbutilqt/base/utils.cpp
@@ -160,13 +160,23 @@ QString Utils::filesystemName(QString path)
160 160
161 if(result == noErr) { 161 if(result == noErr) {
162 GetVolParmsInfoBuffer volparms; 162 GetVolParmsInfoBuffer volparms;
163 /* PBHGetVolParmsSync() is not available for 64bit while
164 FSGetVolumeParms() is available in 10.5+. Thus we need to use
165 PBHGetVolParmsSync() for 10.4, and that also requires 10.4 to
166 always use 32bit.
167 Qt 4 supports 32bit on 10.6 Cocoa only.
168 */
169#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
170 if(FSGetVolumeParms(volrefnum, &volparms, sizeof(volparms)) == noErr)
171#else
163 HParamBlockRec hpb; 172 HParamBlockRec hpb;
164 hpb.ioParam.ioNamePtr = NULL; 173 hpb.ioParam.ioNamePtr = NULL;
165 hpb.ioParam.ioVRefNum = volrefnum; 174 hpb.ioParam.ioVRefNum = volrefnum;
166 hpb.ioParam.ioBuffer = (Ptr)&volparms; 175 hpb.ioParam.ioBuffer = (Ptr)&volparms;
167 hpb.ioParam.ioReqCount = sizeof(volparms); 176 hpb.ioParam.ioReqCount = sizeof(volparms);
168 177 if(PBHGetVolParmsSync(&hpb) == noErr)
169 if(PBHGetVolParmsSync(&hpb) == noErr) { 178#endif
179 {
170 if(volparms.vMServerAdr == 0) { 180 if(volparms.vMServerAdr == 0) {
171 if(bsd == (char*)volparms.vMDeviceID) { 181 if(bsd == (char*)volparms.vMDeviceID) {
172 name = QString::fromUtf16((const ushort*)volname.unicode, 182 name = QString::fromUtf16((const ushort*)volname.unicode,
@@ -798,13 +808,19 @@ bool Utils::ejectDevice(QString device)
798 kFSVolInfoFSInfo, NULL, NULL, NULL); 808 kFSVolInfoFSInfo, NULL, NULL, NULL);
799 if(result == noErr) { 809 if(result == noErr) {
800 GetVolParmsInfoBuffer volparms; 810 GetVolParmsInfoBuffer volparms;
811 /* See above -- PBHGetVolParmsSync() is not available for 64bit,
812 * and FSGetVolumeParms() on 10.5+ only. */
813#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
814 if(FSGetVolumeParms(volrefnum, &volparms, sizeof(volparms)) == noErr)
815#else
801 HParamBlockRec hpb; 816 HParamBlockRec hpb;
802 hpb.ioParam.ioNamePtr = NULL; 817 hpb.ioParam.ioNamePtr = NULL;
803 hpb.ioParam.ioVRefNum = volrefnum; 818 hpb.ioParam.ioVRefNum = volrefnum;
804 hpb.ioParam.ioBuffer = (Ptr)&volparms; 819 hpb.ioParam.ioBuffer = (Ptr)&volparms;
805 hpb.ioParam.ioReqCount = sizeof(volparms); 820 hpb.ioParam.ioReqCount = sizeof(volparms);
806 821 if(PBHGetVolParmsSync(&hpb) == noErr)
807 if(PBHGetVolParmsSync(&hpb) == noErr) { 822#endif
823 {
808 if(volparms.vMServerAdr == 0) { 824 if(volparms.vMServerAdr == 0) {
809 if(bsd == (char*)volparms.vMDeviceID) { 825 if(bsd == (char*)volparms.vMDeviceID) {
810 pid_t dissenter; 826 pid_t dissenter;