Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I34a71ddbc6afb1f12a0a044d0d3876e1af58d60c
This commit is contained in:
commit
34adcabc6c
@ -405,8 +405,12 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
|
||||
!!ENDIF
|
||||
endif()
|
||||
|
||||
!!IF equals(TEMPLATE, aux)
|
||||
add_library(Qt5::$${CMAKE_MODULE_NAME} INTERFACE IMPORTED)
|
||||
!!ELSE
|
||||
add_library(Qt5::$${CMAKE_MODULE_NAME} STATIC IMPORTED)
|
||||
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY IMPORTED_LINK_INTERFACE_LANGUAGES "CXX")
|
||||
!!ENDIF
|
||||
!!ELSE
|
||||
!!IF equals(TEMPLATE, aux)
|
||||
add_library(Qt5::$${CMAKE_MODULE_NAME} INTERFACE IMPORTED)
|
||||
|
@ -389,7 +389,8 @@
|
||||
"# Block futimens() on Apple platforms unless it's available on ALL",
|
||||
"# deployment targets. This simplifies the logic at the call site",
|
||||
"# dramatically, as it isn't strictly needed compared to futimes().",
|
||||
"darwin: QMAKE_CXXFLAGS += -Werror=unguarded-availability"
|
||||
"darwin: QMAKE_CXXFLAGS += -Werror=unguarded-availability -Werror=unguarded-availability-new",
|
||||
"CONFIG += warn_on"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -576,9 +576,7 @@ bool QLibraryPrivate::load()
|
||||
|
||||
Q_TRACE(QLibraryPrivate_load_entry, fileName);
|
||||
|
||||
mutex.lock();
|
||||
bool ret = load_sys();
|
||||
mutex.unlock();
|
||||
if (qt_debug_component()) {
|
||||
if (ret) {
|
||||
qDebug() << "loaded library" << fileName;
|
||||
|
@ -123,6 +123,7 @@ QStringList QLibraryPrivate::prefixes_sys()
|
||||
|
||||
bool QLibraryPrivate::load_sys()
|
||||
{
|
||||
QMutexLocker locker(&mutex);
|
||||
QString attempt;
|
||||
QFileSystemEntry fsEntry(fileName);
|
||||
|
||||
@ -213,6 +214,7 @@ bool QLibraryPrivate::load_sys()
|
||||
}
|
||||
#endif
|
||||
|
||||
locker.unlock();
|
||||
bool retry = true;
|
||||
Handle hnd = nullptr;
|
||||
for (int prefix = 0; retry && !hnd && prefix < prefixes.size(); prefix++) {
|
||||
@ -273,6 +275,8 @@ bool QLibraryPrivate::load_sys()
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
locker.relock();
|
||||
if (!hnd) {
|
||||
errorString = QLibrary::tr("Cannot load library %1: %2").arg(fileName, qdlerror());
|
||||
}
|
||||
|
@ -78,6 +78,7 @@ bool QLibraryPrivate::load_sys()
|
||||
// fileName
|
||||
//
|
||||
// NB If it's a plugin we do not ever try the ".dll" extension
|
||||
QMutexLocker locker(&mutex);
|
||||
QStringList attempts;
|
||||
|
||||
if (pluginState != IsAPlugin)
|
||||
@ -95,6 +96,7 @@ bool QLibraryPrivate::load_sys()
|
||||
attempts.prepend(QDir::rootPath() + fileName);
|
||||
#endif
|
||||
|
||||
locker.unlock();
|
||||
Handle hnd = nullptr;
|
||||
for (const QString &attempt : qAsConst(attempts)) {
|
||||
#ifndef Q_OS_WINRT
|
||||
@ -115,6 +117,7 @@ bool QLibraryPrivate::load_sys()
|
||||
#ifndef Q_OS_WINRT
|
||||
SetErrorMode(oldmode);
|
||||
#endif
|
||||
locker.relock();
|
||||
if (!hnd) {
|
||||
errorString = QLibrary::tr("Cannot load library %1: %2").arg(
|
||||
QDir::toNativeSeparators(fileName), qt_error_string());
|
||||
|
@ -639,7 +639,7 @@ QTzTimeZonePrivate::QTzTimeZonePrivate()
|
||||
// Create a named time zone
|
||||
QTzTimeZonePrivate::QTzTimeZonePrivate(const QByteArray &ianaId)
|
||||
{
|
||||
init(ianaId);
|
||||
init(ianaId.isEmpty() ? systemTimeZoneId() : ianaId);
|
||||
}
|
||||
|
||||
QTzTimeZonePrivate::~QTzTimeZonePrivate()
|
||||
@ -852,13 +852,16 @@ QTzTimeZoneCacheEntry QTzTimeZoneCache::fetchEntry(const QByteArray &ianaId)
|
||||
|
||||
void QTzTimeZonePrivate::init(const QByteArray &ianaId)
|
||||
{
|
||||
// System ID defaults to UTC, so is never empty; and our callers default to
|
||||
// the system ID if what they're given is empty.
|
||||
Q_ASSERT(!ianaId.isEmpty());
|
||||
static QTzTimeZoneCache tzCache;
|
||||
const auto &entry = tzCache.fetchEntry(ianaId);
|
||||
if (entry.m_tranTimes.isEmpty() && entry.m_posixRule.isEmpty())
|
||||
return; // Invalid after all !
|
||||
|
||||
cached_data = std::move(entry);
|
||||
m_id = ianaId.isEmpty() ? systemTimeZoneId() : ianaId;
|
||||
m_id = ianaId;
|
||||
}
|
||||
|
||||
QLocale::Country QTzTimeZonePrivate::country() const
|
||||
@ -1150,29 +1153,6 @@ QByteArray QTzTimeZonePrivate::systemTimeZoneId() const
|
||||
}
|
||||
}
|
||||
|
||||
// On Debian Etch up to Jessie, /etc/localtime is a copy of the relevant
|
||||
// zoneinfo file, whose name is recorded in /etc/timezone:
|
||||
if (ianaId.isEmpty()) {
|
||||
QFile tzif(QStringLiteral("/etc/timezone"));
|
||||
if (tzif.open(QIODevice::ReadOnly))
|
||||
ianaId = tzif.readAll().trimmed();
|
||||
}
|
||||
|
||||
// On some Red Hat distros /etc/localtime is real file with name held in /etc/sysconfig/clock
|
||||
// in a line like ZONE="Europe/Oslo" or TIMEZONE="Europe/Oslo"
|
||||
if (ianaId.isEmpty()) {
|
||||
QFile tzif(QStringLiteral("/etc/sysconfig/clock"));
|
||||
if (tzif.open(QIODevice::ReadOnly)) {
|
||||
while (ianaId.isEmpty() && !tzif.atEnd()) {
|
||||
const QByteArray line(tzif.readLine().trimmed());
|
||||
if (line.startsWith("ZONE="))
|
||||
ianaId = line.mid(6, line.length() - 7);
|
||||
else if (line.startsWith("TIMEZONE="))
|
||||
ianaId = line.mid(10, line.length() - 11);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Some systems (e.g. uClibc) have a default value for $TZ in /etc/TZ:
|
||||
if (ianaId.isEmpty()) {
|
||||
QFile zone(QStringLiteral("/etc/TZ"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user