Changeset 846 for trunk/src/corelib/io/qdir.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/corelib/io/qdir.cpp (modified) (100 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/corelib/io/qdir.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 53 53 #include "qvector.h" 54 54 #include "qalgorithms.h" 55 56 55 57 #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 62 62 #include <stdlib.h> 63 63 … … 83 83 //************* QDirPrivate 84 84 class 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 { 87 public: 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_) 100 96 #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 ©) 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 104 148 static inline QChar getFilterSepChar(const QString &nameFilter) 105 149 { … … 110 154 return sep; 111 155 } 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) 114 160 sep = getFilterSepChar(nameFilter); 115 161 QStringList ret = nameFilter.split(sep); 116 for (int i = 0; i < ret.count(); i++)162 for) 117 163 ret[i] = ret[i].trimmed(); 118 164 return ret; 119 165 } 120 166 121 struct Data { 122 inline Data() 123 : ref(1), fileEngine(0) 124 { clear(); } 125 inline Data(const Data ©) 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); 134 175 } 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 162 180 // 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; 171 206 }; 172 207 173 QDirPrivate::QDirPrivate(QDir *qq, const QDir *copy) : q_ptr(qq)174 #ifdef QT3_SUPPORT175 , filterSepChar(0)176 , matchAllDirs(false)177 #endif178 {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 196 208 /* For sorting */ 197 struct QDirSortItem { 209 struct QDirSortItem 210 { 198 211 mutable QString filename_cache; 199 212 mutable QString suffix_cache; … … 202 215 203 216 204 class QDirSortItemComparator { 217 class QDirSortItemComparator 218 { 205 219 int qt_cmp_si_sort_flags; 206 220 public: … … 241 255 : f2->item.suffix(); 242 256 243 r = qt_cmp_si_sort_flags & QDir::LocaleAware257 r = qt_cmp_si_sort_flags & QDir::LocaleAware 244 258 ? f1->suffix_cache.localeAwareCompare(f2->suffix_cache) 245 259 : f1->suffix_cache.compare(f2->suffix_cache); … … 261 275 : f2->item.fileName(); 262 276 263 r = qt_cmp_si_sort_flags & QDir::LocaleAware277 r = qt_cmp_si_sort_flags & QDir::LocaleAware 264 278 ? f1->filename_cache.localeAwareCompare(f2->filename_cache) 265 279 : f1->filename_cache.compare(f2->filename_cache); … … 273 287 274 288 inline 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 281 292 int n = l.size(); 282 if (n > 0) {293 if(n > 0) { 283 294 if (n == 1 || (sort & QDir::SortByMask) == QDir::Unsorted) { 284 if (infos)295 if(infos) 285 296 *infos = l; 286 if (names) {297 if(names) { 287 298 for (int i = 0; i < n; ++i) 288 299 names->append(l.at(i).fileName()); … … 292 303 for (int i = 0; i < n; ++i) 293 304 si[i].item = l.at(i); 294 qSort(si.data(), si.data() +n, QDirSortItemComparator(sort));305 qSort(si.data(), si.data()n, QDirSortItemComparator(sort)); 295 306 // put them back in the list(s) 296 if (infos) {307 if(infos) { 297 308 for (int i = 0; i < n; ++i) 298 309 infos->append(si[i].item); 299 310 } 300 if (names) {311 if(names) { 301 312 for (int i = 0; i < n; ++i) 302 313 names->append(si[i].item.fileName()); … … 306 317 } 307 318 308 inline void QDirPrivate:: updateFileLists() const309 { 310 if (data->listsDirty) {319 inline void QDirPrivate::FileLists() const 320 { 321 if) { 311 322 QFileInfoList l; 312 QDirIterator it( data->path, data->nameFilters, data->filters);323 QDirIterator it(filters); 313 324 while (it.hasNext()) { 314 325 it.next(); 315 326 l.append(it.fileInfo()); 316 327 } 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 333 inline void QDirPrivate::initFileEngine() 334 { 335 fileEngine.reset(QAbstractFileEngine::create(path)); 340 336 } 341 337 … … 521 517 \sa currentPath() 522 518 */ 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); 519 QDir::QDir(const QString &path) : d_ptr(new QDirPrivate(path)) 520 { 531 521 } 532 522 … … 549 539 \sa exists(), setPath(), setNameFilter(), setFilter(), setSorting() 550 540 */ 551 552 541 QDir::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 { 572 545 } 573 546 … … 578 551 \sa operator=() 579 552 */ 580 581 QDir::QDir(const QDir &dir) : d_ptr(new QDirPrivate(this, &dir))553 QDir::QDir(const QDir &dir) 554 ) 582 555 { 583 556 } … … 587 560 effect on the underlying directory in the file system. 588 561 */ 589 590 562 QDir::~QDir() 591 563 { … … 608 580 absoluteFilePath(), isRelative(), makeAbsolute() 609 581 */ 610 611 582 void QDir::setPath(const QString &path) 612 583 { 613 Q_D(QDir); 614 d->setPath(path); 584 d_ptr->setPath(path); 615 585 } 616 586 … … 625 595 absoluteFilePath(), toNativeSeparators(), makeAbsolute() 626 596 */ 627 628 597 QString QDir::path() const 629 598 { 630 Q_D(const QDir);631 return d-> data->path;599 ); 600 return d->path; 632 601 } 633 602 … … 640 609 dirName(), absoluteFilePath() 641 610 */ 642 643 611 QString QDir::absolutePath() const 644 612 { 645 Q_D(const QDir);646 QString ret = d-> data->path;613 ); 614 QString ret = d->path; 647 615 if (QDir::isRelativePath(ret)) 648 616 ret = absoluteFilePath(QString::fromLatin1("")); 649 617 return cleanPath(ret); 650 618 } 651 652 619 653 620 /*! … … 667 634 absoluteFilePath() 668 635 */ 669 670 636 QString QDir::canonicalPath() const 671 637 { 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)); 677 639 } 678 640 … … 688 650 \sa path(), filePath(), absolutePath(), absoluteFilePath() 689 651 */ 690 691 652 QString QDir::dirName() const 692 653 { 693 Q_D(const QDir);694 int pos = d-> data->path.lastIndexOf(QLatin1Char('/'));654 ); 655 int pos = d->path.lastIndexOf(QLatin1Char('/')); 695 656 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); 698 659 } 699 660 … … 707 668 \sa dirName() absoluteFilePath(), isRelative(), canonicalPath() 708 669 */ 709 710 670 QString QDir::filePath(const QString &fileName) const 711 671 { 712 Q_D(const QDir);672 ); 713 673 if (isAbsolutePath(fileName)) 714 674 return QString(fileName); 715 675 716 QString ret = d-> data->path;717 if (!fileName.isEmpty()) {676 QString ret = d->path; 677 if(!fileName.isEmpty()) { 718 678 if (!ret.isEmpty() && ret[(int)ret.length()-1] != QLatin1Char('/') && fileName[0] != QLatin1Char('/')) 719 679 ret += QLatin1Char('/'); … … 731 691 \sa relativeFilePath() filePath() canonicalPath() 732 692 */ 733 734 693 QString QDir::absoluteFilePath(const QString &fileName) const 735 694 { 736 Q_D(const QDir);695 ); 737 696 738 697 #ifdef Q_OS_OS2 … … 791 750 if (isAbsolutePath(fileName)) 792 751 return fileName; 793 if(!d->data->fileEngine)794 return fileName;795 752 796 753 QString ret; 797 754 #ifndef QT_NO_FSFILEENGINE 798 if (isRelativePath(d-> data->path)) //get pwd755 if (isRelativePath(d->path)) //get pwd 799 756 ret = QFSFileEngine::currentPath(fileName); 800 757 #endif 801 if (!d->data->path.isEmpty() && d->data->path != QLatin1String(".")) {758 if->path != QLatin1String(".")) { 802 759 if (!ret.isEmpty() && !ret.endsWith(QLatin1Char('/'))) 803 760 ret += QLatin1Char('/'); 804 ret += d-> data->path;761 ret += d->path; 805 762 } 806 763 if (!fileName.isEmpty()) { … … 821 778 \sa absoluteFilePath() filePath() canonicalPath() 822 779 */ 823 824 780 QString QDir::relativeFilePath(const QString &fileName) const 825 781 { … … 908 864 QString n(pathName); 909 865 #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) { 911 867 if (n[i] == QLatin1Char('/')) 912 868 n[i] = QLatin1Char('\\'); … … 932 888 QString n(pathName); 933 889 #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) { 935 891 if (n[i] == QLatin1Char('\\')) 936 892 n[i] = QLatin1Char('/'); … … 951 907 \sa cdUp(), isReadable(), exists(), path() 952 908 */ 953 954 909 bool QDir::cd(const QString &dirName) 955 910 { 956 Q_D(QDir); 911 // Don't detach just yet. 912 const QDirPrivate * const d = d_ptr.constData(); 957 913 958 914 if (dirName.isEmpty() || dirName == QLatin1String(".")) 959 915 return true; 960 QString newPath = d-> data->path;916 QString newPath = d->path; 961 917 if (isAbsolutePath(dirName)) { 962 918 newPath = cleanPath(dirName); … … 971 927 newPath += dirName; 972 928 if (dirName.indexOf(QLatin1Char('/')) >= 0 973 || d-> data->path == QLatin1String(".")929 || d->path == QLatin1String(".") 974 930 || dirName == QLatin1String("..")) { 975 931 newPath = cleanPath(newPath); … … 987 943 } 988 944 } 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 (); 997 953 return true; 998 954 } … … 1008 964 \sa cd(), isReadable(), exists(), path() 1009 965 */ 1010 1011 966 bool QDir::cdUp() 1012 967 { … … 1017 972 Returns the string list set by setNameFilters() 1018 973 */ 1019 1020 974 QStringList QDir::nameFilters() const 1021 975 { 1022 Q_D(const QDir); 1023 1024 return d->data->nameFilters; 976 const QDirPrivate* d = d_ptr.constData(); 977 return d->nameFilters; 1025 978 } 1026 979 … … 1040 993 \sa nameFilters(), setFilter() 1041 994 */ 1042 1043 995 void QDir::setNameFilters(const QStringList &nameFilters) 1044 996 { 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; 1048 1002 } 1049 1003 … … 1096 1050 } 1097 1051 1098 for (int i = 0; i < prefix.count(); i++) {1052 for (int i = 0; i < prefix.count(); ) { 1099 1053 if (!prefix.at(i).isLetterOrNumber()) { 1100 1054 qWarning("QDir::setSearchPaths: Prefix can only contain letters or numbers"); … … 1146 1100 Returns the value set by setFilter() 1147 1101 */ 1148 1149 1102 QDir::Filters QDir::filter() const 1150 1103 { 1151 Q_D(const QDir); 1152 1153 return d->data->filters; 1104 const QDirPrivate* d = d_ptr.constData(); 1105 return d->filters; 1154 1106 } 1155 1107 … … 1170 1122 systems that don't support symbolic links). 1171 1123 \value NoDotAndDotDot Do not list the special entries "." and "..". 1124 1125 1172 1126 \value AllEntries List directories, files, drives and symlinks (this does not list 1173 1127 broken symlinks unless you specify System). … … 1228 1182 \sa filter(), setNameFilters() 1229 1183 */ 1230 1231 1184 void QDir::setFilter(Filters filters) 1232 1185 { 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; 1237 1191 } 1238 1192 … … 1242 1196 \sa setSorting() SortFlag 1243 1197 */ 1244 1245 1198 QDir::SortFlags QDir::sorting() const 1246 1199 { 1247 Q_D(const QDir); 1248 1249 return d->data->sort; 1200 const QDirPrivate* d = d_ptr.constData(); 1201 return d->sort; 1250 1202 } 1251 1203 … … 1288 1240 \sa sorting() SortFlag 1289 1241 */ 1290 1291 1242 void QDir::setSorting(SortFlags sort) 1292 1243 { 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 } 1299 1250 1300 1251 /*! … … 1305 1256 \sa operator[](), entryList() 1306 1257 */ 1307 1308 1258 uint QDir::count() const 1309 1259 { 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(); 1314 1263 } 1315 1264 … … 1317 1266 Returns the file name at position \a pos in the list of file 1318 1267 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()). 1322 1269 1323 1270 \sa count(), entryList() 1324 1271 */ 1325 1326 1272 QString QDir::operator[](int pos) const 1327 1273 { 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]; 1332 1277 } 1333 1278 … … 1351 1296 \sa entryInfoList(), setNameFilters(), setSorting(), setFilter() 1352 1297 */ 1353 1354 1298 QStringList QDir::entryList(Filters filters, SortFlags sort) const 1355 1299 { 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); 1359 1302 } 1360 1303 … … 1378 1321 QFileInfoList QDir::entryInfoList(Filters filters, SortFlags sort) const 1379 1322 { 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); 1383 1325 } 1384 1326 … … 1399 1341 \sa entryInfoList(), setNameFilters(), setSorting(), setFilter() 1400 1342 */ 1401 1402 1343 QStringList QDir::entryList(const QStringList &nameFilters, Filters filters, 1403 1344 SortFlags sort) const 1404 1345 { 1405 Q_D(const QDir);1346 ); 1406 1347 1407 1348 if (filters == NoFilter) 1408 filters = d-> data->filters;1349 filters = d->filters; 1409 1350 #ifdef QT3_SUPPORT 1410 1351 if (d->matchAllDirs) … … 1412 1353 #endif 1413 1354 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 1419 1362 QFileInfoList l; 1420 QDirIterator it(d-> data->path, nameFilters, filters);1363 QDirIterator it(d->path, nameFilters, filters); 1421 1364 while (it.hasNext()) { 1422 1365 it.next(); … … 1444 1387 \sa entryList(), setNameFilters(), setSorting(), setFilter(), isReadable(), exists() 1445 1388 */ 1446 1447 1389 QFileInfoList QDir::entryInfoList(const QStringList &nameFilters, Filters filters, 1448 1390 SortFlags sort) const 1449 1391 { 1450 Q_D(const QDir);1392 ); 1451 1393 1452 1394 if (filters == NoFilter) 1453 filters = d-> data->filters;1395 filters = d->filters; 1454 1396 #ifdef QT3_SUPPORT 1455 1397 if (d->matchAllDirs) … … 1457 1399 #endif 1458 1400 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 1464 1408 QFileInfoList l; 1465 QDirIterator it(d-> data->path, nameFilters, filters);1409 QDirIterator it(d->path, nameFilters, filters); 1466 1410 while (it.hasNext()) { 1467 1411 it.next(); … … 1480 1424 \sa rmdir() 1481 1425 */ 1482 1483 1426 bool QDir::mkdir(const QString &dirName) const 1484 1427 { 1485 Q_D(const QDir);1428 ); 1486 1429 1487 1430 if (dirName.isEmpty()) { … … 1489 1432 return false; 1490 1433 } 1491 if(!d->data->fileEngine)1492 return false;1493 1434 1494 1435 #ifdef Q_OS_OS2 … … 1498 1439 QString fn = filePath(dirName); 1499 1440 #endif 1500 return d-> data->fileEngine->mkdir(fn, false);1441 return d->fileEngine->mkdir(fn, false); 1501 1442 } 1502 1443 … … 1510 1451 \sa mkdir() 1511 1452 */ 1512 1513 1453 bool QDir::rmdir(const QString &dirName) const 1514 1454 { 1515 Q_D(const QDir);1455 ); 1516 1456 1517 1457 if (dirName.isEmpty()) { … … 1519 1459 return false; 1520 1460 } 1521 if(!d->data->fileEngine)1522 return false;1523 1461 1524 1462 #ifdef Q_OS_OS2 … … 1528 1466 QString fn = filePath(dirName); 1529 1467 #endif 1530 return d-> data->fileEngine->rmdir(fn, false);1468 return d->fileEngine->rmdir(fn, false); 1531 1469 } 1532 1470 … … 1541 1479 \sa rmpath() 1542 1480 */ 1543 1544 1481 bool QDir::mkpath(const QString &dirPath) const 1545 1482 { 1546 Q_D(const QDir);1483 ); 1547 1484 1548 1485 if (dirPath.isEmpty()) { … … 1550 1487 return false; 1551 1488 } 1552 if(!d->data->fileEngine)1553 return false;1554 1489 1555 1490 #ifdef Q_OS_OS2 … … 1559 1494 QString fn = filePath(dirPath); 1560 1495 #endif 1561 return d-> data->fileEngine->mkdir(fn, true);1496 return d->fileEngine->mkdir(fn, true); 1562 1497 } 1563 1498 … … 1575 1510 bool QDir::rmpath(const QString &dirPath) const 1576 1511 { 1577 Q_D(const QDir);1512 ); 1578 1513 1579 1514 if (dirPath.isEmpty()) { … … 1581 1516 return false; 1582 1517 } 1583 if(!d->data->fileEngine)1584 return false;1585 1518 1586 1519 #ifdef Q_OS_OS2 … … 1590 1523 QString fn = filePath(dirPath); 1591 1524 #endif 1592 return d-> data->fileEngine->rmdir(fn, true);1525 return d->fileEngine->rmdir(fn, true); 1593 1526 } 1594 1527 … … 1602 1535 \sa QFileInfo::isReadable() 1603 1536 */ 1604 1605 1606 1537 bool QDir::isReadable() const 1607 1538 { 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)) 1615 1545 return false; 1616 1546 return info & QAbstractFileEngine::ReadUserPerm; … … 1628 1558 \sa QFileInfo::exists(), QFile::exists() 1629 1559 */ 1630 1631 1560 bool QDir::exists() const 1632 1561 { 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(); 1645 1563 } 1646 1564 … … 1657 1575 \sa root(), rootPath() 1658 1576 */ 1659 1660 1577 bool QDir::isRoot() const 1661 1578 { 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; 1667 1580 } 1668 1581 … … 1692 1605 \sa makeAbsolute() isAbsolute() isAbsolutePath() cleanPath() 1693 1606 */ 1694 1695 1607 bool QDir::isRelative() const 1696 1608 { 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(); 1702 1610 } 1703 1611 … … 1710 1618 \sa isAbsolute() isAbsolutePath() isRelative() cleanPath() 1711 1619 */ 1712 1713 1620 bool QDir::makeAbsolute() // ### What do the return values signify? 1714 1621 { 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)) 1718 1624 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)) 1721 1632 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 1727 1634 return true; 1728 1635 } … … 1737 1644 \snippet doc/src/snippets/code/src_corelib_io_qdir.cpp 10 1738 1645 */ 1739 1740 1646 bool QDir::operator==(const QDir &dir) const 1741 1647 { 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) 1746 1652 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()) 1749 1654 return false; 1750 if (d->data->filters == other->data->filters1751 && d-> data->sort == other->data->sort1752 && d-> data->nameFilters == other->data->nameFilters) {1655 if->filters 1656 && d->->sort 1657 && d->->nameFilters) { 1753 1658 QString dir1 = absolutePath(), dir2 = dir.absolutePath(); 1754 if (!other->data->fileEngine->caseSensitive())1659 if->fileEngine->caseSensitive()) 1755 1660 return (dir1.toLower() == dir2.toLower()); 1756 1661 … … 1765 1670 object. 1766 1671 */ 1767 1768 1672 QDir &QDir::operator=(const QDir &dir) 1769 1673 { 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; 1775 1675 return *this; 1776 1676 } … … 1784 1684 Use setPath() instead. 1785 1685 */ 1786 1787 1686 QDir &QDir::operator=(const QString &path) 1788 1687 { 1789 Q_D(QDir); 1790 1791 d->setPath(path); 1688 d_ptr->setPath(path); 1792 1689 return *this; 1793 1690 } … … 1805 1702 */ 1806 1703 1807 1808 1704 /*! 1809 1705 Removes the file, \a fileName. … … 1812 1708 returns false. 1813 1709 */ 1814 1815 1710 bool QDir::remove(const QString &fileName) 1816 1711 { … … 1819 1714 return false; 1820 1715 } 1821 QString p = filePath(fileName); 1822 return QFile::remove(p); 1716 return QFile::remove(filePath(fileName)); 1823 1717 } 1824 1718 … … 1834 1728 \a newName points to an open file. 1835 1729 */ 1836 1837 1730 bool QDir::rename(const QString &oldName, const QString &newName) 1838 1731 { 1839 Q_D(QDir);1840 1841 1732 if (oldName.isEmpty() || newName.isEmpty()) { 1842 1733 qWarning("QDir::rename: Empty or null file name(s)"); 1843 1734 return false; 1844 1735 } 1845 if(!d->data->fileEngine)1846 return false;1847 1736 1848 1737 QFile file(filePath(oldName)); 1849 if (!file.exists())1738 if(!file.exists()) 1850 1739 return false; 1851 1740 return file.rename(filePath(newName)); … … 1862 1751 \sa QFileInfo::exists(), QFile::exists() 1863 1752 */ 1864 1865 1753 bool QDir::exists(const QString &name) const 1866 1754 { … … 1869 1757 return false; 1870 1758 } 1871 QString tmp = filePath(name); 1872 return QFile::exists(tmp); 1759 return QFile::exists(filePath(name)); 1873 1760 } 1874 1761 … … 1882 1769 \sa root(), rootPath() 1883 1770 */ 1884 1885 1771 QFileInfoList QDir::drives() 1886 1772 { … … 1902 1788 toNativeSeparators(). 1903 1789 */ 1904 1905 1790 QChar QDir::separator() 1906 1791 { … … 1921 1806 returns false. 1922 1807 1923 \sa current() currentPath() home() root() temp() 1924 */ 1925 1808 \sa current(), currentPath(), home(), root(), temp() 1809 */ 1926 1810 bool QDir::setCurrent(const QString &path) 1927 1811 { … … 1942 1826 ensuring that its path() will be the same as its absolutePath(). 1943 1827 1944 \sa currentPath(), home(), root(), temp()1828 \sa currentPath(), home(), root(), temp() 1945 1829 */ 1946 1830 … … 1948 1832 Returns the absolute path of the application's current directory. 1949 1833 1950 \sa current(), homePath(), rootPath(), tempPath()1834 \sa current(), homePath(), rootPath(), tempPath() 1951 1835 */ 1952 1836 QString QDir::currentPath() … … 1965 1849 Use currentPath() instead. 1966 1850 1967 \sa currentPath() 1851 \sa currentPath() 1968 1852 */ 1969 1853 … … 2022 1906 2023 1907 /*! 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 */ 2032 1916 2033 1917 /*! … … 2095 1979 2096 1980 /*! 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() 2104 1988 */ 2105 1989 … … 2114 1998 \sa {QRegExp wildcard matching}, QRegExp::exactMatch() entryList() entryInfoList() 2115 1999 */ 2116 2117 2118 2000 bool QDir::match(const QStringList &filters, const QString &fileName) 2119 2001 { 2120 for (QStringList::ConstIterator sit = filters.begin(); sit != filters.end(); ++sit) {2002 fornd(); ++sit) { 2121 2003 QRegExp rx(*sit, Qt::CaseInsensitive, QRegExp::Wildcard); 2122 2004 if (rx.exactMatch(fileName)) … … 2134 2016 \sa {QRegExp wildcard matching}, QRegExp::exactMatch() entryList() entryInfoList() 2135 2017 */ 2136 2137 2018 bool QDir::match(const QString &filter, const QString &fileName) 2138 2019 { 2139 2020 return match(nameFiltersFromString(filter), fileName); 2140 2021 } 2141 #endif 2022 #endif 2142 2023 2143 2024 /*! … … 2152 2033 \sa absolutePath() canonicalPath() 2153 2034 */ 2154 2155 2035 QString QDir::cleanPath(const QString &path) 2156 2036 { … … 2159 2039 QString name = path; 2160 2040 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('/')); 2163 2043 2164 2044 int used = 0, levels = 0; … … 2168 2048 2169 2049 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('/')) { 2173 2053 #if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_OS2) //allow unc paths 2174 if (!i)2054 if(!i) 2175 2055 break; 2176 2056 #endif … … 2178 2058 } 2179 2059 bool eaten = false; 2180 if (i < len - 1 && p[i+1] == QLatin1Char('.')) {2060 if(i < len - 1 && p[i+1] == QLatin1Char('.')) { 2181 2061 int dotcount = 1; 2182 if (i < len - 2 && p[i+2] == QLatin1Char('.'))2062 if(i < len - 2 && p[i+2] == QLatin1Char('.')) 2183 2063 dotcount++; 2184 if (i == len - dotcount - 1) {2185 if (dotcount == 1) {2064 if(i == len - dotcount - 1) { 2065 if(dotcount == 1) { 2186 2066 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('/')) { 2191 2071 last = i2; 2192 2072 break; … … 2197 2077 break; 2198 2078 } 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('/')) { 2204 2084 eaten = true; 2205 2085 last = i2; … … 2210 2090 eaten = true; 2211 2091 } 2212 if (eaten) {2092 if(eaten) { 2213 2093 levels--; 2214 2094 used -= iwrite - last; … … 2222 2102 last = -1; 2223 2103 ++i; 2224 } else if (dotcount == 1) {2104 } else if(dotcount == 1) { 2225 2105 eaten = true; 2226 2106 } 2227 if (eaten)2107 if(eaten) 2228 2108 i += dotcount; 2229 2109 } else { 2230 2110 levels++; 2231 2111 } 2232 } else if (last != -1 && iwrite - last == 1) {2112 } else if(last != -1 && iwrite - last == 1) { 2233 2113 #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) || defined(Q_OS_OS2) 2234 2114 eaten = (iwrite > 2); … … 2237 2117 #endif 2238 2118 last = -1; 2239 } else if (last != -1 && i == len-1) {2119 } else if(last != -1 && i == len-1) { 2240 2120 eaten = true; 2241 2121 } else { 2242 2122 levels++; 2243 2123 } 2244 if (!eaten)2124 if(!eaten) 2245 2125 last = i - (i - iwrite); 2246 2126 else 2247 2127 continue; 2248 } else if (!i && p[i] == QLatin1Char('.')) {2128 } else if(!i && p[i] == QLatin1Char('.')) { 2249 2129 int dotcount = 1; 2250 if (len >= 1 && p[1] == QLatin1Char('.'))2130 if(len >= 1 && p[1] == QLatin1Char('.')) 2251 2131 dotcount++; 2252 if (len >= dotcount && p[dotcount] == QLatin1Char('/')) {2253 if (dotcount == 1) {2132 if(len >= dotcount && p[dotcount] == QLatin1Char('/')) { 2133 if(dotcount == 1) { 2254 2134 i++; 2255 while (i+1 < len-1 && p[i+1] == QLatin1Char('/'))2135 while(i+1 < len-1 && p[i+1] == QLatin1Char('/')) 2256 2136 i++; 2257 2137 continue; … … 2262 2142 used++; 2263 2143 } 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)); 2270 2146 // 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 } 2274 2153 2275 2154 return ret; … … 2282 2161 \sa isRelative() isAbsolutePath() makeAbsolute() 2283 2162 */ 2284 2285 2163 bool QDir::isRelativePath(const QString &path) 2286 2164 { … … 2291 2169 Refreshes the directory information. 2292 2170 */ 2293 2294 2171 void QDir::refresh() const 2295 2172 { 2296 Q _D(const QDir);2297 2298 d-> data->clear();2173 Q); 2174 d->initFileEngine(); 2175 d->(); 2299 2176 } 2300 2177 … … 2306 2183 by a space or by a semicolon.) 2307 2184 */ 2308 2309 2185 QStringList QDir::nameFiltersFromString(const QString &nameFilter) 2310 2186 { … … 2373 2249 bool QDir::matchAllDirs() const 2374 2250 { 2375 Q_D(const QDir);2251 ); 2376 2252 return d->matchAllDirs; 2377 2253 } … … 2385 2261 void QDir::setMatchAllDirs(bool on) 2386 2262 { 2387 Q_D(QDir); 2263 QDirPrivate* d = d_ptr.data(); 2264 d->initFileEngine(); 2265 d->clearFileLists(); 2266 2388 2267 d->matchAllDirs = on; 2389 2268 } … … 2394 2273 QString QDir::nameFilter() const 2395 2274 { 2396 Q_D(const QDir); 2397 2275 const QDirPrivate* d = d_ptr.constData(); 2398 2276 return nameFilters().join(QString(d->filterSepChar)); 2399 2277 } … … 2421 2299 void QDir::setNameFilter(const QString &nameFilter) 2422 2300 { 2423 Q_D(QDir); 2301 QDirPrivate* d = d_ptr.data(); 2302 d->initFileEngine(); 2303 d->clearFileLists(); 2424 2304 2425 2305 d->filterSepChar = QDirPrivate::getFilterSepChar(nameFilter); 2426 setNameFilters(QDirPrivate::splitFilters(nameFilter, d->filterSepChar));2306 ); 2427 2307 } 2428 2308 … … 2498 2378 Use QDir::SortFlags instead. 2499 2379 */ 2500 #endif 2380 #endif // QT3_SUPPORT 2381 2501 2382 #ifndef QT_NO_DEBUG_STREAM 2502 2383 QDebug operator<<(QDebug debug, QDir::Filters filters) … … 2511 2392 if (filters & QDir::Drives) flags << QLatin1String("Drives"); 2512 2393 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"); 2514 2397 if ((filters & QDir::AllEntries) == QDir::AllEntries) flags << QLatin1String("AllEntries"); 2515 2398 if (filters & QDir::Readable) flags << QLatin1String("Readable"); … … 2561 2444 return debug.space(); 2562 2445 } 2563 2564 2565 2566 #endif 2446 #endif // QT_NO_DEBUG_STREAM 2567 2447 2568 2448 QT_END_NAMESPACE
Note:
See TracChangeset
for help on using the changeset viewer.
