diff options
-rw-r--r-- | rbutil/rbutilqt/base/utils.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/rbutil/rbutilqt/base/utils.cpp b/rbutil/rbutilqt/base/utils.cpp index 64fc18e449..379b642431 100644 --- a/rbutil/rbutilqt/base/utils.cpp +++ b/rbutil/rbutilqt/base/utils.cpp | |||
@@ -32,7 +32,7 @@ | |||
32 | #include <tchar.h> | 32 | #include <tchar.h> |
33 | #include <winioctl.h> | 33 | #include <winioctl.h> |
34 | #endif | 34 | #endif |
35 | #if defined(Q_OS_LINUX) | 35 | #if defined(Q_OS_LINUX) || defined(Q_OS_MACX) |
36 | #include <sys/statvfs.h> | 36 | #include <sys/statvfs.h> |
37 | #endif | 37 | #endif |
38 | 38 | ||
@@ -109,7 +109,7 @@ QString resolvePathCase(QString path) | |||
109 | qulonglong filesystemFree(QString path) | 109 | qulonglong filesystemFree(QString path) |
110 | { | 110 | { |
111 | qlonglong size = 0; | 111 | qlonglong size = 0; |
112 | #if defined(Q_OS_LINUX) | 112 | #if defined(Q_OS_LINUX) || defined(Q_OS_MACX) |
113 | // the usage of statfs() is deprecated by the LSB so use statvfs(). | 113 | // the usage of statfs() is deprecated by the LSB so use statvfs(). |
114 | struct statvfs fs; | 114 | struct statvfs fs; |
115 | int ret; | 115 | int ret; |
@@ -119,15 +119,6 @@ qulonglong filesystemFree(QString path) | |||
119 | if(ret == 0) | 119 | if(ret == 0) |
120 | size = fs.f_bsize * fs.f_bavail; | 120 | size = fs.f_bsize * fs.f_bavail; |
121 | #endif | 121 | #endif |
122 | #if defined(Q_OS_MACX) | ||
123 | struct statfs fs; | ||
124 | int ret; | ||
125 | |||
126 | ret = statfs(qPrintable(path), &fs); | ||
127 | |||
128 | if(ret == 0) | ||
129 | size = fs.f_bsize * fs.f_bavail; | ||
130 | #endif | ||
131 | #if defined(Q_OS_WIN32) | 122 | #if defined(Q_OS_WIN32) |
132 | BOOL ret; | 123 | BOOL ret; |
133 | ULARGE_INTEGER freeAvailBytes; | 124 | ULARGE_INTEGER freeAvailBytes; |