diff options
author | Jason Barron <jbarron@trolltech.com> | 2009-08-18 08:26:58 (GMT) |
---|---|---|
committer | Jason Barron <jbarron@trolltech.com> | 2009-08-18 08:26:58 (GMT) |
commit | ff96a87389d69a537a91d364b299aae09c2129a6 (patch) | |
tree | 029f80d896f8a39714a341b5b0150cbb4ac97aba /src/corelib/io | |
parent | c1538fd1834a268b0e05694e612ff18dfe827636 (diff) | |
parent | bd62bc9d7a31507a2f1a4e627f32184cfd12711e (diff) | |
download | Qt-ff96a87389d69a537a91d364b299aae09c2129a6.zip Qt-ff96a87389d69a537a91d364b299aae09c2129a6.tar.gz Qt-ff96a87389d69a537a91d364b299aae09c2129a6.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt-s60-public
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qfilesystemwatcher_symbian.cpp | 29 | ||||
-rw-r--r-- | src/corelib/io/qfilesystemwatcher_symbian_p.h | 4 |
2 files changed, 21 insertions, 12 deletions
diff --git a/src/corelib/io/qfilesystemwatcher_symbian.cpp b/src/corelib/io/qfilesystemwatcher_symbian.cpp index 49a5f34..412372a 100644 --- a/src/corelib/io/qfilesystemwatcher_symbian.cpp +++ b/src/corelib/io/qfilesystemwatcher_symbian.cpp @@ -52,20 +52,25 @@ QT_BEGIN_NAMESPACE CNotifyChangeEvent* CNotifyChangeEvent::New(RFs &fs, const TDesC& file, - QSymbianFileSystemWatcherEngine* e) + QSymbianFileSystemWatcherEngine* e, bool aIsDir) { - CNotifyChangeEvent* self = new CNotifyChangeEvent(fs, file, e); + CNotifyChangeEvent* self = new CNotifyChangeEvent(fs, file, e, aIsDir); return self; } CNotifyChangeEvent::CNotifyChangeEvent(RFs &fs, const TDesC& file, - QSymbianFileSystemWatcherEngine* e, TInt aPriority) : + QSymbianFileSystemWatcherEngine* e, bool aIsDir, TInt aPriority) : CActive(aPriority), + isDir(aIsDir), fsSession(fs), watchedPath(file), engine(e) { - fsSession.NotifyChange(ENotifyAll, iStatus, file); + if(isDir) { + fsSession.NotifyChange(ENotifyEntry, iStatus, file); + } else { + fsSession.NotifyChange(ENotifyAll, iStatus, file); + } CActiveScheduler::Add(this); SetActive(); } @@ -77,8 +82,12 @@ CNotifyChangeEvent::~CNotifyChangeEvent() void CNotifyChangeEvent::RunL() { - if (iStatus.Int() == KErrNone){ - fsSession.NotifyChange(ENotifyAll, iStatus, watchedPath); + if (iStatus.Int() == KErrNone) { + if(isDir) { + fsSession.NotifyChange(ENotifyEntry, iStatus, watchedPath); + } else { + fsSession.NotifyChange(ENotifyAll, iStatus, watchedPath); + } SetActive(); QT_TRYCATCH_LEAVING(engine->emitPathChanged(this)); } else { @@ -88,7 +97,7 @@ void CNotifyChangeEvent::RunL() void CNotifyChangeEvent::DoCancel() { - fsSession.NotifyChangeCancel(); + fsSession.NotifyChangeCancel(iStatus); } QSymbianFileSystemWatcherEngine::QSymbianFileSystemWatcherEngine() : @@ -132,8 +141,8 @@ QStringList QSymbianFileSystemWatcherEngine::addPaths(const QStringList &paths, // Use absolute filepath as relative paths seem to have some issues. QString filePath = fi.absoluteFilePath(); - if(isDir && filePath.at(filePath.size()-1) != QChar('/')) { - filePath += QChar('/'); + if(isDir && filePath.at(filePath.size()-1) != QChar(L'/')) { + filePath += QChar(L'/'); } currentEvent = NULL; @@ -264,7 +273,7 @@ void QSymbianFileSystemWatcherEngine::addNativeListener(const QString &directory QMutexLocker locker(&mutex); QString nativeDir(QDir::toNativeSeparators(directoryPath)); TPtrC ptr(qt_QString2TPtrC(nativeDir)); - currentEvent = CNotifyChangeEvent::New(fsSession, ptr, this); + currentEvent = CNotifyChangeEvent::New(fsSession, ptr, this, directoryPath.endsWith(QChar(L'/'), Qt::CaseSensitive)); syncCondition.wakeOne(); } diff --git a/src/corelib/io/qfilesystemwatcher_symbian_p.h b/src/corelib/io/qfilesystemwatcher_symbian_p.h index 53b2b13..846541b 100644 --- a/src/corelib/io/qfilesystemwatcher_symbian_p.h +++ b/src/corelib/io/qfilesystemwatcher_symbian_p.h @@ -71,10 +71,10 @@ class CNotifyChangeEvent : public CActive { public: CNotifyChangeEvent(RFs &fsSession, const TDesC& file, QSymbianFileSystemWatcherEngine* engine, - TInt aPriority = EPriorityStandard); + bool aIsDir, TInt aPriority = EPriorityStandard); ~CNotifyChangeEvent(); static CNotifyChangeEvent* New(RFs &fsSession, const TDesC& file, - QSymbianFileSystemWatcherEngine* engine); + QSymbianFileSystemWatcherEngine* engine, bool aIsDir); bool isDir; |