From 30db2159aa54aff0c28054739e2204966c584d8c Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Tue, 1 Apr 2014 10:27:42 +0200 Subject: Fix offset calculation on WinRT According to MSDN "the offset must be a multiple of the allocation granularity". We use this already for the win32 version by splitting into offsetLo and offsetHi. However, we did not convert it back to the correct argument passed for MapViewOfFileFromApp. Now all auto-tests for mapping succeed. Task-number: QTBUG-37773 Change-Id: I7e43f906cb93164b58f4e5e3f88388cdace865d7 Reviewed-by: Andrew Knight --- src/corelib/io/qfsfileengine_win.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/corelib/io') diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index c974daab06..afc8deb1a0 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -1034,6 +1034,7 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, LPVOID mapAddress = ::MapViewOfFile(mapHandle, access, offsetHi, offsetLo, size + extra); #else + offset = (offsetHi << 32) + offsetLo; LPVOID mapAddress = ::MapViewOfFileFromApp(mapHandle, access, offset, size); #endif if (mapAddress) { -- cgit v1.2.3 From b11adb825c4dfc8429695947cef8f9e3253ad0c2 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 17 Mar 2014 10:16:08 +0100 Subject: Logging: Be also more strict with value of logging rule Only accept lower-case "true" and "false", as documented. The old check didn't match either the documentation, nor the QSettings/ QVariant behavior (where, for a boolean value, any lower-cased content that not empty, "0" or "false" is considered true). Change-Id: I317d29c16a27f862001b9dff02e8298df8acf5a6 Reviewed-by: Friedemann Kleint Reviewed-by: Alex Blasche --- src/corelib/io/qloggingregistry.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/corelib/io') diff --git a/src/corelib/io/qloggingregistry.cpp b/src/corelib/io/qloggingregistry.cpp index 7e6883fd14..575150f148 100644 --- a/src/corelib/io/qloggingregistry.cpp +++ b/src/corelib/io/qloggingregistry.cpp @@ -218,11 +218,14 @@ void QLoggingSettingsParser::setContent(QTextStream &stream) if ((equalPos != -1) && (line.lastIndexOf(QLatin1Char('=')) == equalPos)) { const QStringRef pattern = line.leftRef(equalPos); - const QStringRef value = line.midRef(equalPos + 1); - bool enabled = (value.compare(QLatin1String("true"), - Qt::CaseInsensitive) == 0); - QLoggingRule rule(pattern, enabled); - if (rule.flags != 0) + const QStringRef valueStr = line.midRef(equalPos + 1); + int value = -1; + if (valueStr == QLatin1String("true")) + value = 1; + else if (valueStr == QLatin1String("false")) + value = 0; + QLoggingRule rule(pattern, (value == 1)); + if (rule.flags != 0 && (value != -1)) _rules.append(rule); else warnMsg("Ignoring malformed logging rule: '%s'", line.toUtf8().constData()); -- cgit v1.2.3 From 66178447e91f56eaeaee203171b9355399d3bb5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Fri, 21 Mar 2014 13:48:18 +0100 Subject: Mac: Use QString::toNSString in QtBase. The string is now autoreleased. This fixes a memory leak in qt_mac_QStringListToNSMutableArrayVoid Task-number: QTBUG-20347 Change-Id: I11ebeb264af4c8ce98968f2221eea772f24c12d4 Reviewed-by: Gabriel de Dietrich Reviewed-by: Konstantin Ritt --- src/corelib/io/qfilesystemwatcher_fsevents.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/io') diff --git a/src/corelib/io/qfilesystemwatcher_fsevents.mm b/src/corelib/io/qfilesystemwatcher_fsevents.mm index bfcae2a3a2..981d663694 100644 --- a/src/corelib/io/qfilesystemwatcher_fsevents.mm +++ b/src/corelib/io/qfilesystemwatcher_fsevents.mm @@ -478,7 +478,7 @@ bool QFseventsFileSystemWatcherEngine::startStream() NSMutableArray *pathsToWatch = [NSMutableArray arrayWithCapacity:watchedPaths.size()]; for (PathRefCounts::const_iterator i = watchedPaths.begin(), ei = watchedPaths.end(); i != ei; ++i) - [pathsToWatch addObject:reinterpret_cast(QCFString::toCFStringRef(i.key()))]; + [pathsToWatch addObject:i.key().toNSString()]; struct FSEventStreamContext callBackInfo = { 0, -- cgit v1.2.3 From afacf694d5a6f34b88989e76971d70d700ce4949 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Tue, 28 Jan 2014 12:53:10 +0100 Subject: Use Finder bundle identifier over path for OS X bundle detection Currently, checking if Finder is the application returned for opening a bundle is done using its absolute path. Finder might be relocated in future OS X versions which makes this approach less clean. Using Finder's bundle identifier allows us to ignore where it is stored in the filesystem as the identifier will not change. Task-number: QTBUG-31884 Change-Id: Ib4c3412fb206fadda04eb547bc6a4eef02ee949a Reviewed-by: Oswald Buddenhagen Reviewed-by: Jake Petroules Reviewed-by: Thiago Macieira --- src/corelib/io/qfilesystemengine_unix.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/corelib/io') diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index 6c0f31fb55..eabedaa80a 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -113,9 +113,10 @@ static bool isPackage(const QFileSystemMetaData &data, const QFileSystemEntry &e &application); if (application) { - CFStringRef path = CFURLGetString(application); - QString applicationPath = QCFString::toQString(path); - if (applicationPath != QLatin1String("file://localhost/System/Library/CoreServices/Finder.app/")) + QCFType bundle = CFBundleCreate(kCFAllocatorDefault, application); + CFStringRef identifier = CFBundleGetIdentifier(bundle); + QString applicationId = QCFString::toQString(identifier); + if (applicationId != QLatin1String("com.apple.finder")) return true; } } -- cgit v1.2.3 From 10a0ac759e26e27751ae96d02eb1e260ab371194 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 2 Apr 2014 16:56:15 +0200 Subject: Windows XP target support for MSVC >= 2012 To enable windows xp support, we must do two things: 1. linker flag must be /SUBSYSTEM:CONSOLE,5.01 or /SUBSYSTEM:WINDOWS,5.01. For x64, the version is 5.02. 2. Do not use Windows Kit 8. Win SDK v7.1A is recommended. Prepend the right include paths and lib paths to INCLUDE and LIB before building. The Windows XP target support is enabled by passing "-target xp" to configure. Task-number: QTBUG-29939 Change-Id: I84c8439606cc2a9d27d64947702846faa4f1e4a2 Reviewed-by: Lucas Wang Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qfilesystemengine_win.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/io') diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp index 7741eb4c1e..8e3bacd6b7 100644 --- a/src/corelib/io/qfilesystemengine_win.cpp +++ b/src/corelib/io/qfilesystemengine_win.cpp @@ -606,7 +606,7 @@ QFileSystemEntry QFileSystemEngine::absoluteName(const QFileSystemEntry &entry) // FILE_INFO_BY_HANDLE_CLASS has been extended by FileIdInfo = 18 as of VS2012. typedef enum { Q_FileIdInfo = 18 } Q_FILE_INFO_BY_HANDLE_CLASS; -# if defined(Q_CC_MINGW) || (defined(Q_CC_MSVC) && _MSC_VER < 1700) +# if defined(Q_CC_MINGW) || (defined(Q_CC_MSVC) && (_MSC_VER < 1700 || WINVER <= 0x0601)) // MinGW-64 defines FILE_ID_128 as of gcc-4.8.1 along with FILE_SUPPORTS_INTEGRITY_STREAMS # if !(defined(Q_CC_MINGW) && defined(FILE_SUPPORTS_INTEGRITY_STREAMS)) @@ -619,7 +619,7 @@ typedef struct _FILE_ID_INFO { ULONGLONG VolumeSerialNumber; FILE_ID_128 FileId; } FILE_ID_INFO, *PFILE_ID_INFO; -# endif // if defined (Q_CC_MINGW) || (defined(Q_CC_MSVC) && _MSC_VER < 1700)) +# endif // if defined (Q_CC_MINGW) || (defined(Q_CC_MSVC) && (_MSC_VER < 1700 || WINVER <= 0x0601)) // File ID for Windows up to version 7. static inline QByteArray fileId(HANDLE handle) -- cgit v1.2.3 From 670ebed1214ed0dae9a52ab40c5b5065c7d02a35 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Fri, 4 Apr 2014 11:51:16 +0200 Subject: Fix out-of-range shifting offsetHi needs to be casted first before shifting. Change-Id: I29c773dd13d5b16042629604015bbf5645fab861 Reviewed-by: Andrew Knight --- src/corelib/io/qfsfileengine_win.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/io') diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index afc8deb1a0..fb4107b95d 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -1034,8 +1034,8 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, LPVOID mapAddress = ::MapViewOfFile(mapHandle, access, offsetHi, offsetLo, size + extra); #else - offset = (offsetHi << 32) + offsetLo; - LPVOID mapAddress = ::MapViewOfFileFromApp(mapHandle, access, offset, size); + LPVOID mapAddress = ::MapViewOfFileFromApp(mapHandle, access, + (ULONG64(offsetHi) << 32) + offsetLo, size); #endif if (mapAddress) { uchar *address = extra + static_cast(mapAddress); -- cgit v1.2.3