Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/dialogs/qfileinfogatherer.cpp

    r172 r561  
    22**
    33** 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)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    4545#include <qdiriterator.h>
    4646#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"
    4952#endif
    5053
     
    7376#ifndef QT_NO_FILESYSTEMWATCHER
    7477    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)));
    7780#endif
    7881    start(LowPriority);
     
    8487QFileInfoGatherer::~QFileInfoGatherer()
    8588{
    86     mutex.lock();
     89    QMutexLocker locker(&mutex);
    8790    abort = true;
    8891    condition.wakeOne();
    89     mutex.unlock();
     92    locker.unlock();
    9093    wait();
    9194}
     
    9598    Q_UNUSED(enable);
    9699#ifdef Q_OS_WIN
    97     mutex.lock();
     100    QMutexLocker locker(&mutex);
    98101    m_resolveSymlinks = enable;
    99     mutex.unlock();
    100102#endif
    101103}
     
    108110void QFileInfoGatherer::setIconProvider(QFileIconProvider *provider)
    109111{
    110     mutex.lock();
     112    QMutexLocker locker(&mutex);
    111113    m_iconProvider = provider;
    112     mutex.unlock();
    113114}
    114115
     
    125126void QFileInfoGatherer::fetchExtendedInformation(const QString &path, const QStringList &files)
    126127{
    127     mutex.lock();
     128    QMutexLocker locker(&mutex);
    128129    // See if we already have this dir/file in our que
    129130    int loc = this->path.lastIndexOf(path);
    130131    while (loc > 0)  {
    131132        if (this->files.at(loc) == files) {
    132             mutex.unlock();
    133133            return;
    134134        }
     
    138138    this->files.push(files);
    139139    condition.wakeAll();
    140     mutex.unlock();
    141140}
    142141
     
    161160{
    162161#ifndef QT_NO_FILESYSTEMWATCHER
    163     mutex.lock();
     162    QMutexLocker locker(&mutex);
    164163    watcher->removePaths(watcher->files());
    165164    watcher->removePaths(watcher->directories());
    166     mutex.unlock();
    167165#endif
    168166}
     
    176174{
    177175#ifndef QT_NO_FILESYSTEMWATCHER
    178     mutex.lock();
     176    QMutexLocker locker(&mutex);
    179177    watcher->removePath(path);
    180     mutex.unlock();
    181178#endif
    182179}
     
    199196    forever {
    200197        bool updateFiles = false;
    201         mutex.lock();
     198        QMutexLocker locker(&mutex);
    202199        if (abort) {
    203             mutex.unlock();
    204200            return;
    205201        }
     
    215211            updateFiles = true;
    216212        }
    217         mutex.unlock();
    218         if (updateFiles) getFileInfos(path, list);
     213        locker.unlock();
     214        if (updateFiles)
     215            getFileInfos(path, list);
    219216    }
    220217}
     
    288285    if (driveName.startsWith(QLatin1Char('/'))) // UNC host
    289286        return drive.fileName();
     287#endif
     288#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN)
    290289    if (driveName.endsWith(QLatin1Char('/')))
    291290        driveName.chop(1);
Note: See TracChangeset for help on using the changeset viewer.