From 71f04c22f128a52353f0a53d6d118375c0e99e33 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Thu, 7 Oct 2010 12:50:21 +0200 Subject: Compile fixes for mingw --- qmake/Makefile.win32-g++-sh | 4 +++ src/corelib/io/qfilesystemengine_win.cpp | 53 ------------------------------ src/corelib/io/qfilesystemiterator_win.cpp | 4 +-- src/corelib/io/qfilesystemmetadata_p.h | 53 ++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 55 deletions(-) diff --git a/qmake/Makefile.win32-g++-sh b/qmake/Makefile.win32-g++-sh index 97be5b5..2530fe8 100644 --- a/qmake/Makefile.win32-g++-sh +++ b/qmake/Makefile.win32-g++-sh @@ -62,6 +62,7 @@ QTOBJS= \ qfileinfo.o \ qabstractfileengine.o \ qfilesystementry.o \ + qfilesystemengine.o \ qfilesystemengine_win.o \ qfilesystemiterator_win.o \ qfsfileengine.o \ @@ -197,6 +198,9 @@ qabstractfileengine.o: $(SOURCE_PATH)/src/corelib/io/qabstractfileengine.cpp qfilesystementry.o: $(SOURCE_PATH)/src/corelib/io/qfilesystementry.cpp $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfilesystementry.cpp +qfilesystemengine.o: $(SOURCE_PATH)/src/corelib/io/qfilesystemengine.cpp + $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfilesystemengine.cpp + qfilesystemengine_win.o: $(SOURCE_PATH)/src/corelib/io/qfilesystemengine_win.cpp $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfilesystemengine_win.cpp diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp index b164044..1f7a9b9 100644 --- a/src/corelib/io/qfilesystemengine_win.cpp +++ b/src/corelib/io/qfilesystemengine_win.cpp @@ -421,59 +421,6 @@ bool QFileSystemEngine::uncListSharesOnServer(const QString &server, QStringList return false; } -void QFileSystemMetaData::fillFromFileAttribute(DWORD fileAttribute,bool isDriveRoot) -{ - fileAttribute_ = fileAttribute; - // Ignore the hidden attribute for drives. - if (!isDriveRoot && (fileAttribute_ & FILE_ATTRIBUTE_HIDDEN)) - entryFlags |= HiddenAttribute; - entryFlags |= ((fileAttribute & FILE_ATTRIBUTE_DIRECTORY) ? DirectoryType: FileType); - entryFlags |= ExistsAttribute; - knownFlagsMask |= FileType | DirectoryType | HiddenAttribute | ExistsAttribute; -} - -void QFileSystemMetaData::fillFromFindData(WIN32_FIND_DATA &findData, bool setLinkType, bool isDriveRoot) -{ - fillFromFileAttribute(findData.dwFileAttributes, isDriveRoot); - creationTime_ = findData.ftCreationTime; - lastAccessTime_ = findData.ftLastAccessTime; - lastWriteTime_ = findData.ftLastWriteTime; - if (fileAttribute_ & FILE_ATTRIBUTE_DIRECTORY) { - size_ = 0; - } else { - size_ = findData.nFileSizeHigh; - size_ <<= 32; - size_ += findData.nFileSizeLow; - } - knownFlagsMask |= Times | SizeAttribute; - if (setLinkType) { - knownFlagsMask |= LinkType; - entryFlags &= ~LinkType; - if ((fileAttribute_ & FILE_ATTRIBUTE_REPARSE_POINT) - && (findData.dwReserved0 == IO_REPARSE_TAG_SYMLINK - || findData.dwReserved0 == IO_REPARSE_TAG_MOUNT_POINT)) { - entryFlags |= LinkType; - } - - } -} - -void QFileSystemMetaData::fillFromFindInfo(BY_HANDLE_FILE_INFORMATION &fileInfo) -{ - fillFromFileAttribute(fileInfo.dwFileAttributes); - creationTime_ = fileInfo.ftCreationTime; - lastAccessTime_ = fileInfo.ftLastAccessTime; - lastWriteTime_ = fileInfo.ftLastWriteTime; - if (fileAttribute_ & FILE_ATTRIBUTE_DIRECTORY) { - size_ = 0; - } else { - size_ = fileInfo.nFileSizeHigh; - size_ <<= 32; - size_ += fileInfo.nFileSizeLow; - } - knownFlagsMask |= Times | SizeAttribute; -} - void QFileSystemEngine::clearWinStatData(QFileSystemMetaData &data) { data.size_ = 0; diff --git a/src/corelib/io/qfilesystemiterator_win.cpp b/src/corelib/io/qfilesystemiterator_win.cpp index 62912a6..9181789 100644 --- a/src/corelib/io/qfilesystemiterator_win.cpp +++ b/src/corelib/io/qfilesystemiterator_win.cpp @@ -66,8 +66,8 @@ QFileSystemIterator::QFileSystemIterator(const QFileSystemEntry &entry, QDir::Fi if (!nativePath.endsWith(QLatin1Char('\\'))) nativePath.append(QLatin1Char('\\')); nativePath.append(QLatin1Char('*')); - if (!dirPath.endsWith(QLatin1Char('//'))) - dirPath.append(QLatin1Char('//')); + if (!dirPath.endsWith(QLatin1Char('/'))) + dirPath.append(QLatin1Char('/')); if ((filters & (QDir::Dirs|QDir::Drives)) && (!(filters & (QDir::Files)))) onlyDirs = true; } diff --git a/src/corelib/io/qfilesystemmetadata_p.h b/src/corelib/io/qfilesystemmetadata_p.h index 29ef987..24dfe6b 100644 --- a/src/corelib/io/qfilesystemmetadata_p.h +++ b/src/corelib/io/qfilesystemmetadata_p.h @@ -336,6 +336,59 @@ inline uint QFileSystemMetaData::ownerId(QAbstractFileEngine::FileOwner owner) c else return groupId(); } + +inline void QFileSystemMetaData::fillFromFileAttribute(DWORD fileAttribute,bool isDriveRoot) +{ + fileAttribute_ = fileAttribute; + // Ignore the hidden attribute for drives. + if (!isDriveRoot && (fileAttribute_ & FILE_ATTRIBUTE_HIDDEN)) + entryFlags |= HiddenAttribute; + entryFlags |= ((fileAttribute & FILE_ATTRIBUTE_DIRECTORY) ? DirectoryType: FileType); + entryFlags |= ExistsAttribute; + knownFlagsMask |= FileType | DirectoryType | HiddenAttribute | ExistsAttribute; +} + +inline void QFileSystemMetaData::fillFromFindData(WIN32_FIND_DATA &findData, bool setLinkType, bool isDriveRoot) +{ + fillFromFileAttribute(findData.dwFileAttributes, isDriveRoot); + creationTime_ = findData.ftCreationTime; + lastAccessTime_ = findData.ftLastAccessTime; + lastWriteTime_ = findData.ftLastWriteTime; + if (fileAttribute_ & FILE_ATTRIBUTE_DIRECTORY) { + size_ = 0; + } else { + size_ = findData.nFileSizeHigh; + size_ <<= 32; + size_ += findData.nFileSizeLow; + } + knownFlagsMask |= Times | SizeAttribute; + if (setLinkType) { + knownFlagsMask |= LinkType; + entryFlags &= ~LinkType; + if ((fileAttribute_ & FILE_ATTRIBUTE_REPARSE_POINT) + && (findData.dwReserved0 == IO_REPARSE_TAG_SYMLINK + || findData.dwReserved0 == IO_REPARSE_TAG_MOUNT_POINT)) { + entryFlags |= LinkType; + } + + } +} + +inline void QFileSystemMetaData::fillFromFindInfo(BY_HANDLE_FILE_INFORMATION &fileInfo) +{ + fillFromFileAttribute(fileInfo.dwFileAttributes); + creationTime_ = fileInfo.ftCreationTime; + lastAccessTime_ = fileInfo.ftLastAccessTime; + lastWriteTime_ = fileInfo.ftLastWriteTime; + if (fileAttribute_ & FILE_ATTRIBUTE_DIRECTORY) { + size_ = 0; + } else { + size_ = fileInfo.nFileSizeHigh; + size_ <<= 32; + size_ += fileInfo.nFileSizeLow; + } + knownFlagsMask |= Times | SizeAttribute; +} #endif QT_END_NAMESPACE -- cgit v0.12