diff options
author | Water-Team <water@pad.test.qt.nokia.com> | 2011-10-17 23:00:33 (GMT) |
---|---|---|
committer | Water-Team <water@pad.test.qt.nokia.com> | 2011-10-17 23:00:33 (GMT) |
commit | 923693d4919f22eabd5cec8fb6e855514bb64fb7 (patch) | |
tree | ce5c6ec3f89b9bef3684c748bc4bc39af0d53a9a /src/corelib/io | |
parent | ec9a31abf003880a60d1120738a3bee7075b8ca8 (diff) | |
parent | 09e7218a1c30ca33a5d82280f89f07ba54b96555 (diff) | |
download | Qt-923693d4919f22eabd5cec8fb6e855514bb64fb7.zip Qt-923693d4919f22eabd5cec8fb6e855514bb64fb7.tar.gz Qt-923693d4919f22eabd5cec8fb6e855514bb64fb7.tar.bz2 |
Merge branch '4.8-upstream' into master-water
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qdir.cpp | 10 | ||||
-rw-r--r-- | src/corelib/io/qfile.cpp | 7 | ||||
-rw-r--r-- | src/corelib/io/qfilesystemengine_win.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qfilesystemwatcher_symbian.cpp | 10 | ||||
-rw-r--r-- | src/corelib/io/qfilesystemwatcher_symbian_p.h | 18 |
5 files changed, 31 insertions, 16 deletions
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index 4ba8e06..48b9358 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -1872,7 +1872,10 @@ QString QDir::currentPath() Under non-Windows operating systems the \c HOME environment variable is used if it exists, otherwise the path returned by the - rootPath(). On Symbian always the same as the path returned by the rootPath(). + rootPath(). + + On Symbian this typically returns "c:/data", + i.e. the same as native PathInfo::PhoneMemoryRootPath(). \sa home(), currentPath(), rootPath(), tempPath() */ @@ -1936,9 +1939,8 @@ QString QDir::tempPath() /*! Returns the absolute path of the root directory. - For Unix operating systems this returns "/". For Windows file - systems this normally returns "c:/". On Symbian this typically returns - "c:/data", i.e. the same as native PathInfo::PhoneMemoryRootPath(). + For Unix operating systems this returns "/". For Windows and Symbian file + systems this normally returns "c:/". I.E. the root of the system drive. \sa root(), drives(), currentPath(), homePath(), tempPath() */ diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index 06c403a..d08574d 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -1332,6 +1332,13 @@ bool QFile::open(const RFile &f, OpenMode mode, FileHandleFlags handleFlags) This function is not supported on Windows CE. + On Symbian, this function returns -1 if the file was opened normally, + as Symbian OS native file handles do not fit in an int, and are + incompatible with C library functions that the handle would be used for. + If the file was opened using the overloads that take an open C library + file handle / file descriptor, then this function returns that same + handle. + \sa QSocketNotifier */ diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp index 338552c..86b9496 100644 --- a/src/corelib/io/qfilesystemengine_win.cpp +++ b/src/corelib/io/qfilesystemengine_win.cpp @@ -694,7 +694,7 @@ bool QFileSystemEngine::fillPermissions(const QFileSystemEntry &entry, QFileSyst if (what & QFileSystemMetaData::UserWritePermission) { if (::_waccess((wchar_t*)entry.nativeFilePath().utf16(), W_OK) == 0) data.entryFlags |= QFileSystemMetaData::UserWritePermission; - data.knownFlagsMask |= QFileSystemMetaData::UserReadPermission; + data.knownFlagsMask |= QFileSystemMetaData::UserWritePermission; } } diff --git a/src/corelib/io/qfilesystemwatcher_symbian.cpp b/src/corelib/io/qfilesystemwatcher_symbian.cpp index 63cc4f1..fa857c6 100644 --- a/src/corelib/io/qfilesystemwatcher_symbian.cpp +++ b/src/corelib/io/qfilesystemwatcher_symbian.cpp @@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE QNotifyChangeEvent::QNotifyChangeEvent(RFs &fs, const TDesC &file, - QSymbianFileSystemWatcherEngine *e, bool aIsDir, + QSymbianFileSystemWatcherInterface *e, bool aIsDir, TInt aPriority) : CActive(aPriority), isDir(aIsDir), @@ -96,9 +96,9 @@ void QNotifyChangeEvent::RunL() if (!failureCount) { int err; - QT_TRYCATCH_ERROR(err, engine->emitPathChanged(this)); + QT_TRYCATCH_ERROR(err, engine->handlePathChanged(this)); if (err != KErrNone) - qWarning("QNotifyChangeEvent::RunL() - emitPathChanged threw exception (Converted error code: %d)", err); + qWarning("QNotifyChangeEvent::RunL() - handlePathChanged threw exception (Converted error code: %d)", err); } } } @@ -203,7 +203,7 @@ QStringList QSymbianFileSystemWatcherEngine::removePaths(const QStringList &path return p; } -void QSymbianFileSystemWatcherEngine::emitPathChanged(QNotifyChangeEvent *e) +void QSymbianFileSystemWatcherEngine::handlePathChanged(QNotifyChangeEvent *e) { QMutexLocker locker(&mutex); @@ -255,7 +255,7 @@ void QSymbianFileSystemWatcherEngine::addNativeListener(const QString &directory QMutexLocker locker(&mutex); QString nativeDir(QDir::toNativeSeparators(directoryPath)); TPtrC ptr(qt_QString2TPtrC(nativeDir)); - currentAddEvent = new QNotifyChangeEvent(qt_s60GetRFs(), ptr, this, directoryPath.endsWith(QChar(L'/'), Qt::CaseSensitive)); + currentAddEvent = q_check_ptr(new QNotifyChangeEvent(qt_s60GetRFs(), ptr, this, directoryPath.endsWith(QChar(L'/')))); syncCondition.wakeOne(); } diff --git a/src/corelib/io/qfilesystemwatcher_symbian_p.h b/src/corelib/io/qfilesystemwatcher_symbian_p.h index 0b317a0..842df80 100644 --- a/src/corelib/io/qfilesystemwatcher_symbian_p.h +++ b/src/corelib/io/qfilesystemwatcher_symbian_p.h @@ -66,29 +66,35 @@ QT_BEGIN_NAMESPACE -class QSymbianFileSystemWatcherEngine; +class QSymbianFileSystemWatcherInterface; class QNotifyChangeEvent : public CActive { public: - QNotifyChangeEvent(RFs &fsSession, const TDesC &file, QSymbianFileSystemWatcherEngine *engine, + QNotifyChangeEvent(RFs &fsSession, const TDesC &file, QSymbianFileSystemWatcherInterface *engine, bool aIsDir, TInt aPriority = EPriorityStandard); ~QNotifyChangeEvent(); bool isDir; + TPath watchedPath; private: void RunL(); void DoCancel(); RFs &fsSession; - TPath watchedPath; - QSymbianFileSystemWatcherEngine *engine; + QSymbianFileSystemWatcherInterface *engine; int failureCount; }; -class QSymbianFileSystemWatcherEngine : public QFileSystemWatcherEngine +class QSymbianFileSystemWatcherInterface +{ +public: + virtual void handlePathChanged(QNotifyChangeEvent *e) = 0; +}; + +class QSymbianFileSystemWatcherEngine : public QFileSystemWatcherEngine, public QSymbianFileSystemWatcherInterface { Q_OBJECT @@ -111,7 +117,7 @@ public Q_SLOTS: private: friend class QNotifyChangeEvent; - void emitPathChanged(QNotifyChangeEvent *e); + void handlePathChanged(QNotifyChangeEvent *e); void startWatcher(); |