42 #ifndef QT_NO_DESKTOPSERVICES 49 #include <private/qcore_mac_p.h> 52 #include <ApplicationServices/ApplicationServices.h> 63 return kDesktopFolderType;
break;
66 return kDocumentsFolderType;
break;
71 return kFontsFolderType;
break;
74 return kApplicationsFolderType;
break;
77 return kMusicDocumentsFolderType;
break;
80 return kMovieDocumentsFolderType;
break;
83 return kPictureDocumentsFolderType;
break;
86 return kTemporaryFolderType;
break;
89 return kApplicationSupportFolderType;
break;
92 return kCachedDataFolderType;
break;
95 return kDesktopFolderType;
break;
108 const OSStatus err = LSOpenCFURLRef(cfUrl, 0);
109 return (err == noErr);
132 if (FSRefMakePath(&ref, reinterpret_cast<UInt8 *>(ba.
data()), ba.
size()) == noErr)
145 short domain = kOnAppropriateDisk;
148 domain = kUserDomain;
174 OSErr err = FSFindFolder(kOnAppropriateDisk,
translateLocation(type),
false, &ref);
179 err = LSCopyDisplayNameForRef(&ref, &displayName);
188 #endif // QT_NO_DESKTOPSERVICES static bool startDetached(const QString &program, const QStringList &arguments, const QString &workingDirectory, qint64 *pid=0)
Starts the program program with the arguments arguments in a new process, and detaches from it...
static bool launchWebBrowser(const QUrl &url)
bool isValid() const
Returns true if the URL is valid; otherwise returns false.
#define QT_END_NAMESPACE
This macro expands to.
char * data()
Returns a pointer to the data stored in the byte array.
static QString storageLocation(StandardLocation type)
Returns the default system directory where files of type belong, or an empty string if the location c...
static QString displayName(StandardLocation type)
Returns a localized display name for the given location type or an empty QString if no relevant locat...
The QByteArray class provides an array of bytes.
StandardLocation
This enum describes the different locations that can be queried by QDesktopServices::storageLocation ...
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QUrl class provides a convenient interface for working with URLs.
The QString class provides a Unicode character string.
QString normalized(NormalizationForm mode) const Q_REQUIRED_RESULT
Returns the string in the given Unicode normalization mode.
#define QT_BEGIN_NAMESPACE
This macro expands to.
static bool isEmpty(const char *str)
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static bool lsOpen(const QUrl &url)
The QStringList class provides a list of strings.
static QString fromUtf8(const char *, int size=-1)
Returns a QString initialized with the first size bytes of the UTF-8 string str.
static QString getFullPath(const FSRef &ref)
QString toLocalFile() const
Returns the path of this URL formatted as a local file path.
static QString tempPath()
Returns the absolute path of the system's temporary directory.
QByteArray toEncoded(FormattingOptions options=None) const
Returns the encoded representation of the URL if it's valid; otherwise an empty QByteArray is returne...
QString scheme() const
Returns the scheme of the URL.
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
static bool openDocument(const QUrl &file)
OSType translateLocation(QDesktopServices::StandardLocation type)
int size() const
Returns the number of bytes in this byte array.
static QString organizationName()
static QString applicationName()
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
static QString homePath()
Returns the absolute path of the user's home directory.