Merge "Merge remote-tracking branch 'origin/5.12' into 5.13"
This commit is contained in:
commit
75f51d2f40
@ -498,21 +498,20 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
|
|||||||
// Make sure we keep the dependency order of libraries
|
// Make sure we keep the dependency order of libraries
|
||||||
lflags[arch].removeAll(opt);
|
lflags[arch].removeAll(opt);
|
||||||
lflags[arch].append(opt);
|
lflags[arch].append(opt);
|
||||||
} else if (target_mode == TARG_MAC_MODE && opt.startsWith("-framework")) {
|
} else if (target_mode == TARG_MAC_MODE
|
||||||
if (opt.length() > 10) {
|
&& (opt == "-framework" || opt == "-force_load")) {
|
||||||
opt = opt.mid(10).trimmed();
|
// Handle space separated options
|
||||||
} else {
|
ProString dashOpt = opt;
|
||||||
opt = l.at(++lit);
|
opt = l.at(++lit);
|
||||||
if (opt.startsWith("-Xarch"))
|
if (opt.startsWith("-Xarch"))
|
||||||
opt = l.at(++lit); // The user has done the right thing and prefixed each part
|
opt = l.at(++lit); // The user has done the right thing and prefixed each part
|
||||||
}
|
|
||||||
for(int x = 0; x < lflags[arch].size(); ++x) {
|
for(int x = 0; x < lflags[arch].size(); ++x) {
|
||||||
if (lflags[arch].at(x) == "-framework" && lflags[arch].at(++x) == opt) {
|
if (lflags[arch].at(x) == dashOpt && lflags[arch].at(++x) == opt) {
|
||||||
lflags[arch].remove(x - 1, 2);
|
lflags[arch].remove(x - 1, 2);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lflags[arch].append("-framework");
|
lflags[arch].append(dashOpt);
|
||||||
lflags[arch].append(opt);
|
lflags[arch].append(opt);
|
||||||
} else {
|
} else {
|
||||||
lflags[arch].append(opt);
|
lflags[arch].append(opt);
|
||||||
|
@ -167,19 +167,21 @@ QFSFileEngine::QFSFileEngine(QFSFileEnginePrivate &dd)
|
|||||||
/*!
|
/*!
|
||||||
\internal
|
\internal
|
||||||
*/
|
*/
|
||||||
bool QFSFileEngine::processOpenModeFlags(QIODevice::OpenMode *mode)
|
ProcessOpenModeResult processOpenModeFlags(QIODevice::OpenMode openMode)
|
||||||
{
|
{
|
||||||
QIODevice::OpenMode &openMode = *mode;
|
ProcessOpenModeResult result;
|
||||||
|
result.ok = false;
|
||||||
if ((openMode & QFile::NewOnly) && (openMode & QFile::ExistingOnly)) {
|
if ((openMode & QFile::NewOnly) && (openMode & QFile::ExistingOnly)) {
|
||||||
qWarning("NewOnly and ExistingOnly are mutually exclusive");
|
qWarning("NewOnly and ExistingOnly are mutually exclusive");
|
||||||
setError(QFile::OpenError, QLatin1String("NewOnly and ExistingOnly are mutually exclusive"));
|
result.error = QLatin1String("NewOnly and ExistingOnly are mutually exclusive");
|
||||||
return false;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((openMode & QFile::ExistingOnly) && !(openMode & (QFile::ReadOnly | QFile::WriteOnly))) {
|
if ((openMode & QFile::ExistingOnly) && !(openMode & (QFile::ReadOnly | QFile::WriteOnly))) {
|
||||||
qWarning("ExistingOnly must be specified alongside ReadOnly, WriteOnly, or ReadWrite");
|
qWarning("ExistingOnly must be specified alongside ReadOnly, WriteOnly, or ReadWrite");
|
||||||
setError(QFile::OpenError, QLatin1String("ExistingOnly must be specified alongside ReadOnly, WriteOnly, or ReadWrite"));
|
result.error = QLatin1String(
|
||||||
return false;
|
"ExistingOnly must be specified alongside ReadOnly, WriteOnly, or ReadWrite");
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Either Append or NewOnly implies WriteOnly
|
// Either Append or NewOnly implies WriteOnly
|
||||||
@ -190,7 +192,9 @@ bool QFSFileEngine::processOpenModeFlags(QIODevice::OpenMode *mode)
|
|||||||
if ((openMode & QFile::WriteOnly) && !(openMode & (QFile::ReadOnly | QFile::Append | QFile::NewOnly)))
|
if ((openMode & QFile::WriteOnly) && !(openMode & (QFile::ReadOnly | QFile::Append | QFile::NewOnly)))
|
||||||
openMode |= QFile::Truncate;
|
openMode |= QFile::Truncate;
|
||||||
|
|
||||||
return true;
|
result.ok = true;
|
||||||
|
result.openMode = openMode;
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -234,16 +238,19 @@ bool QFSFileEngine::open(QIODevice::OpenMode openMode)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!processOpenModeFlags(&openMode))
|
const ProcessOpenModeResult res = processOpenModeFlags(openMode);
|
||||||
|
if (!res.ok) {
|
||||||
|
setError(QFileDevice::OpenError, res.error);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
d->openMode = openMode;
|
d->openMode = res.openMode;
|
||||||
d->lastFlushFailed = false;
|
d->lastFlushFailed = false;
|
||||||
d->tried_stat = 0;
|
d->tried_stat = 0;
|
||||||
d->fh = 0;
|
d->fh = 0;
|
||||||
d->fd = -1;
|
d->fd = -1;
|
||||||
|
|
||||||
return d->nativeOpen(openMode);
|
return d->nativeOpen(d->openMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -262,17 +269,20 @@ bool QFSFileEngine::open(QIODevice::OpenMode openMode, FILE *fh, QFile::FileHand
|
|||||||
|
|
||||||
Q_D(QFSFileEngine);
|
Q_D(QFSFileEngine);
|
||||||
|
|
||||||
if (!processOpenModeFlags(&openMode))
|
const ProcessOpenModeResult res = processOpenModeFlags(openMode);
|
||||||
|
if (!res.ok) {
|
||||||
|
setError(QFileDevice::OpenError, res.error);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
d->openMode = openMode;
|
d->openMode = res.openMode;
|
||||||
d->lastFlushFailed = false;
|
d->lastFlushFailed = false;
|
||||||
d->closeFileHandle = (handleFlags & QFile::AutoCloseHandle);
|
d->closeFileHandle = (handleFlags & QFile::AutoCloseHandle);
|
||||||
d->fileEntry.clear();
|
d->fileEntry.clear();
|
||||||
d->tried_stat = 0;
|
d->tried_stat = 0;
|
||||||
d->fd = -1;
|
d->fd = -1;
|
||||||
|
|
||||||
return d->openFh(openMode, fh);
|
return d->openFh(d->openMode, fh);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -321,10 +331,13 @@ bool QFSFileEngine::open(QIODevice::OpenMode openMode, int fd, QFile::FileHandle
|
|||||||
{
|
{
|
||||||
Q_D(QFSFileEngine);
|
Q_D(QFSFileEngine);
|
||||||
|
|
||||||
if (!processOpenModeFlags(&openMode))
|
const ProcessOpenModeResult res = processOpenModeFlags(openMode);
|
||||||
|
if (!res.ok) {
|
||||||
|
setError(QFileDevice::OpenError, res.error);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
d->openMode = openMode;
|
d->openMode = res.openMode;
|
||||||
d->lastFlushFailed = false;
|
d->lastFlushFailed = false;
|
||||||
d->closeFileHandle = (handleFlags & QFile::AutoCloseHandle);
|
d->closeFileHandle = (handleFlags & QFile::AutoCloseHandle);
|
||||||
d->fileEntry.clear();
|
d->fileEntry.clear();
|
||||||
@ -332,7 +345,7 @@ bool QFSFileEngine::open(QIODevice::OpenMode openMode, int fd, QFile::FileHandle
|
|||||||
d->fd = -1;
|
d->fd = -1;
|
||||||
d->tried_stat = 0;
|
d->tried_stat = 0;
|
||||||
|
|
||||||
return d->openFd(openMode, fd);
|
return d->openFd(d->openMode, fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,6 +61,13 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
struct ProcessOpenModeResult {
|
||||||
|
bool ok;
|
||||||
|
QIODevice::OpenMode openMode;
|
||||||
|
QString error;
|
||||||
|
};
|
||||||
|
inline Q_CORE_EXPORT ProcessOpenModeResult processOpenModeFlags(QIODevice::OpenMode mode);
|
||||||
|
|
||||||
class QFSFileEnginePrivate;
|
class QFSFileEnginePrivate;
|
||||||
|
|
||||||
class Q_CORE_EXPORT QFSFileEngine : public QAbstractFileEngine
|
class Q_CORE_EXPORT QFSFileEngine : public QAbstractFileEngine
|
||||||
@ -131,9 +138,6 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
QFSFileEngine(QFSFileEnginePrivate &dd);
|
QFSFileEngine(QFSFileEnginePrivate &dd);
|
||||||
|
|
||||||
private:
|
|
||||||
inline bool processOpenModeFlags(QIODevice::OpenMode *mode);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class Q_AUTOTEST_EXPORT QFSFileEnginePrivate : public QAbstractFileEnginePrivate
|
class Q_AUTOTEST_EXPORT QFSFileEnginePrivate : public QAbstractFileEnginePrivate
|
||||||
|
@ -1648,6 +1648,9 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel)
|
|||||||
[nsWindow setDepthLimit:NSWindowDepthTwentyfourBitRGB];
|
[nsWindow setDepthLimit:NSWindowDepthTwentyfourBitRGB];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (format().colorSpace() == QSurfaceFormat::sRGBColorSpace)
|
||||||
|
nsWindow.colorSpace = NSColorSpace.sRGBColorSpace;
|
||||||
|
|
||||||
return nsWindow;
|
return nsWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
#include <QtCore/QCoreApplication>
|
#include <QtCore/QCoreApplication>
|
||||||
#include <QtCore/QHash>
|
#include <QtCore/QHash>
|
||||||
#include <QtCore/qfunctions_winrt.h>
|
#include <QtCore/qfunctions_winrt.h>
|
||||||
|
#include <QtCore/private/qfsfileengine_p.h>
|
||||||
|
|
||||||
#include <wrl.h>
|
#include <wrl.h>
|
||||||
#include <windows.storage.h>
|
#include <windows.storage.h>
|
||||||
@ -196,7 +197,19 @@ bool QWinRTFileEngine::open(QIODevice::OpenMode openMode)
|
|||||||
hr = QWinRTFunctions::await(op, d->stream.GetAddressOf());
|
hr = QWinRTFunctions::await(op, d->stream.GetAddressOf());
|
||||||
RETURN_AND_SET_ERROR_IF_FAILED(QFileDevice::OpenError, false);
|
RETURN_AND_SET_ERROR_IF_FAILED(QFileDevice::OpenError, false);
|
||||||
|
|
||||||
d->openMode = openMode;
|
const ProcessOpenModeResult res = processOpenModeFlags(openMode);
|
||||||
|
if (!res.ok) {
|
||||||
|
setError(QFileDevice::OpenError, res.error);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
d->openMode = res.openMode;
|
||||||
|
if (d->openMode & QIODevice::Truncate) {
|
||||||
|
if (!setSize(0)) {
|
||||||
|
close();
|
||||||
|
setError(QFileDevice::OpenError, QLatin1String("Could not truncate file"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return SUCCEEDED(hr);
|
return SUCCEEDED(hr);
|
||||||
}
|
}
|
||||||
@ -257,6 +270,29 @@ qint64 QWinRTFileEngine::size() const
|
|||||||
return qint64(size);
|
return qint64(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QWinRTFileEngine::setSize(qint64 size)
|
||||||
|
{
|
||||||
|
Q_D(QWinRTFileEngine);
|
||||||
|
if (!d->stream) {
|
||||||
|
setError(QFileDevice::ResizeError, QLatin1String("File must be open to be resized"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (size < 0) {
|
||||||
|
setError(QFileDevice::ResizeError, QLatin1String("File size cannot be negative"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT hr = d->stream->put_Size(static_cast<quint64>(size));
|
||||||
|
RETURN_AND_SET_ERROR_IF_FAILED(QFileDevice::ResizeError, false);
|
||||||
|
if (!flush()) {
|
||||||
|
setError(QFileDevice::ResizeError, QLatin1String("Could not flush file"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
qint64 QWinRTFileEngine::pos() const
|
qint64 QWinRTFileEngine::pos() const
|
||||||
{
|
{
|
||||||
Q_D(const QWinRTFileEngine);
|
Q_D(const QWinRTFileEngine);
|
||||||
|
@ -79,6 +79,7 @@ public:
|
|||||||
bool close() override;
|
bool close() override;
|
||||||
bool flush() override;
|
bool flush() override;
|
||||||
qint64 size() const override;
|
qint64 size() const override;
|
||||||
|
bool setSize(qint64 size) override;
|
||||||
qint64 pos() const override;
|
qint64 pos() const override;
|
||||||
bool seek(qint64 pos) override;
|
bool seek(qint64 pos) override;
|
||||||
bool remove() override;
|
bool remove() override;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user