Changeset 561 for trunk/src/gui/dialogs/qfileinfogatherer.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/dialogs/qfileinfogatherer.cpp
r172 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 45 45 #include <qdiriterator.h> 46 46 #ifndef Q_OS_WIN 47 #include <unistd.h> 48 #include <sys/types.h> 47 # include <unistd.h> 48 # include <sys/types.h> 49 #endif 50 #if defined(Q_OS_VXWORKS) 51 # include "qplatformdefs.h" 49 52 #endif 50 53 … … 73 76 #ifndef QT_NO_FILESYSTEMWATCHER 74 77 watcher = new QFileSystemWatcher(this); 75 connect(watcher, SIGNAL(directoryChanged( const QString &)), this, SLOT(list(const QString &)));76 connect(watcher, SIGNAL(fileChanged( const QString &)), this, SLOT(updateFile(const QString &)));78 connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(list(QString))); 79 connect(watcher, SIGNAL(fileChanged(QString)), this, SLOT(updateFile(QString))); 77 80 #endif 78 81 start(LowPriority); … … 84 87 QFileInfoGatherer::~QFileInfoGatherer() 85 88 { 86 mutex.lock();89 QMutexLocker locker(&mutex); 87 90 abort = true; 88 91 condition.wakeOne(); 89 mutex.unlock();92 locker.unlock(); 90 93 wait(); 91 94 } … … 95 98 Q_UNUSED(enable); 96 99 #ifdef Q_OS_WIN 97 mutex.lock();100 QMutexLocker locker(&mutex); 98 101 m_resolveSymlinks = enable; 99 mutex.unlock();100 102 #endif 101 103 } … … 108 110 void QFileInfoGatherer::setIconProvider(QFileIconProvider *provider) 109 111 { 110 mutex.lock();112 QMutexLocker locker(&mutex); 111 113 m_iconProvider = provider; 112 mutex.unlock();113 114 } 114 115 … … 125 126 void QFileInfoGatherer::fetchExtendedInformation(const QString &path, const QStringList &files) 126 127 { 127 mutex.lock();128 QMutexLocker locker(&mutex); 128 129 // See if we already have this dir/file in our que 129 130 int loc = this->path.lastIndexOf(path); 130 131 while (loc > 0) { 131 132 if (this->files.at(loc) == files) { 132 mutex.unlock();133 133 return; 134 134 } … … 138 138 this->files.push(files); 139 139 condition.wakeAll(); 140 mutex.unlock();141 140 } 142 141 … … 161 160 { 162 161 #ifndef QT_NO_FILESYSTEMWATCHER 163 mutex.lock();162 QMutexLocker locker(&mutex); 164 163 watcher->removePaths(watcher->files()); 165 164 watcher->removePaths(watcher->directories()); 166 mutex.unlock();167 165 #endif 168 166 } … … 176 174 { 177 175 #ifndef QT_NO_FILESYSTEMWATCHER 178 mutex.lock();176 QMutexLocker locker(&mutex); 179 177 watcher->removePath(path); 180 mutex.unlock();181 178 #endif 182 179 } … … 199 196 forever { 200 197 bool updateFiles = false; 201 mutex.lock();198 QMutexLocker locker(&mutex); 202 199 if (abort) { 203 mutex.unlock();204 200 return; 205 201 } … … 215 211 updateFiles = true; 216 212 } 217 mutex.unlock(); 218 if (updateFiles) getFileInfos(path, list); 213 locker.unlock(); 214 if (updateFiles) 215 getFileInfos(path, list); 219 216 } 220 217 } … … 288 285 if (driveName.startsWith(QLatin1Char('/'))) // UNC host 289 286 return drive.fileName(); 287 #endif 288 #if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN) 290 289 if (driveName.endsWith(QLatin1Char('/'))) 291 290 driveName.chop(1);
Note:
See TracChangeset
for help on using the changeset viewer.