|
41 | 41 |
|
42 | 42 | #include "qstandardpaths.h" |
43 | 43 | #include <QtCore/qdir.h> |
44 | | -#include <QtCore/QVarLengthArray> |
45 | | -//#include <private/qcore_mac_p.h> |
| 44 | + |
46 | 45 |
|
47 | 46 | #ifndef QT_BOOTSTRAPPED |
48 | 47 | #include <QtCore/qcoreapplication.h> |
49 | 48 | #endif |
50 | 49 |
|
51 | 50 | #include <ApplicationServices/ApplicationServices.h> |
52 | | -#include <CoreFoundation/CoreFoundation.h> |
53 | 51 |
|
54 | 52 | QT_BEGIN_NAMESPACE |
55 | 53 |
|
@@ -189,38 +187,4 @@ QStringList QStandardPaths::standardLocations(StandardLocation type) |
189 | 187 | return dirs; |
190 | 188 | } |
191 | 189 |
|
192 | | -QString _toQString(CFStringRef str) |
193 | | -{ |
194 | | - if(!str) |
195 | | - return QString(); |
196 | | - CFIndex length = CFStringGetLength(str); |
197 | | - const UniChar *chars = CFStringGetCharactersPtr(str); |
198 | | - if (chars) |
199 | | - return QString(reinterpret_cast<const QChar *>(chars), length); |
200 | | - |
201 | | - QVarLengthArray<UniChar> buffer(length); |
202 | | - CFStringGetCharacters(str, CFRangeMake(0, length), buffer.data()); |
203 | | - return QString(reinterpret_cast<const QChar *>(buffer.constData()), length); |
204 | | -} |
205 | | - |
206 | | -#ifndef QT_BOOTSTRAPPED |
207 | | -QString QStandardPaths::displayName(StandardLocation type) |
208 | | -{ |
209 | | - if (QStandardPaths::HomeLocation == type) |
210 | | - return QCoreApplication::translate("QStandardPaths", "Home"); |
211 | | - |
212 | | - FSRef ref; |
213 | | - OSErr err = FSFindFolder(kOnAppropriateDisk, translateLocation(type), false, &ref); |
214 | | - if (err) |
215 | | - return QString(); |
216 | | - |
217 | | - CFString displayName; |
218 | | - err = LSCopyDisplayNameForRef(&ref, &displayName); |
219 | | - if (err) |
220 | | - return QString(); |
221 | | - |
222 | | - return _toQString(displayName); |
223 | | -} |
224 | | -#endif |
225 | | - |
226 | 190 | QT_END_NAMESPACE |
0 commit comments