From 8a33077853e851e2795476cd502444c2d8535f9a Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 28 Jul 2016 12:25:59 +0200 Subject: QUrl: fix resolved() for data URLs They look relative because the path doesn't start with a '/' but they have a scheme so they shouldn't be combined as if it was one absolute and one relative URL. [ChangeLog][QtCore][QUrl] QUrl::resolved() no longer treats a URL with a scheme as a relative URL if it matches this URL's scheme. This special casing was incompatible with RFC 3986 and broke resolving data: URLs, for instance. Change-Id: I3758d3a2141cea7c6d13514243eb8dee5d510dd0 Reviewed-by: Thiago Macieira --- src/corelib/io/qurl.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/corelib/io') diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 2672de24f2..1fe529d48d 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -3167,8 +3167,7 @@ QUrl QUrl::resolved(const QUrl &relative) const if (!relative.d) return *this; QUrl t; - // be non strict and allow scheme in relative url - if (!relative.d->scheme.isEmpty() && relative.d->scheme != d->scheme) { + if (!relative.d->scheme.isEmpty()) { t = relative; t.detach(); } else { -- cgit v1.2.3 From 91a2c8630b2204831566ab8e523c747f9d8ec927 Mon Sep 17 00:00:00 2001 From: David Faure Date: Tue, 2 Aug 2016 14:07:37 +0200 Subject: QUrl::resolved: keep treating file:name.txt as relative for now 8a33077 made QUrl::resolved() follow its documentation ("If relative is not a relative URL, this function will return relative directly.", where relative means scheme is empty). However there is much code out there (e.g. qtdeclarative) which relies on QUrl::fromLocalFile("fileName.txt") to be treated as relative, so for now, we still allow this (in Qt 5.6.x). For Qt 5.8, this commit will be reverted. [ChangeLog][QtCore][QUrl] [EDITORIAL: replaces 8a33077] QUrl::resolved() no longer treats a URL with a scheme as a relative URL if it matches this URL's scheme. For now it still treats "file:name.txt" as relative for compatibility, but be warned that in Qt 5.8 it will no longer consider those to be relative. Both isRelative() and RFC 3986 say that such URLs are not relative, so starting from Qt 5.8, resolved() will return them as is. Change-Id: Iff01e5b470319f6c46526086d765187e2259bdf5 Reviewed-by: Thiago Macieira Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qurl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/corelib/io') diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 1fe529d48d..a5643d123d 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -3167,7 +3167,8 @@ QUrl QUrl::resolved(const QUrl &relative) const if (!relative.d) return *this; QUrl t; - if (!relative.d->scheme.isEmpty()) { + // Compatibility hack (mostly for qtdeclarative) : treat "file:relative.txt" as relative even though QUrl::isRelative() says false + if (!relative.d->scheme.isEmpty() && (!relative.isLocalFile() || QDir::isAbsolutePath(relative.d->path))) { t = relative; t.detach(); } else { -- cgit v1.2.3 From 131b7c8f6467abe07143099aa8b85e594bb9111b Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 28 Jul 2016 08:41:05 +0200 Subject: Fix permissions on lock files on Unix We should create the files with 0666 and let the umask take care of adjusting to the final permissions in the file system. [ChangeLog][QtCore][QLockFile] Fixed permissions on lock files on Unix to allow for adjustments via umask. Change-Id: Iee6a6ac3920d0ffd4465f54ac6e955f7fe087173 Reviewed-by: Denis Shienkov Reviewed-by: Edward Welbourne Reviewed-by: Thiago Macieira Reviewed-by: David Faure --- src/corelib/io/qlockfile_unix.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/io') diff --git a/src/corelib/io/qlockfile_unix.cpp b/src/corelib/io/qlockfile_unix.cpp index 57c689ac81..7bef253e59 100644 --- a/src/corelib/io/qlockfile_unix.cpp +++ b/src/corelib/io/qlockfile_unix.cpp @@ -176,7 +176,7 @@ QLockFile::LockError QLockFilePrivate::tryLock_sys() % localHostName() % '\n'; const QByteArray lockFileName = QFile::encodeName(fileName); - const int fd = qt_safe_open(lockFileName.constData(), O_WRONLY | O_CREAT | O_EXCL, 0644); + const int fd = qt_safe_open(lockFileName.constData(), O_WRONLY | O_CREAT | O_EXCL, 0666); if (fd < 0) { switch (errno) { case EEXIST: @@ -217,7 +217,7 @@ QLockFile::LockError QLockFilePrivate::tryLock_sys() bool QLockFilePrivate::removeStaleLock() { const QByteArray lockFileName = QFile::encodeName(fileName); - const int fd = qt_safe_open(lockFileName.constData(), O_WRONLY, 0644); + const int fd = qt_safe_open(lockFileName.constData(), O_WRONLY, 0666); if (fd < 0) // gone already? return false; bool success = setNativeLocks(fileName, fd) && (::unlink(lockFileName) == 0); -- cgit v1.2.3 From b0abe20d4b05e9e1e0800b8be64df15fa1660367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 2 Nov 2015 10:49:17 +0100 Subject: Darwin: Add QImage::toCGImage() conversion function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (Move QT_FORWARD_DECLARE_CG to qglobal.h) This function converts to CGImage for supported formats. This is done by creating a CGImageRef that reuses the QImage data. The CGImage and QImage ref counting systems are bridged, implemented by using CGDataProvider that holds a copy of the QImage. Unlike the previous internal implementation this public version does not implicitly convert unsupported formats to ARGB32_Premultiplied. See included documentation for the complete description. Change-Id: Ie3984a7a8331e02a6f1c42943caaf76854e93538 Reviewed-by: Morten Johan Sørvig Reviewed-by: Gabriel de Dietrich --- src/corelib/io/qdebug.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/io') diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index 8021f29e16..abc2abeaec 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -438,8 +438,8 @@ inline QDebug operator<<(QDebug debug, const QFlags &flags) #define QT_FORWARD_DECLARE_CF_TYPE(type) Q_FORWARD_DECLARE_CF_TYPE(type); #define QT_FORWARD_DECLARE_MUTABLE_CF_TYPE(type) Q_FORWARD_DECLARE_MUTABLE_CF_TYPE(type); -#define QT_FORWARD_DECLARE_CG_TYPE(type) typedef const struct type *type ## Ref; -#define QT_FORWARD_DECLARE_MUTABLE_CG_TYPE(type) typedef struct type *type ## Ref; +#define QT_FORWARD_DECLARE_CG_TYPE(type) Q_FORWARD_DECLARE_CG_TYPE(type); +#define QT_FORWARD_DECLARE_MUTABLE_CG_TYPE(type) Q_FORWARD_DECLARE_MUTABLE_CG_TYPE(type); QT_END_NAMESPACE Q_FORWARD_DECLARE_CF_TYPE(CFString); -- cgit v1.2.3 From a2ae631c04fee752e492f2c0b8fd25f06abffd6b Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Wed, 3 Aug 2016 12:00:41 +0200 Subject: Doc: Change instances of '(Mac) OS X' to 'macOS' As of version 10.12 (Sierra), the name of Apple's desktop operating system will be macOS. Change the occurrences where the Mac platform is discussed to use a macro \macos, which expands to 'macOS'. This helps with adapting to future renaming. Update the instructions on mac-specific Q_OS_* macro usage. Add a \target for the old 'Qt for OS X' topic to keep links working for other documentation modules that try to link with the old name. Change-Id: Id33fb0cd985df702a4ae4efb4c5fd428e77d9b85 Reviewed-by: Leena Miettinen --- src/corelib/io/qabstractfileengine.cpp | 2 +- src/corelib/io/qfileinfo.cpp | 8 +++---- src/corelib/io/qfilesystemwatcher.cpp | 2 +- src/corelib/io/qiodevice.cpp | 2 +- src/corelib/io/qlockfile_unix.cpp | 2 +- src/corelib/io/qloggingcategory.cpp | 2 +- src/corelib/io/qprocess.cpp | 8 +++---- src/corelib/io/qsettings.cpp | 44 +++++++++++++++++----------------- src/corelib/io/qstandardpaths.cpp | 4 ++-- src/corelib/io/qstorageinfo.cpp | 2 +- 10 files changed, 38 insertions(+), 38 deletions(-) (limited to 'src/corelib/io') diff --git a/src/corelib/io/qabstractfileengine.cpp b/src/corelib/io/qabstractfileengine.cpp index 2ab789e0af..3f89dc1a07 100644 --- a/src/corelib/io/qabstractfileengine.cpp +++ b/src/corelib/io/qabstractfileengine.cpp @@ -299,7 +299,7 @@ QAbstractFileEngine *QAbstractFileEngine::create(const QString &fileName) the file system (i.e. not a file or directory). \value FileType The file is a regular file to the file system (i.e. not a link or directory) - \value BundleType OS X and iOS: the file is a bundle; implies DirectoryType + \value BundleType \macos and iOS: the file is a bundle; implies DirectoryType \value DirectoryType The file is a directory in the file system (i.e. not a link or file). diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index cb1ce6fd65..3458d5eb25 100644 --- a/src/corelib/io/qfileinfo.cpp +++ b/src/corelib/io/qfileinfo.cpp @@ -234,7 +234,7 @@ QDateTime &QFileInfoPrivate::getFileTime(QAbstractFileEngine::FileTime request) isSymLink(). The symLinkTarget() function provides the name of the file the symlink points to. - On Unix (including OS X and iOS), the symlink has the same size() has + On Unix (including \macos and iOS), the symlink has the same size() has the file it points to, because Unix handles symlinks transparently; similarly, opening a symlink using QFile effectively opens the link's target. For example: @@ -754,7 +754,7 @@ QString QFileInfo::fileName() const \since 4.3 Returns the name of the bundle. - On OS X and iOS this returns the proper localized name for a bundle if the + On \macos and iOS this returns the proper localized name for a bundle if the path isBundle(). On all other platforms an empty QString is returned. Example: @@ -1036,7 +1036,7 @@ bool QFileInfo::isDir() const /*! \since 4.3 Returns \c true if this object points to a bundle or to a symbolic - link to a bundle on OS X and iOS; otherwise returns \c false. + link to a bundle on \macos and iOS; otherwise returns \c false. \sa isDir(), isSymLink(), isFile() */ @@ -1057,7 +1057,7 @@ bool QFileInfo::isBundle() const Returns \c true if this object points to a symbolic link (or to a shortcut on Windows); otherwise returns \c false. - On Unix (including OS X and iOS), opening a symlink effectively opens + On Unix (including \macos and iOS), opening a symlink effectively opens the \l{symLinkTarget()}{link's target}. On Windows, it opens the \c .lnk file itself. diff --git a/src/corelib/io/qfilesystemwatcher.cpp b/src/corelib/io/qfilesystemwatcher.cpp index d8564c4c40..52ba1b5977 100644 --- a/src/corelib/io/qfilesystemwatcher.cpp +++ b/src/corelib/io/qfilesystemwatcher.cpp @@ -185,7 +185,7 @@ void QFileSystemWatcherPrivate::_q_directoryChanged(const QString &path, bool re the file system monitor. Also note that your process may have other file descriptors open in addition to the ones for files being monitored, and these other open descriptors also count in - the total. OS X uses a different backend and does not + the total. \macos uses a different backend and does not suffer from this issue. diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp index eba38d06d6..2b95a757a7 100644 --- a/src/corelib/io/qiodevice.cpp +++ b/src/corelib/io/qiodevice.cpp @@ -688,7 +688,7 @@ bool QIODevice::seek(qint64 pos) For some devices, atEnd() can return true even though there is more data to read. This special case only applies to devices that generate data in direct response to you calling read() (e.g., \c /dev or \c /proc files on - Unix and OS X, or console input / \c stdin on all platforms). + Unix and \macos, or console input / \c stdin on all platforms). \sa bytesAvailable(), read(), isSequential() */ diff --git a/src/corelib/io/qlockfile_unix.cpp b/src/corelib/io/qlockfile_unix.cpp index 7bef253e59..82aefcc4ce 100644 --- a/src/corelib/io/qlockfile_unix.cpp +++ b/src/corelib/io/qlockfile_unix.cpp @@ -129,7 +129,7 @@ static QBasicMutex fcntlLock; /*! \internal Checks that the OS isn't using POSIX locks to emulate flock(). - OS X is one of those. + \macos is one of those. */ static bool fcntlWorksAfterFlock(const QString &fn) { diff --git a/src/corelib/io/qloggingcategory.cpp b/src/corelib/io/qloggingcategory.cpp index a0c6f4a6f4..9df7d23f4c 100644 --- a/src/corelib/io/qloggingcategory.cpp +++ b/src/corelib/io/qloggingcategory.cpp @@ -177,7 +177,7 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift) by QStandardPaths::GenericConfigLocation, e.g. \list - \li on OS X and iOS: \c ~/Library/Preferences + \li on \macos and iOS: \c ~/Library/Preferences \li on Unix: \c ~/.config, \c /etc/xdg \li on Windows: \c %LOCALAPPDATA%, \c %ProgramData%, \l QCoreApplication::applicationDirPath(), diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index 6e1a771258..9dba96b1da 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -1892,7 +1892,7 @@ void QProcess::setProcessState(ProcessState state) /*! This function is called in the child process context just before the - program is executed on Unix or OS X (i.e., after \c fork(), but before + program is executed on Unix or \macos (i.e., after \c fork(), but before \c execve()). Reimplement this function to do last minute initialization of the child process. Example: @@ -1903,7 +1903,7 @@ void QProcess::setProcessState(ProcessState state) execution, your workaround is to emit finished() and then call exit(). - \warning This function is called by QProcess on Unix and OS X + \warning This function is called by QProcess on Unix and \macos only. On Windows and QNX, it is not called. */ void QProcess::setupChildProcess() @@ -2357,7 +2357,7 @@ void QProcess::setArguments(const QStringList &arguments) On Windows, terminate() posts a WM_CLOSE message to all top-level windows of the process and then to the main thread of the process itself. On Unix - and OS X the \c SIGTERM signal is sent. + and \macos the \c SIGTERM signal is sent. Console applications on Windows that do not run an event loop, or whose event loop does not handle the WM_CLOSE message, can only be terminated by @@ -2374,7 +2374,7 @@ void QProcess::terminate() /*! Kills the current process, causing it to exit immediately. - On Windows, kill() uses TerminateProcess, and on Unix and OS X, the + On Windows, kill() uses TerminateProcess, and on Unix and \macos, the SIGKILL signal is sent to the process. \sa terminate() diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index 1c7ceed3c1..64a7b9529b 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -1951,7 +1951,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, Users normally expect an application to remember its settings (window sizes and positions, options, etc.) across sessions. This information is often stored in the system registry on Windows, - and in property list files on OS X and iOS. On Unix systems, in the + and in property list files on \macos and iOS. On Unix systems, in the absence of a standard, many applications (including the KDE applications) use INI text files. @@ -1996,8 +1996,8 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, \snippet settings/settings.cpp 4 (Here, we also specify the organization's Internet domain. When - the Internet domain is set, it is used on OS X and iOS instead of the - organization name, since OS X and iOS applications conventionally use + the Internet domain is set, it is used on \macos and iOS instead of the + organization name, since \macos and iOS applications conventionally use Internet domains to identify themselves. If no domain is set, a fake domain is derived from the organization name. See the \l{Platform-Specific Notes} below for details.) @@ -2055,7 +2055,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, Setting keys can contain any Unicode characters. The Windows registry and INI files use case-insensitive keys, whereas the - CFPreferences API on OS X and iOS uses case-sensitive keys. To + CFPreferences API on \macos and iOS uses case-sensitive keys. To avoid portability problems, follow these simple rules: \list 1 @@ -2229,7 +2229,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, \li \c{/etc/xdg/MySoft.conf} \endlist - On Mac OS X versions 10.2 and 10.3, these files are used by + On \macos versions 10.2 and 10.3, these files are used by default: \list 1 @@ -2258,7 +2258,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, in the application's home directory. If the file format is IniFormat, the following files are - used on Unix, OS X, and iOS: + used on Unix, \macos, and iOS: \list 1 \li \c{$HOME/.config/MySoft/Star Runner.ini} (Qt for Embedded Linux: \c{$HOME/Settings/MySoft/Star Runner.ini}) @@ -2286,7 +2286,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, in the application's home directory. The paths for the \c .ini and \c .conf files can be changed using - setPath(). On Unix, OS X, and iOS the user can override them by + setPath(). On Unix, \macos, and iOS the user can override them by setting the \c XDG_CONFIG_HOME environment variable; see setPath() for details. @@ -2303,7 +2303,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, You can then use the QSettings object to read and write settings in the file. - On OS X and iOS, you can access property list \c .plist files by passing + On \macos and iOS, you can access property list \c .plist files by passing QSettings::NativeFormat as second argument. For example: \snippet code/src_corelib_io_qsettings.cpp 3 @@ -2357,13 +2357,13 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, limitations is to store the settings using the IniFormat instead of the NativeFormat. - \li On OS X and iOS, allKeys() will return some extra keys for global + \li On \macos and iOS, allKeys() will return some extra keys for global settings that apply to all applications. These keys can be read using value() but cannot be changed, only shadowed. Calling setFallbacksEnabled(false) will hide these global settings. - \li On OS X and iOS, the CFPreferences API used by QSettings expects + \li On \macos and iOS, the CFPreferences API used by QSettings expects Internet domain names rather than organization names. To provide a uniform API, QSettings derives a fake domain name from the organization name (unless the organization name @@ -2380,7 +2380,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, \snippet code/src_corelib_io_qsettings.cpp 7 - \li On OS X, permissions to access settings not belonging to the + \li On \macos, permissions to access settings not belonging to the current user (i.e. SystemScope) have changed with 10.7 (Lion). Prior to that version, users having admin rights could access these. For 10.7 and 10.8 (Mountain Lion), only root can. However, 10.9 (Mavericks) changes @@ -2420,7 +2420,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, \value NativeFormat Store the settings using the most appropriate storage format for the platform. On Windows, this means the system registry; - on OS X and iOS, this means the CFPreferences + on \macos and iOS, this means the CFPreferences API; on Unix, this means textual configuration files in INI format. \value IniFormat Store the settings in INI files. @@ -2583,7 +2583,7 @@ QSettings::QSettings(Format format, Scope scope, const QString &organization, If \a format is QSettings::NativeFormat, the meaning of \a fileName depends on the platform. On Unix, \a fileName is the - name of an INI file. On OS X and iOS, \a fileName is the name of a + name of an INI file. On \macos and iOS, \a fileName is the name of a \c .plist file. On Windows, \a fileName is a path in the system registry. @@ -2636,7 +2636,7 @@ QSettings::QSettings(const QString &fileName, Format format, QObject *parent) called, the QSettings object will not be able to read or write any settings, and status() will return AccessError. - On OS X and iOS, if both a name and an Internet domain are specified + On \macos and iOS, if both a name and an Internet domain are specified for the organization, the domain is preferred over the name. On other platforms, the name is preferred over the domain. @@ -3152,7 +3152,7 @@ bool QSettings::isWritable() const exists, the previous value is overwritten. Note that the Windows registry and INI files use case-insensitive - keys, whereas the CFPreferences API on OS X and iOS uses + keys, whereas the CFPreferences API on \macos and iOS uses case-sensitive keys. To avoid portability problems, see the \l{Section and Key Syntax} rules. @@ -3191,7 +3191,7 @@ void QSettings::setValue(const QString &key, const QVariant &value) \snippet code/src_corelib_io_qsettings.cpp 25 Note that the Windows registry and INI files use case-insensitive - keys, whereas the CFPreferences API on OS X and iOS uses + keys, whereas the CFPreferences API on \macos and iOS uses case-sensitive keys. To avoid portability problems, see the \l{Section and Key Syntax} rules. @@ -3226,7 +3226,7 @@ void QSettings::remove(const QString &key) relative to that group. Note that the Windows registry and INI files use case-insensitive - keys, whereas the CFPreferences API on OS X and iOS uses + keys, whereas the CFPreferences API on \macos and iOS uses case-sensitive keys. To avoid portability problems, see the \l{Section and Key Syntax} rules. @@ -3288,7 +3288,7 @@ bool QSettings::event(QEvent *event) returned. Note that the Windows registry and INI files use case-insensitive - keys, whereas the CFPreferences API on OS X and iOS uses + keys, whereas the CFPreferences API on \macos and iOS uses case-sensitive keys. To avoid portability problems, see the \l{Section and Key Syntax} rules. @@ -3391,18 +3391,18 @@ void QSettings::setUserIniPath(const QString &dir) \row \li SystemScope \li \c /etc/xdg \row \li{1,2} Qt for Embedded Linux \li{1,2} NativeFormat, IniFormat \li UserScope \li \c $HOME/Settings \row \li SystemScope \li \c /etc/xdg - \row \li{1,2} OS X and iOS \li{1,2} IniFormat \li UserScope \li \c $HOME/.config + \row \li{1,2} \macos and iOS \li{1,2} IniFormat \li UserScope \li \c $HOME/.config \row \li SystemScope \li \c /etc/xdg \endtable - The default UserScope paths on Unix, OS X, and iOS (\c + The default UserScope paths on Unix, \macos, and iOS (\c $HOME/.config or $HOME/Settings) can be overridden by the user by setting the \c XDG_CONFIG_HOME environment variable. The default SystemScope - paths on Unix, OS X, and iOS (\c /etc/xdg) can be overridden when + paths on Unix, \macos, and iOS (\c /etc/xdg) can be overridden when building the Qt library using the \c configure script's \c -sysconfdir flag (see QLibraryInfo for details). - Setting the NativeFormat paths on Windows, OS X, and iOS has no + Setting the NativeFormat paths on Windows, \macos, and iOS has no effect. \warning This function doesn't affect existing QSettings objects. diff --git a/src/corelib/io/qstandardpaths.cpp b/src/corelib/io/qstandardpaths.cpp index 8828e09e8f..bb4721c55b 100644 --- a/src/corelib/io/qstandardpaths.cpp +++ b/src/corelib/io/qstandardpaths.cpp @@ -146,7 +146,7 @@ QT_BEGIN_NAMESPACE paths, if any, represent non-writable locations. \table - \header \li Path type \li OS X \li Windows + \header \li Path type \li \macos \li Windows \row \li DesktopLocation \li "~/Desktop" \li "C:/Users//Desktop" @@ -622,7 +622,7 @@ QString QStandardPaths::displayName(StandardLocation type) On Unix, \c XDG_DATA_HOME is set to \e ~/.qttest/share, \c XDG_CONFIG_HOME is set to \e ~/.qttest/config, and \c XDG_CACHE_HOME is set to \e ~/.qttest/cache. - On OS X, data goes to \e ~/.qttest/Application Support, cache goes to + On \macos, data goes to \e ~/.qttest/Application Support, cache goes to \e ~/.qttest/Cache, and config goes to \e ~/.qttest/Preferences. On Windows, everything goes to a "qttest" directory under Application Data. diff --git a/src/corelib/io/qstorageinfo.cpp b/src/corelib/io/qstorageinfo.cpp index 99a2a1a42a..e14c954e56 100644 --- a/src/corelib/io/qstorageinfo.cpp +++ b/src/corelib/io/qstorageinfo.cpp @@ -250,7 +250,7 @@ QByteArray QStorageInfo::fileSystemType() const /*! Returns the device for this volume. - For example, on Unix filesystems (including OS X), this returns the + For example, on Unix filesystems (including \macos), this returns the devpath like \c /dev/sda0 for local storages. On Windows, it returns the UNC path starting with \c \\\\?\\ for local storages (in other words, the volume GUID). -- cgit v1.2.3 From af87bf4b148c1d583fe9dbbea5e57df6e49e8d7b Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 15 Jul 2016 16:58:08 +0200 Subject: Register QStandardPaths enums & flags This allows QML StandardPaths to use the same enums without having to duplicate them. Change-Id: Ibfc63a97a8ba31e5c4dc11e3e8fee9d753087c54 Reviewed-by: Thiago Macieira Reviewed-by: Simon Hausmann --- src/corelib/io/qstandardpaths.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/corelib/io') diff --git a/src/corelib/io/qstandardpaths.h b/src/corelib/io/qstandardpaths.h index fff1a29bf3..58f228d02b 100644 --- a/src/corelib/io/qstandardpaths.h +++ b/src/corelib/io/qstandardpaths.h @@ -41,6 +41,7 @@ #define QSTANDARDPATHS_H #include +#include QT_BEGIN_NAMESPACE @@ -49,6 +50,8 @@ QT_BEGIN_NAMESPACE class Q_CORE_EXPORT QStandardPaths { + Q_GADGET + public: // Do not re-order, must match QDesktopServices enum StandardLocation { @@ -73,6 +76,7 @@ public: AppConfigLocation, AppLocalDataLocation = DataLocation }; + Q_ENUM(StandardLocation) static QString writableLocation(StandardLocation type); static QStringList standardLocations(StandardLocation type); @@ -82,6 +86,7 @@ public: LocateDirectory = 0x1 }; Q_DECLARE_FLAGS(LocateOptions, LocateOption) + Q_FLAG(LocateOptions) static QString locate(StandardLocation type, const QString &fileName, LocateOptions options = LocateFile); static QStringList locateAll(StandardLocation type, const QString &fileName, LocateOptions options = LocateFile); -- cgit v1.2.3 From 906fc0f5e394d4d765cb714a52ea46643abcec1e Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sun, 14 Aug 2016 17:23:35 +0200 Subject: Add Q_DECLARE_OPERATORS_FOR_FLAGS(QStandardPaths::LocateOptions) QStandardPaths::LocateOptions was declared with Q_DECLARE_FLAGS(), but missing Q_DECLARE_OPERATORS_FOR_FLAGS(). Change-Id: Id4ab1b1c86cdc9e79fb324d9b9d4d8deb659f718 Reviewed-by: Simon Hausmann --- src/corelib/io/qstandardpaths.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/corelib/io') diff --git a/src/corelib/io/qstandardpaths.h b/src/corelib/io/qstandardpaths.h index 58f228d02b..df76d73eae 100644 --- a/src/corelib/io/qstandardpaths.h +++ b/src/corelib/io/qstandardpaths.h @@ -108,6 +108,8 @@ private: ~QStandardPaths(); }; +Q_DECLARE_OPERATORS_FOR_FLAGS(QStandardPaths::LocateOptions) + #endif // QT_NO_STANDARDPATHS QT_END_NAMESPACE -- cgit v1.2.3 From 8617ce5c881c7913e144153494b15d60ca0c0e83 Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Mon, 11 Jul 2016 16:08:00 +0300 Subject: Use QStringRef() more, exploiting its new ::chop() Change-Id: Id2201639be604b9a32b2dc5d21e675a961bee477 Reviewed-by: Edward Welbourne Reviewed-by: Thiago Macieira --- src/corelib/io/qurl.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'src/corelib/io') diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 9cf1be58d8..42a742213b 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -833,7 +833,7 @@ recodeFromUser(const QString &input, const ushort *actions, int from, int to) // appendXXXX functions: copy from the internal form to the external, user form. // the internal value is stored in its PrettyDecoded form, so that case is easy. -static inline void appendToUser(QString &appendTo, const QString &value, QUrl::FormattingOptions options, +static inline void appendToUser(QString &appendTo, const QStringRef &value, QUrl::FormattingOptions options, const ushort *actions) { if (options == QUrl::PrettyDecoded) { @@ -841,10 +841,17 @@ static inline void appendToUser(QString &appendTo, const QString &value, QUrl::F return; } - if (!qt_urlRecode(appendTo, value.constData(), value.constEnd(), options, actions)) + if (!qt_urlRecode(appendTo, value.data(), value.end(), options, actions)) appendTo += value; } +static inline void appendToUser(QString &appendTo, const QString &value, QUrl::FormattingOptions options, + const ushort *actions) +{ + appendToUser(appendTo, QStringRef(&value), options, actions); +} + + inline void QUrlPrivate::appendAuthority(QString &appendTo, QUrl::FormattingOptions options, Section appendingTo) const { if ((options & QUrl::RemoveUserInfo) != QUrl::RemoveUserInfo) { @@ -924,21 +931,22 @@ inline void QUrlPrivate::appendPath(QString &appendTo, QUrl::FormattingOptions o if (options & QUrl::NormalizePathSegments) { thePath = qt_normalizePathSegments(path, false); } + + QStringRef thePathRef(&thePath); if (options & QUrl::RemoveFilename) { const int slash = path.lastIndexOf(QLatin1Char('/')); if (slash == -1) return; - thePath = path.left(slash+1); + thePathRef = path.leftRef(slash + 1); } // check if we need to remove trailing slashes if (options & QUrl::StripTrailingSlash) { - while (thePath.length() > 1 && thePath.endsWith(QLatin1Char('/'))) - thePath.chop(1); + while (thePathRef.length() > 1 && thePathRef.endsWith(QLatin1Char('/'))) + thePathRef.chop(1); } - appendToUser(appendTo, thePath, options, + appendToUser(appendTo, thePathRef, options, appendingTo == FullUrl || options & QUrl::EncodeDelimiters ? pathInUrl : pathInIsolation); - } inline void QUrlPrivate::appendFragment(QString &appendTo, QUrl::FormattingOptions options, Section appendingTo) const -- cgit v1.2.3 From 60985aa42b37217fb4c01ed85bbf6f14410c3491 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 5 Aug 2016 13:35:39 +0200 Subject: Use qtConfig throughout in qtbase Use the new qtConfig macro in all pro/pri files. This required adding some feature entries, and adding {private,public}Feature to every referenced already existing entry. Change-Id: I164214dad1154df6ad84e86d99ed14994ef97cf4 Reviewed-by: Lars Knoll Reviewed-by: Oswald Buddenhagen --- src/corelib/io/io.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/io') diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri index ab345e9aae..cc658afa94 100644 --- a/src/corelib/io/io.pri +++ b/src/corelib/io/io.pri @@ -169,7 +169,7 @@ win32 { io/qstorageinfo_unix.cpp } - linux|if(qnx:contains(QT_CONFIG, inotify)) { + linux|if(qnx:qtConfig(inotify)) { SOURCES += io/qfilesystemwatcher_inotify.cpp HEADERS += io/qfilesystemwatcher_inotify_p.h } -- cgit v1.2.3 From 57378a108ca488cbf5cfaa32590fc762dcbf3315 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Thu, 19 May 2016 23:01:59 -0700 Subject: Add support for Apple watchOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I3f9e00569458a463af2eaa5a3a16a6afd1e9c1ea Reviewed-by: Tor Arne Vestbø --- src/corelib/io/io.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/io') diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri index cc658afa94..0414ae966a 100644 --- a/src/corelib/io/io.pri +++ b/src/corelib/io/io.pri @@ -135,7 +135,7 @@ win32 { io/qprocess_unix.cpp \ io/qfilesystemiterator_unix.cpp - !integrity:!tvos { + !integrity:!uikit { SOURCES += io/forkfd_qt.cpp HEADERS += \ ../3rdparty/forkfd/forkfd.h -- cgit v1.2.3