Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/corelib/io/qdir.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    5353#include "qvector.h"
    5454#include "qalgorithms.h"
     55
     56
    5557#ifdef QT_BUILD_CORE_LIB
    56 # include "qresource.h"
    57 #endif
    58 
    59 #include "qvarlengtharray.h"
    60 
    61 #include "private/qcoreglobaldata_p.h"
     58#  include "qresource.h"
     59#  include "private/qcoreglobaldata_p.h"
     60#endif
     61
    6262#include <stdlib.h>
    6363
     
    8383//************* QDirPrivate
    8484class QDirPrivate
    85 {
    86     QDir *q_ptr;
    87     Q_DECLARE_PUBLIC(QDir)
    88 
    89     friend struct QScopedPointerDeleter<QDirPrivate>;
    90 protected:
    91     QDirPrivate(QDir*, const QDir *copy=0);
    92     ~QDirPrivate();
    93 
    94     QString initFileEngine(const QString &file);
    95 
    96     void updateFileLists() const;
    97     void sortFileList(QDir::SortFlags, QFileInfoList &, QStringList *, QFileInfoList *) const;
    98 
    99 private:
     85    : public QSharedData
     86{
     87public:
     88    QDirPrivate(const QString &path,
     89            const QStringList &nameFilters_ = QStringList(),
     90            QDir::SortFlags sort_ = QDir::SortFlags(QDir::Name | QDir::IgnoreCase),
     91            QDir::Filters filters_ = QDir::AllEntries)
     92        : QSharedData()
     93        , nameFilters(nameFilters_)
     94        , sort(sort_)
     95        , filters(filters_)
    10096#ifdef QT3_SUPPORT
    101     QChar filterSepChar;
    102     bool matchAllDirs;
    103 #endif
     97        , filterSepChar(0)
     98        , matchAllDirs(false)
     99#endif
     100        , fileListsInitialized(false)
     101    {
     102        setPath(path.isEmpty() ? QString::fromLatin1(".") : path);
     103
     104        bool empty = nameFilters.isEmpty();
     105        if (!empty) {
     106            empty = true;
     107            for (int i = 0; i < nameFilters.size(); ++i) {
     108                if (!nameFilters.at(i).isEmpty()) {
     109                    empty = false;
     110                    break;
     111                }
     112            }
     113        }
     114        if (empty)
     115            nameFilters = QStringList(QString::fromLatin1("*"));
     116    }
     117
     118    QDirPrivate(const QDirPrivate &copy)
     119        : QSharedData(copy)
     120        , path(copy.path)
     121        , nameFilters(copy.nameFilters)
     122        , sort(copy.sort)
     123        , filters(copy.filters)
     124#ifdef QT3_SUPPORT
     125        , filterSepChar(copy.filterSepChar)
     126        , matchAllDirs(copy.matchAllDirs)
     127#endif
     128        , fileListsInitialized(false)
     129    {
     130    }
     131
     132    bool exists() const
     133    {
     134        const QAbstractFileEngine::FileFlags info =
     135            fileEngine->fileFlags(QAbstractFileEngine::DirectoryType
     136                                           | QAbstractFileEngine::ExistsFlag
     137                                           | QAbstractFileEngine::Refresh);
     138        if (!(info & QAbstractFileEngine::DirectoryType))
     139            return false;
     140        return info & QAbstractFileEngine::ExistsFlag;
     141    }
     142
     143    void initFileEngine();
     144    void initFileLists() const;
     145
     146    static void sortFileList(QDir::SortFlags, QFileInfoList &, QStringList *, QFileInfoList *);
     147
    104148    static inline QChar getFilterSepChar(const QString &nameFilter)
    105149    {
     
    110154        return sep;
    111155    }
    112     static inline QStringList splitFilters(const QString &nameFilter, QChar sep=0) {
    113         if(sep == 0)
     156
     157    static inline QStringList splitFilters(const QString &nameFilter, QChar sep = 0)
     158    {
     159        if (sep == 0)
    114160            sep = getFilterSepChar(nameFilter);
    115161        QStringList ret = nameFilter.split(sep);
    116         for(int i = 0; i < ret.count(); i++)
     162        for)
    117163            ret[i] = ret[i].trimmed();
    118164        return ret;
    119165    }
    120166
    121     struct Data {
    122         inline Data()
    123             : ref(1), fileEngine(0)
    124         { clear(); }
    125         inline Data(const Data &copy)
    126             : ref(1), path(copy.path), nameFilters(copy.nameFilters), sort(copy.sort),
    127               filters(copy.filters), fileEngine(0)
    128         { clear(); }
    129         inline ~Data()
    130         { delete fileEngine; }
    131 
    132         inline void clear() {
    133             listsDirty = 1;
     167    inline void setPath(QString p)
     168    {
     169        if ((p.endsWith(QLatin1Char('/')) || p.endsWith(QLatin1Char('\\')))
     170                && p.length() > 1) {
     171#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) || defined(Q_OS_OS2)
     172            if (!(p.length() == 3 && p.at(1) == QLatin1Char(':')))
     173#endif
     174                p.truncate(p.length() - 1);
    134175        }
    135         mutable QAtomicInt ref;
    136 
    137         QString path;
    138         QStringList nameFilters;
    139         QDir::SortFlags sort;
    140         QDir::Filters filters;
    141 
    142         mutable QAbstractFileEngine *fileEngine;
    143 
    144         mutable uint listsDirty : 1;
    145         mutable QStringList files;
    146         mutable QFileInfoList fileInfos;
    147     } *data;
    148     inline void setPath(const QString &p)
    149     {
    150         detach(false);
    151         QString path = p;
    152         if ((path.endsWith(QLatin1Char('/')) || path.endsWith(QLatin1Char('\\')))
    153                 && path.length() > 1) {
    154 #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) || defined(Q_OS_OS2)
    155             if (!(path.length() == 3 && path.at(1) == QLatin1Char(':')))
    156 #endif
    157                 path.truncate(path.length() - 1);
    158         }
    159         if(!data->fileEngine || !QDir::isRelativePath(path))
    160             path = initFileEngine(path);
    161         data->fileEngine->setFileName(path);
     176
     177        path = p;
     178        initFileEngine();
     179
    162180        // set the path to be the qt friendly version so then we can operate on it using just /
    163         data->path = data->fileEngine->fileName(QAbstractFileEngine::DefaultName);
    164         data->clear();
    165     }
    166     inline void reset() {
    167         detach();
    168         data->clear();
    169     }
    170     void detach(bool createFileEngine = true);
     181        path = fileEngine->fileName(QAbstractFileEngine::DefaultName);
     182        clearFileLists();
     183    }
     184
     185    inline void clearFileLists() {
     186        fileListsInitialized = false;
     187        files.clear();
     188        fileInfos.clear();
     189    }
     190
     191    QString path;
     192    QStringList nameFilters;
     193    QDir::SortFlags sort;
     194    QDir::Filters filters;
     195
     196#ifdef QT3_SUPPORT
     197    QChar filterSepChar;
     198    bool matchAllDirs;
     199#endif
     200
     201    QScopedPointer<QAbstractFileEngine> fileEngine;
     202
     203    mutable bool fileListsInitialized;
     204    mutable QStringList files;
     205    mutable QFileInfoList fileInfos;
    171206};
    172207
    173 QDirPrivate::QDirPrivate(QDir *qq, const QDir *copy) : q_ptr(qq)
    174 #ifdef QT3_SUPPORT
    175                                                      , filterSepChar(0)
    176                                                      , matchAllDirs(false)
    177 #endif
    178 {
    179     if(copy) {
    180         copy->d_func()->data->ref.ref();
    181         data = copy->d_func()->data;
    182     } else {
    183         data = new QDirPrivate::Data;
    184         data->clear();
    185     }
    186 }
    187 
    188 QDirPrivate::~QDirPrivate()
    189 {
    190     if (!data->ref.deref())
    191         delete data;
    192     data = 0;
    193     q_ptr = 0;
    194 }
    195 
    196208/* For sorting */
    197 struct QDirSortItem {
     209struct QDirSortItem
     210{
    198211    mutable QString filename_cache;
    199212    mutable QString suffix_cache;
     
    202215
    203216
    204 class QDirSortItemComparator {
     217class QDirSortItemComparator
     218{
    205219    int qt_cmp_si_sort_flags;
    206220public:
     
    241255                               : f2->item.suffix();
    242256
    243         r = qt_cmp_si_sort_flags & QDir::LocaleAware
     257r = qt_cmp_si_sort_flags & QDir::LocaleAware
    244258            ? f1->suffix_cache.localeAwareCompare(f2->suffix_cache)
    245259            : f1->suffix_cache.compare(f2->suffix_cache);
     
    261275                                    : f2->item.fileName();
    262276
    263         r = qt_cmp_si_sort_flags & QDir::LocaleAware
     277r = qt_cmp_si_sort_flags & QDir::LocaleAware
    264278            ? f1->filename_cache.localeAwareCompare(f2->filename_cache)
    265279            : f1->filename_cache.compare(f2->filename_cache);
     
    273287
    274288inline void QDirPrivate::sortFileList(QDir::SortFlags sort, QFileInfoList &l,
    275                                       QStringList *names, QFileInfoList *infos) const
    276 {
    277     if(names)
    278         names->clear();
    279     if(infos)
    280         infos->clear();
     289                                      QStringList *names, QFileInfoList *infos)
     290{
     291    // names and infos are always empty lists or 0 here
    281292    int n = l.size();
    282     if(n > 0) {
     293    if(n > 0) {
    283294        if (n == 1 || (sort & QDir::SortByMask) == QDir::Unsorted) {
    284             if(infos)
     295            if(infos)
    285296                *infos = l;
    286             if(names) {
     297            if(names) {
    287298                for (int i = 0; i < n; ++i)
    288299                    names->append(l.at(i).fileName());
     
    292303            for (int i = 0; i < n; ++i)
    293304                si[i].item = l.at(i);
    294             qSort(si.data(), si.data()+n, QDirSortItemComparator(sort));
     305            qSort(si.data(), si.data()n, QDirSortItemComparator(sort));
    295306            // put them back in the list(s)
    296             if(infos) {
     307            if(infos) {
    297308                for (int i = 0; i < n; ++i)
    298309                    infos->append(si[i].item);
    299310            }
    300             if(names) {
     311            if(names) {
    301312                for (int i = 0; i < n; ++i)
    302313                    names->append(si[i].item.fileName());
     
    306317}
    307318
    308 inline void QDirPrivate::updateFileLists() const
    309 {
    310     if(data->listsDirty) {
     319inline void QDirPrivate::FileLists() const
     320{
     321    if) {
    311322        QFileInfoList l;
    312         QDirIterator it(data->path, data->nameFilters, data->filters);
     323        QDirIterator it(filters);
    313324        while (it.hasNext()) {
    314325            it.next();
    315326            l.append(it.fileInfo());
    316327        }
    317         sortFileList(data->sort, l, &data->files, &data->fileInfos);
    318         data->listsDirty = 0;
    319     }
    320 }
    321 
    322 QString QDirPrivate::initFileEngine(const QString &path)
    323 {
    324     detach(false);
    325     delete data->fileEngine;
    326     data->fileEngine = 0;
    327     data->clear();
    328     data->fileEngine = QAbstractFileEngine::create(path);
    329     return data->fileEngine->fileName(QAbstractFileEngine::DefaultName);
    330 }
    331 
    332 void QDirPrivate::detach(bool createFileEngine)
    333 {
    334     qAtomicDetach(data);
    335     if (createFileEngine) {
    336         QAbstractFileEngine *newFileEngine = QAbstractFileEngine::create(data->path);
    337         delete data->fileEngine;
    338         data->fileEngine = newFileEngine;
    339     }
     328        sortFileList(sort, l, &files, &fileInfos);
     329        fileListsInitialized = true;
     330    }
     331}
     332
     333inline void QDirPrivate::initFileEngine()
     334{
     335    fileEngine.reset(QAbstractFileEngine::create(path));
    340336}
    341337
     
    521517    \sa currentPath()
    522518*/
    523 
    524 QDir::QDir(const QString &path) : d_ptr(new QDirPrivate(this))
    525 {
    526     Q_D(QDir);
    527     d->setPath(path.isEmpty() ? QString::fromLatin1(".") : path);
    528     d->data->nameFilters = QStringList(QString::fromLatin1("*"));
    529     d->data->filters = AllEntries;
    530     d->data->sort = SortFlags(Name | IgnoreCase);
     519QDir::QDir(const QString &path) : d_ptr(new QDirPrivate(path))
     520{
    531521}
    532522
     
    549539    \sa exists(), setPath(), setNameFilter(), setFilter(), setSorting()
    550540*/
    551 
    552541QDir::QDir(const QString &path, const QString &nameFilter,
    553            SortFlags sort, Filters filters)  : d_ptr(new QDirPrivate(this))
    554 {
    555     Q_D(QDir);
    556     d->setPath(path.isEmpty() ? QString::fromLatin1(".") : path);
    557     d->data->nameFilters = QDir::nameFiltersFromString(nameFilter);
    558     bool empty = d->data->nameFilters.isEmpty();
    559     if(!empty) {
    560         empty = true;
    561         for(int i = 0; i < d->data->nameFilters.size(); ++i) {
    562             if(!d->data->nameFilters.at(i).isEmpty()) {
    563                 empty = false;
    564                 break;
    565             }
    566         }
    567     }
    568     if (empty)
    569         d->data->nameFilters = QStringList(QString::fromLatin1("*"));
    570     d->data->sort = sort;
    571     d->data->filters = filters;
     542           SortFlags sort, Filters filters)
     543    : d_ptr(new QDirPrivate(path, QDir::nameFiltersFromString(nameFilter), sort, filters))
     544{
    572545}
    573546
     
    578551    \sa operator=()
    579552*/
    580 
    581 QDir::QDir(const QDir &dir)  : d_ptr(new QDirPrivate(this, &dir))
     553QDir::QDir(const QDir &dir)
     554)
    582555{
    583556}
     
    587560    effect on the underlying directory in the file system.
    588561*/
    589 
    590562QDir::~QDir()
    591563{
     
    608580      absoluteFilePath(), isRelative(), makeAbsolute()
    609581*/
    610 
    611582void QDir::setPath(const QString &path)
    612583{
    613     Q_D(QDir);
    614     d->setPath(path);
     584    d_ptr->setPath(path);
    615585}
    616586
     
    625595    absoluteFilePath(), toNativeSeparators(), makeAbsolute()
    626596*/
    627 
    628597QString QDir::path() const
    629598{
    630     Q_D(const QDir);
    631     return d->data->path;
     599    );
     600    return d->path;
    632601}
    633602
     
    640609    dirName(), absoluteFilePath()
    641610*/
    642 
    643611QString QDir::absolutePath() const
    644612{
    645     Q_D(const QDir);
    646     QString ret = d->data->path;
     613    );
     614    QString ret = d->path;
    647615    if (QDir::isRelativePath(ret))
    648616        ret = absoluteFilePath(QString::fromLatin1(""));
    649617    return cleanPath(ret);
    650618}
    651 
    652619
    653620/*!
     
    667634        absoluteFilePath()
    668635*/
    669 
    670636QString QDir::canonicalPath() const
    671637{
    672     Q_D(const QDir);
    673 
    674     if(!d->data->fileEngine)
    675         return QLatin1String("");
    676     return cleanPath(d->data->fileEngine->fileName(QAbstractFileEngine::CanonicalName));
     638    return cleanPath(d_ptr->fileEngine->fileName(QAbstractFileEngine::CanonicalName));
    677639}
    678640
     
    688650    \sa path(), filePath(), absolutePath(), absoluteFilePath()
    689651*/
    690 
    691652QString QDir::dirName() const
    692653{
    693     Q_D(const QDir);
    694     int pos = d->data->path.lastIndexOf(QLatin1Char('/'));
     654    );
     655    int pos = d->path.lastIndexOf(QLatin1Char('/'));
    695656    if (pos == -1)
    696         return d->data->path;
    697     return d->data->path.mid(pos + 1);
     657        return d->path;
     658    return d->path.mid(pos + 1);
    698659}
    699660
     
    707668    \sa dirName() absoluteFilePath(), isRelative(), canonicalPath()
    708669*/
    709 
    710670QString QDir::filePath(const QString &fileName) const
    711671{
    712     Q_D(const QDir);
     672    );
    713673    if (isAbsolutePath(fileName))
    714674        return QString(fileName);
    715675
    716     QString ret = d->data->path;
    717     if(!fileName.isEmpty()) {
     676    QString ret = d->path;
     677    if(!fileName.isEmpty()) {
    718678        if (!ret.isEmpty() && ret[(int)ret.length()-1] != QLatin1Char('/') && fileName[0] != QLatin1Char('/'))
    719679            ret += QLatin1Char('/');
     
    731691    \sa relativeFilePath() filePath() canonicalPath()
    732692*/
    733 
    734693QString QDir::absoluteFilePath(const QString &fileName) const
    735694{
    736     Q_D(const QDir);
     695    );
    737696
    738697#ifdef Q_OS_OS2
     
    791750    if (isAbsolutePath(fileName))
    792751        return fileName;
    793     if(!d->data->fileEngine)
    794         return fileName;
    795752
    796753    QString ret;
    797754#ifndef QT_NO_FSFILEENGINE
    798     if (isRelativePath(d->data->path)) //get pwd
     755    if (isRelativePath(d->path)) //get pwd
    799756        ret = QFSFileEngine::currentPath(fileName);
    800757#endif
    801     if(!d->data->path.isEmpty() && d->data->path != QLatin1String(".")) {
     758    if->path != QLatin1String(".")) {
    802759        if (!ret.isEmpty() && !ret.endsWith(QLatin1Char('/')))
    803760            ret += QLatin1Char('/');
    804         ret += d->data->path;
     761        ret += d->path;
    805762    }
    806763    if (!fileName.isEmpty()) {
     
    821778    \sa absoluteFilePath() filePath() canonicalPath()
    822779*/
    823 
    824780QString QDir::relativeFilePath(const QString &fileName) const
    825781{
     
    908864    QString n(pathName);
    909865#if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX) || defined(Q_OS_SYMBIAN)
    910     for (int i=0; i<(int)n.length(); i++) {
     866    for (int i) {
    911867        if (n[i] == QLatin1Char('/'))
    912868            n[i] = QLatin1Char('\\');
     
    932888    QString n(pathName);
    933889#if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX) || defined(Q_OS_SYMBIAN)
    934     for (int i=0; i<(int)n.length(); i++) {
     890    for (int i) {
    935891        if (n[i] == QLatin1Char('\\'))
    936892            n[i] = QLatin1Char('/');
     
    951907    \sa cdUp(), isReadable(), exists(), path()
    952908*/
    953 
    954909bool QDir::cd(const QString &dirName)
    955910{
    956     Q_D(QDir);
     911    // Don't detach just yet.
     912    const QDirPrivate * const d = d_ptr.constData();
    957913
    958914    if (dirName.isEmpty() || dirName == QLatin1String("."))
    959915        return true;
    960     QString newPath = d->data->path;
     916    QString newPath = d->path;
    961917    if (isAbsolutePath(dirName)) {
    962918        newPath = cleanPath(dirName);
     
    971927        newPath += dirName;
    972928        if (dirName.indexOf(QLatin1Char('/')) >= 0
    973             || d->data->path == QLatin1String(".")
     929            || d->path == QLatin1String(".")
    974930            || dirName == QLatin1String("..")) {
    975931            newPath = cleanPath(newPath);
     
    987943        }
    988944    }
    989     {
    990         QFileInfo fi(newPath);
    991         if (!(fi.exists() && fi.isDir()))
    992             return false;
    993     }
    994 
    995     d->setPath(newPath);
    996     refresh();
     945
     946    );
     947   
     948
     949   
     950        return false;
     951
     952    ();
    997953    return true;
    998954}
     
    1008964    \sa cd(), isReadable(), exists(), path()
    1009965*/
    1010 
    1011966bool QDir::cdUp()
    1012967{
     
    1017972    Returns the string list set by setNameFilters()
    1018973*/
    1019 
    1020974QStringList QDir::nameFilters() const
    1021975{
    1022     Q_D(const QDir);
    1023 
    1024     return d->data->nameFilters;
     976    const QDirPrivate* d = d_ptr.constData();
     977    return d->nameFilters;
    1025978}
    1026979
     
    1040993    \sa nameFilters(), setFilter()
    1041994*/
    1042 
    1043995void QDir::setNameFilters(const QStringList &nameFilters)
    1044996{
    1045     Q_D(QDir);
    1046     d->detach();
    1047     d->data->nameFilters = nameFilters;
     997    QDirPrivate* d = d_ptr.data();
     998    d->initFileEngine();
     999    d->clearFileLists();
     1000
     1001    d->nameFilters = nameFilters;
    10481002}
    10491003
     
    10961050    }
    10971051
    1098     for (int i = 0; i < prefix.count(); i++) {
     1052    for (int i = 0; i < prefix.count(); ) {
    10991053        if (!prefix.at(i).isLetterOrNumber()) {
    11001054            qWarning("QDir::setSearchPaths: Prefix can only contain letters or numbers");
     
    11461100    Returns the value set by setFilter()
    11471101*/
    1148 
    11491102QDir::Filters QDir::filter() const
    11501103{
    1151     Q_D(const QDir);
    1152 
    1153     return d->data->filters;
     1104    const QDirPrivate* d = d_ptr.constData();
     1105    return d->filters;
    11541106}
    11551107
     
    11701122                       systems that don't support symbolic links).
    11711123    \value NoDotAndDotDot Do not list the special entries "." and "..".
     1124
     1125
    11721126    \value AllEntries  List directories, files, drives and symlinks (this does not list
    11731127                broken symlinks unless you specify System).
     
    12281182    \sa filter(), setNameFilters()
    12291183*/
    1230 
    12311184void QDir::setFilter(Filters filters)
    12321185{
    1233     Q_D(QDir);
    1234 
    1235     d->detach();
    1236     d->data->filters = filters;
     1186    QDirPrivate* d = d_ptr.data();
     1187    d->initFileEngine();
     1188    d->clearFileLists();
     1189
     1190    d->filters = filters;
    12371191}
    12381192
     
    12421196    \sa setSorting() SortFlag
    12431197*/
    1244 
    12451198QDir::SortFlags QDir::sorting() const
    12461199{
    1247     Q_D(const QDir);
    1248 
    1249     return d->data->sort;
     1200    const QDirPrivate* d = d_ptr.constData();
     1201    return d->sort;
    12501202}
    12511203
     
    12881240    \sa sorting() SortFlag
    12891241*/
    1290 
    12911242void QDir::setSorting(SortFlags sort)
    12921243{
    1293     Q_D(QDir);
    1294 
    1295     d->detach();
    1296     d->data->sort = sort;
    1297 }
    1298 
     1244    Q);
     1245    d->initFileEngine();
     1246    d->();
     1247
     1248    d->sort = sort;
     1249}
    12991250
    13001251/*!
     
    13051256    \sa operator[](), entryList()
    13061257*/
    1307 
    13081258uint QDir::count() const
    13091259{
    1310     Q_D(const QDir);
    1311 
    1312     d->updateFileLists();
    1313     return d->data->files.count();
     1260    const QDirPrivate* d = d_ptr.constData();
     1261    d->initFileLists();
     1262    return d->files.count();
    13141263}
    13151264
     
    13171266    Returns the file name at position \a pos in the list of file
    13181267    names. Equivalent to entryList().at(index).
    1319 
    1320     Returns an empty string if \a pos is out of range or if the
    1321     entryList() function failed.
     1268    \a pos must be a valid index position in the list (i.e., 0 <= pos < count()).
    13221269
    13231270    \sa count(), entryList()
    13241271*/
    1325 
    13261272QString QDir::operator[](int pos) const
    13271273{
    1328     Q_D(const QDir);
    1329 
    1330     d->updateFileLists();
    1331     return d->data->files[pos];
     1274    const QDirPrivate* d = d_ptr.constData();
     1275    d->initFileLists();
     1276    return d->files[pos];
    13321277}
    13331278
     
    13511296    \sa entryInfoList(), setNameFilters(), setSorting(), setFilter()
    13521297*/
    1353 
    13541298QStringList QDir::entryList(Filters filters, SortFlags sort) const
    13551299{
    1356     Q_D(const QDir);
    1357 
    1358     return entryList(d->data->nameFilters, filters, sort);
     1300    const QDirPrivate* d = d_ptr.constData();
     1301    return entryList(d->nameFilters, filters, sort);
    13591302}
    13601303
     
    13781321QFileInfoList QDir::entryInfoList(Filters filters, SortFlags sort) const
    13791322{
    1380     Q_D(const QDir);
    1381 
    1382     return entryInfoList(d->data->nameFilters, filters, sort);
     1323    const QDirPrivate* d = d_ptr.constData();
     1324    return entryInfoList(d->nameFilters, filters, sort);
    13831325}
    13841326
     
    13991341    \sa entryInfoList(), setNameFilters(), setSorting(), setFilter()
    14001342*/
    1401 
    14021343QStringList QDir::entryList(const QStringList &nameFilters, Filters filters,
    14031344                            SortFlags sort) const
    14041345{
    1405     Q_D(const QDir);
     1346    );
    14061347
    14071348    if (filters == NoFilter)
    1408         filters = d->data->filters;
     1349        filters = d->filters;
    14091350#ifdef QT3_SUPPORT
    14101351    if (d->matchAllDirs)
     
    14121353#endif
    14131354    if (sort == NoSort)
    1414         sort = d->data->sort;
    1415     if (filters == NoFilter && sort == NoSort && nameFilters == d->data->nameFilters) {
    1416         d->updateFileLists();
    1417         return d->data->files;
    1418     }
     1355        sort = d->sort;
     1356
     1357    if (filters == d->filters && sort == d->sort && nameFilters == d->nameFilters) {
     1358        d->initFileLists();
     1359        return d->files;
     1360    }
     1361
    14191362    QFileInfoList l;
    1420     QDirIterator it(d->data->path, nameFilters, filters);
     1363    QDirIterator it(d->path, nameFilters, filters);
    14211364    while (it.hasNext()) {
    14221365        it.next();
     
    14441387    \sa entryList(), setNameFilters(), setSorting(), setFilter(), isReadable(), exists()
    14451388*/
    1446 
    14471389QFileInfoList QDir::entryInfoList(const QStringList &nameFilters, Filters filters,
    14481390                                  SortFlags sort) const
    14491391{
    1450     Q_D(const QDir);
     1392    );
    14511393
    14521394    if (filters == NoFilter)
    1453         filters = d->data->filters;
     1395        filters = d->filters;
    14541396#ifdef QT3_SUPPORT
    14551397    if (d->matchAllDirs)
     
    14571399#endif
    14581400    if (sort == NoSort)
    1459         sort = d->data->sort;
    1460     if (filters == NoFilter && sort == NoSort && nameFilters == d->data->nameFilters) {
    1461         d->updateFileLists();
    1462         return d->data->fileInfos;
    1463     }
     1401        sort = d->sort;
     1402
     1403    if (filters == d->filters && sort == d->sort && nameFilters == d->nameFilters) {
     1404        d->initFileLists();
     1405        return d->fileInfos;
     1406    }
     1407
    14641408    QFileInfoList l;
    1465     QDirIterator it(d->data->path, nameFilters, filters);
     1409    QDirIterator it(d->path, nameFilters, filters);
    14661410    while (it.hasNext()) {
    14671411        it.next();
     
    14801424    \sa rmdir()
    14811425*/
    1482 
    14831426bool QDir::mkdir(const QString &dirName) const
    14841427{
    1485     Q_D(const QDir);
     1428    );
    14861429
    14871430    if (dirName.isEmpty()) {
     
    14891432        return false;
    14901433    }
    1491     if(!d->data->fileEngine)
    1492         return false;
    14931434
    14941435#ifdef Q_OS_OS2
     
    14981439    QString fn = filePath(dirName);
    14991440#endif
    1500     return d->data->fileEngine->mkdir(fn, false);
     1441    return d->fileEngine->mkdir(fn, false);
    15011442}
    15021443
     
    15101451    \sa mkdir()
    15111452*/
    1512 
    15131453bool QDir::rmdir(const QString &dirName) const
    15141454{
    1515     Q_D(const QDir);
     1455    );
    15161456
    15171457    if (dirName.isEmpty()) {
     
    15191459        return false;
    15201460    }
    1521     if(!d->data->fileEngine)
    1522         return false;
    15231461
    15241462#ifdef Q_OS_OS2
     
    15281466    QString fn = filePath(dirName);
    15291467#endif
    1530     return d->data->fileEngine->rmdir(fn, false);
     1468    return d->fileEngine->rmdir(fn, false);
    15311469}
    15321470
     
    15411479    \sa rmpath()
    15421480*/
    1543 
    15441481bool QDir::mkpath(const QString &dirPath) const
    15451482{
    1546     Q_D(const QDir);
     1483    );
    15471484
    15481485    if (dirPath.isEmpty()) {
     
    15501487        return false;
    15511488    }
    1552     if(!d->data->fileEngine)
    1553         return false;
    15541489
    15551490#ifdef Q_OS_OS2
     
    15591494    QString fn = filePath(dirPath);
    15601495#endif
    1561     return d->data->fileEngine->mkdir(fn, true);
     1496    return d->fileEngine->mkdir(fn, true);
    15621497}
    15631498
     
    15751510bool QDir::rmpath(const QString &dirPath) const
    15761511{
    1577     Q_D(const QDir);
     1512    );
    15781513
    15791514    if (dirPath.isEmpty()) {
     
    15811516        return false;
    15821517    }
    1583     if(!d->data->fileEngine)
    1584         return false;
    15851518
    15861519#ifdef Q_OS_OS2
     
    15901523    QString fn = filePath(dirPath);
    15911524#endif
    1592     return d->data->fileEngine->rmdir(fn, true);
     1525    return d->fileEngine->rmdir(fn, true);
    15931526}
    15941527
     
    16021535    \sa QFileInfo::isReadable()
    16031536*/
    1604 
    1605 
    16061537bool QDir::isReadable() const
    16071538{
    1608     Q_D(const QDir);
    1609 
    1610     if(!d->data->fileEngine)
    1611         return false;
    1612     const QAbstractFileEngine::FileFlags info = d->data->fileEngine->fileFlags(QAbstractFileEngine::DirectoryType
    1613                                                                        |QAbstractFileEngine::PermsMask);
    1614     if(!(info & QAbstractFileEngine::DirectoryType))
     1539    const QDirPrivate* d = d_ptr.constData();
     1540
     1541    const QAbstractFileEngine::FileFlags info =
     1542        d->fileEngine->fileFlags(QAbstractFileEngine::DirectoryType
     1543                                       | QAbstractFileEngine::PermsMask);
     1544    if (!(info & QAbstractFileEngine::DirectoryType))
    16151545        return false;
    16161546    return info & QAbstractFileEngine::ReadUserPerm;
     
    16281558    \sa QFileInfo::exists(), QFile::exists()
    16291559*/
    1630 
    16311560bool QDir::exists() const
    16321561{
    1633     Q_D(const QDir);
    1634 
    1635     if(!d->data->fileEngine)
    1636         return false;
    1637     const QAbstractFileEngine::FileFlags info =
    1638         d->data->fileEngine->fileFlags(
    1639             QAbstractFileEngine::DirectoryType
    1640             | QAbstractFileEngine::ExistsFlag
    1641             | QAbstractFileEngine::Refresh);
    1642     if(!(info & QAbstractFileEngine::DirectoryType))
    1643         return false;
    1644     return info & QAbstractFileEngine::ExistsFlag;
     1562    return d_ptr->exists();
    16451563}
    16461564
     
    16571575    \sa root(), rootPath()
    16581576*/
    1659 
    16601577bool QDir::isRoot() const
    16611578{
    1662     Q_D(const QDir);
    1663 
    1664     if(!d->data->fileEngine)
    1665         return true;
    1666     return d->data->fileEngine->fileFlags(QAbstractFileEngine::FlagsMask) & QAbstractFileEngine::RootFlag;
     1579    return d_ptr->fileEngine->fileFlags(QAbstractFileEngine::FlagsMask) & QAbstractFileEngine::RootFlag;
    16671580}
    16681581
     
    16921605    \sa makeAbsolute() isAbsolute() isAbsolutePath() cleanPath()
    16931606*/
    1694 
    16951607bool QDir::isRelative() const
    16961608{
    1697     Q_D(const QDir);
    1698 
    1699     if(!d->data->fileEngine)
    1700         return false;
    1701     return d->data->fileEngine->isRelativePath();
     1609    return d_ptr->fileEngine->isRelativePath();
    17021610}
    17031611
     
    17101618    \sa isAbsolute() isAbsolutePath() isRelative() cleanPath()
    17111619*/
    1712 
    17131620bool QDir::makeAbsolute() // ### What do the return values signify?
    17141621{
    1715     Q_D(QDir);
    1716 
    1717     if(!d->data->fileEngine)
     1622    QString absolutePath = d_ptr.constData()->fileEngine->fileName(QAbstractFileEngine::AbsoluteName);
     1623    if (QDir::isRelativePath(absolutePath))
    17181624        return false;
    1719     QString absolutePath = d->data->fileEngine->fileName(QAbstractFileEngine::AbsoluteName);
    1720     if(QDir::isRelativePath(absolutePath))
     1625
     1626    QScopedPointer<QDirPrivate> dir(new QDirPrivate(*d_ptr.constData()));
     1627    dir->setPath(absolutePath);
     1628
     1629    d_ptr = dir.take();
     1630
     1631    if (!(d_ptr->fileEngine->fileFlags(QAbstractFileEngine::TypesMask) & QAbstractFileEngine::DirectoryType))
    17211632        return false;
    1722     d->detach();
    1723     d->data->path = absolutePath;
    1724     d->data->fileEngine->setFileName(absolutePath);
    1725     if(!(d->data->fileEngine->fileFlags(QAbstractFileEngine::TypesMask) & QAbstractFileEngine::DirectoryType))
    1726         return false;
     1633
    17271634    return true;
    17281635}
     
    17371644    \snippet doc/src/snippets/code/src_corelib_io_qdir.cpp 10
    17381645*/
    1739 
    17401646bool QDir::operator==(const QDir &dir) const
    17411647{
    1742     const QDirPrivate *d = d_func();
    1743     const QDirPrivate *other = dir.d_func();
    1744 
    1745     if(d->data == other->data)
     1648    const QDirPrivate *d = d_();
     1649    const QDirPrivate *other = dir.d_();
     1650
     1651    if)
    17461652        return true;
    1747     Q_ASSERT(d->data->fileEngine && other->data->fileEngine);
    1748     if(d->data->fileEngine->caseSensitive() != other->data->fileEngine->caseSensitive())
     1653    if (d->fileEngine->caseSensitive() != other->fileEngine->caseSensitive())
    17491654        return false;
    1750     if(d->data->filters == other->data->filters
    1751        && d->data->sort == other->data->sort
    1752        && d->data->nameFilters == other->data->nameFilters) {
     1655    if->filters
     1656       && d->->sort
     1657       && d->->nameFilters) {
    17531658        QString dir1 = absolutePath(), dir2 = dir.absolutePath();
    1754         if(!other->data->fileEngine->caseSensitive())
     1659        if->fileEngine->caseSensitive())
    17551660            return (dir1.toLower() == dir2.toLower());
    17561661
     
    17651670    object.
    17661671*/
    1767 
    17681672QDir &QDir::operator=(const QDir &dir)
    17691673{
    1770     if (this == &dir)
    1771         return *this;
    1772 
    1773     Q_D(QDir);
    1774     qAtomicAssign(d->data, dir.d_func()->data);
     1674    d_ptr = dir.d_ptr;
    17751675    return *this;
    17761676}
     
    17841684    Use setPath() instead.
    17851685*/
    1786 
    17871686QDir &QDir::operator=(const QString &path)
    17881687{
    1789     Q_D(QDir);
    1790 
    1791     d->setPath(path);
     1688    d_ptr->setPath(path);
    17921689    return *this;
    17931690}
     
    18051702*/
    18061703
    1807 
    18081704/*!
    18091705    Removes the file, \a fileName.
     
    18121708    returns false.
    18131709*/
    1814 
    18151710bool QDir::remove(const QString &fileName)
    18161711{
     
    18191714        return false;
    18201715    }
    1821     QString p = filePath(fileName);
    1822     return QFile::remove(p);
     1716    return QFile::remove(filePath(fileName));
    18231717}
    18241718
     
    18341728    \a newName points to an open file.
    18351729*/
    1836 
    18371730bool QDir::rename(const QString &oldName, const QString &newName)
    18381731{
    1839     Q_D(QDir);
    1840 
    18411732    if (oldName.isEmpty() || newName.isEmpty()) {
    18421733        qWarning("QDir::rename: Empty or null file name(s)");
    18431734        return false;
    18441735    }
    1845     if(!d->data->fileEngine)
    1846         return false;
    18471736
    18481737    QFile file(filePath(oldName));
    1849     if(!file.exists())
     1738    if(!file.exists())
    18501739        return false;
    18511740    return file.rename(filePath(newName));
     
    18621751    \sa QFileInfo::exists(), QFile::exists()
    18631752*/
    1864 
    18651753bool QDir::exists(const QString &name) const
    18661754{
     
    18691757        return false;
    18701758    }
    1871     QString tmp = filePath(name);
    1872     return QFile::exists(tmp);
     1759    return QFile::exists(filePath(name));
    18731760}
    18741761
     
    18821769    \sa root(), rootPath()
    18831770*/
    1884 
    18851771QFileInfoList QDir::drives()
    18861772{
     
    19021788    toNativeSeparators().
    19031789*/
    1904 
    19051790QChar QDir::separator()
    19061791{
     
    19211806    returns false.
    19221807
    1923     \sa current() currentPath() home() root() temp()
    1924 */
    1925 
     1808    \sa current(), currentPath(), home(), root(), temp()
     1809*/
    19261810bool QDir::setCurrent(const QString &path)
    19271811{
     
    19421826    ensuring that its path() will be the same as its absolutePath().
    19431827
    1944     \sa currentPath(), home(), root(), temp()
     1828    \sa currentPath(), home(), root(), temp()
    19451829*/
    19461830
     
    19481832    Returns the absolute path of the application's current directory.
    19491833
    1950     \sa current(), homePath(), rootPath(), tempPath()
     1834    \sa current(), homePath(), rootPath(), tempPath()
    19511835*/
    19521836QString QDir::currentPath()
     
    19651849    Use currentPath() instead.
    19661850
    1967     \sa currentPath()
     1851    \sa currentPath()
    19681852*/
    19691853
     
    20221906
    20231907/*!
    2024   \fn QString QDir::homeDirPath()
    2025 
    2026   Returns the absolute path of the user's home directory.
    2027 
    2028   Use homePath() instead.
    2029 
    2030   \sa homePath()
    2031  */
     1908  \fn QString QDir::homeDirPath()
     1909
     1910  Returns the absolute path of the user's home directory.
     1911
     1912  Use homePath() instead.
     1913
     1914  \sa homePath()
     1915*/
    20321916
    20331917/*!
     
    20951979
    20961980/*!
    2097   \fn QString QDir::rootDirPath()
    2098 
    2099   Returns the absolute path of the root directory.
    2100 
    2101   Use rootPath() instead.
    2102 
    2103   \sa rootPath()
     1981  \fn QString QDir::rootDirPath()
     1982
     1983  Returns the absolute path of the root directory.
     1984
     1985  Use rootPath() instead.
     1986
     1987  \sa rootPath()
    21041988*/
    21051989
     
    21141998    \sa {QRegExp wildcard matching}, QRegExp::exactMatch() entryList() entryInfoList()
    21151999*/
    2116 
    2117 
    21182000bool QDir::match(const QStringList &filters, const QString &fileName)
    21192001{
    2120     for(QStringList::ConstIterator sit = filters.begin(); sit != filters.end(); ++sit) {
     2002    fornd(); ++sit) {
    21212003        QRegExp rx(*sit, Qt::CaseInsensitive, QRegExp::Wildcard);
    21222004        if (rx.exactMatch(fileName))
     
    21342016    \sa {QRegExp wildcard matching}, QRegExp::exactMatch() entryList() entryInfoList()
    21352017*/
    2136 
    21372018bool QDir::match(const QString &filter, const QString &fileName)
    21382019{
    21392020    return match(nameFiltersFromString(filter), fileName);
    21402021}
    2141 #endif
     2022#endif
    21422023
    21432024/*!
     
    21522033    \sa absolutePath() canonicalPath()
    21532034*/
    2154 
    21552035QString QDir::cleanPath(const QString &path)
    21562036{
     
    21592039    QString name = path;
    21602040    QChar dir_separator = separator();
    2161     if(dir_separator != QLatin1Char('/'))
    2162         name.replace(dir_separator, QLatin1Char('/'));
     2041    if(dir_separator != QLatin1Char('/'))
     2042 name.replace(dir_separator, QLatin1Char('/'));
    21632043
    21642044    int used = 0, levels = 0;
     
    21682048
    21692049    const QChar *p = name.unicode();
    2170     for(int i = 0, last = -1, iwrite = 0; i < len; i++) {
    2171         if(p[i] == QLatin1Char('/')) {
    2172             while(i < len-1 && p[i+1] == QLatin1Char('/')) {
     2050    for) {
     2051        if(p[i] == QLatin1Char('/')) {
     2052            while(i < len-1 && p[i+1] == QLatin1Char('/')) {
    21732053#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_OS2) //allow unc paths
    2174                 if(!i)
     2054                if(!i)
    21752055                    break;
    21762056#endif
     
    21782058            }
    21792059            bool eaten = false;
    2180             if(i < len - 1 && p[i+1] == QLatin1Char('.')) {
     2060            if(i < len - 1 && p[i+1] == QLatin1Char('.')) {
    21812061                int dotcount = 1;
    2182                 if(i < len - 2 && p[i+2] == QLatin1Char('.'))
     2062                if(i < len - 2 && p[i+2] == QLatin1Char('.'))
    21832063                    dotcount++;
    2184                 if(i == len - dotcount - 1) {
    2185                     if(dotcount == 1) {
     2064                if(i == len - dotcount - 1) {
     2065                    if(dotcount == 1) {
    21862066                        break;
    2187                     } else if(levels) {
    2188                         if(last == -1) {
    2189                             for(int i2 = iwrite-1; i2 >= 0; i2--) {
    2190                                 if(out[i2] == QLatin1Char('/')) {
     2067                    } else if(levels) {
     2068                        if(last == -1) {
     2069                            for(int i2 = iwrite-1; i2 >= 0; i2--) {
     2070                                if(out[i2] == QLatin1Char('/')) {
    21912071                                    last = i2;
    21922072                                    break;
     
    21972077                        break;
    21982078                    }
    2199                 } else if(p[i+dotcount+1] == QLatin1Char('/')) {
    2200                     if(dotcount == 2 && levels) {
    2201                         if(last == -1 || iwrite - last == 1) {
    2202                             for(int i2 = (last == -1) ? (iwrite-1) : (last-1); i2 >= 0; i2--) {
    2203                                 if(out[i2] == QLatin1Char('/')) {
     2079                } else if(p[i+dotcount+1] == QLatin1Char('/')) {
     2080                    if(dotcount == 2 && levels) {
     2081                        if(last == -1 || iwrite - last == 1) {
     2082                            for(int i2 = (last == -1) ? (iwrite-1) : (last-1); i2 >= 0; i2--) {
     2083                                if(out[i2] == QLatin1Char('/')) {
    22042084                                    eaten = true;
    22052085                                    last = i2;
     
    22102090                            eaten = true;
    22112091                        }
    2212                         if(eaten) {
     2092                        if(eaten) {
    22132093                            levels--;
    22142094                            used -= iwrite - last;
     
    22222102                        last = -1;
    22232103                        ++i;
    2224                     } else if(dotcount == 1) {
     2104                    } else if(dotcount == 1) {
    22252105                        eaten = true;
    22262106                    }
    2227                     if(eaten)
     2107                    if(eaten)
    22282108                        i += dotcount;
    22292109                } else {
    22302110                    levels++;
    22312111                }
    2232             } else if(last != -1 && iwrite - last == 1) {
     2112            } else if(last != -1 && iwrite - last == 1) {
    22332113#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) || defined(Q_OS_OS2)
    22342114                eaten = (iwrite > 2);
     
    22372117#endif
    22382118                last = -1;
    2239             } else if(last != -1 && i == len-1) {
     2119            } else if(last != -1 && i == len-1) {
    22402120                eaten = true;
    22412121            } else {
    22422122                levels++;
    22432123            }
    2244             if(!eaten)
     2124            if(!eaten)
    22452125                last = i - (i - iwrite);
    22462126            else
    22472127                continue;
    2248         } else if(!i && p[i] == QLatin1Char('.')) {
     2128        } else if(!i && p[i] == QLatin1Char('.')) {
    22492129            int dotcount = 1;
    2250             if(len >= 1 && p[1] == QLatin1Char('.'))
     2130            if(len >= 1 && p[1] == QLatin1Char('.'))
    22512131                dotcount++;
    2252             if(len >= dotcount && p[dotcount] == QLatin1Char('/')) {
    2253                 if(dotcount == 1) {
     2132            if(len >= dotcount && p[dotcount] == QLatin1Char('/')) {
     2133                if(dotcount == 1) {
    22542134                    i++;
    2255                     while(i+1 < len-1 && p[i+1] == QLatin1Char('/'))
     2135                    while(i+1 < len-1 && p[i+1] == QLatin1Char('/'))
    22562136                        i++;
    22572137                    continue;
     
    22622142        used++;
    22632143    }
    2264     QString ret;
    2265     if(used == len)
    2266         ret = name;
    2267     else
    2268         ret = QString(out, used);
    2269 
     2144
     2145    QString ret = (used == len ? name : QString(out, used));
    22702146    // Strip away last slash except for root directories
    2271     if (ret.endsWith(QLatin1Char('/'))
    2272         && !(ret.size() == 1 || (ret.size() == 3 && ret.at(1) == QLatin1Char(':'))))
    2273         ret = ret.left(ret.length() - 1);
     2147    if (ret.length() > 1 && ret.endsWith(QLatin1Char('/'))) {
     2148#if defined (Q_OS_WIN) || defined (Q_OS_SYMBIAN)
     2149        if (!(ret.length() == 3 && ret.at(1) == QLatin1Char(':')))
     2150#endif
     2151            ret.chop(1);
     2152    }
    22742153
    22752154    return ret;
     
    22822161    \sa isRelative() isAbsolutePath() makeAbsolute()
    22832162*/
    2284 
    22852163bool QDir::isRelativePath(const QString &path)
    22862164{
     
    22912169    Refreshes the directory information.
    22922170*/
    2293 
    22942171void QDir::refresh() const
    22952172{
    2296     Q_D(const QDir);
    2297 
    2298     d->data->clear();
     2173    Q);
     2174    d->initFileEngine();
     2175    d->();
    22992176}
    23002177
     
    23062183    by a space or by a semicolon.)
    23072184*/
    2308 
    23092185QStringList QDir::nameFiltersFromString(const QString &nameFilter)
    23102186{
     
    23732249bool QDir::matchAllDirs() const
    23742250{
    2375     Q_D(const QDir);
     2251    );
    23762252    return d->matchAllDirs;
    23772253}
     
    23852261void QDir::setMatchAllDirs(bool on)
    23862262{
    2387     Q_D(QDir);
     2263    QDirPrivate* d = d_ptr.data();
     2264    d->initFileEngine();
     2265    d->clearFileLists();
     2266
    23882267    d->matchAllDirs = on;
    23892268}
     
    23942273QString QDir::nameFilter() const
    23952274{
    2396     Q_D(const QDir);
    2397 
     2275    const QDirPrivate* d = d_ptr.constData();
    23982276    return nameFilters().join(QString(d->filterSepChar));
    23992277}
     
    24212299void QDir::setNameFilter(const QString &nameFilter)
    24222300{
    2423     Q_D(QDir);
     2301    QDirPrivate* d = d_ptr.data();
     2302    d->initFileEngine();
     2303    d->clearFileLists();
    24242304
    24252305    d->filterSepChar = QDirPrivate::getFilterSepChar(nameFilter);
    2426     setNameFilters(QDirPrivate::splitFilters(nameFilter, d->filterSepChar));
     2306    );
    24272307}
    24282308
     
    24982378    Use QDir::SortFlags instead.
    24992379*/
    2500 #endif
     2380#endif // QT3_SUPPORT
     2381
    25012382#ifndef QT_NO_DEBUG_STREAM
    25022383QDebug operator<<(QDebug debug, QDir::Filters filters)
     
    25112392        if (filters & QDir::Drives) flags << QLatin1String("Drives");
    25122393        if (filters & QDir::NoSymLinks) flags << QLatin1String("NoSymLinks");
    2513         if (filters & QDir::NoDotAndDotDot) flags << QLatin1String("NoDotAndDotDot");
     2394        if (filters & QDir::NoDotAndDotDot) flags << QLatin1String("NoDotAndDotDot"); // ### Qt5: remove (because NoDotAndDotDot=NoDot|NoDotDot)
     2395        if (filters & QDir::NoDot) flags << QLatin1String("NoDot");
     2396        if (filters & QDir::NoDotDot) flags << QLatin1String("NoDotDot");
    25142397        if ((filters & QDir::AllEntries) == QDir::AllEntries) flags << QLatin1String("AllEntries");
    25152398        if (filters & QDir::Readable) flags << QLatin1String("Readable");
     
    25612444    return debug.space();
    25622445}
    2563 
    2564 
    2565 
    2566 #endif
     2446#endif // QT_NO_DEBUG_STREAM
    25672447
    25682448QT_END_NAMESPACE
Note: See TracChangeset for help on using the changeset viewer.