- Timestamp:
- Sep 9, 2009, 1:54:31 AM (16 years ago)
- Location:
- trunk/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/corelib/io/qdir.cpp
r2 r172 62 62 static QString driveSpec(const QString &path) 63 63 { 64 #if def Q_OS_WIN64 #if 65 65 if (path.size() < 2) 66 66 return QString(); … … 147 147 if ((path.endsWith(QLatin1Char('/')) || path.endsWith(QLatin1Char('\\'))) 148 148 && path.length() > 1) { 149 #if def Q_OS_WIN149 #if 150 150 if (!(path.length() == 3 && path.at(1) == QLatin1Char(':'))) 151 151 #endif … … 780 780 } 781 781 782 #if def Q_OS_WIN782 #if 783 783 if (fileDrive.toLower() != dirDrive.toLower() 784 784 || (file.startsWith(QLatin1String("//")) … … 799 799 int i = 0; 800 800 while (i < dirElts.size() && i < fileElts.size() && 801 #if def Q_OS_WIN801 #if 802 802 dirElts.at(i).toLower() == fileElts.at(i).toLower()) 803 803 #else … … 2075 2075 if(p[i] == QLatin1Char('/')) { 2076 2076 while(i < len-1 && p[i+1] == QLatin1Char('/')) { 2077 #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) //allow unc paths2077 #if ) //allow unc paths 2078 2078 if(!i) 2079 2079 break; … … 2135 2135 } 2136 2136 } else if(last != -1 && iwrite - last == 1) { 2137 #if def Q_OS_WIN2137 #if 2138 2138 eaten = (iwrite > 2); 2139 2139 #else … … 2233 2233 \snippet doc/src/snippets/code/src_corelib_io_qdir.cpp 13 2234 2234 2235 If the file name contains characters that cannot be part of a valid C++ function name 2235 If the file name contains characters that cannot be part of a valid C++ function name 2236 2236 (such as '-'), they have to be replaced by the underscore character ('_'). 2237 2237 -
trunk/src/corelib/io/qfile.cpp
r2 r172 1524 1524 int writeBufferSize = writeBuffer.size(); 1525 1525 if ((openMode & QIODevice::Unbuffered) || writeBufferSize + 1 >= QFILE_WRITEBUFFER_SIZE 1526 #if def Q_OS_WIN1526 #if 1527 1527 || ((openMode & QIODevice::Text) && c == '\n' && writeBufferSize + 2 >= QFILE_WRITEBUFFER_SIZE) 1528 1528 #endif … … 1547 1547 1548 1548 int len = 1; 1549 #if def Q_OS_WIN1549 #if 1550 1550 if ((openMode & QIODevice::Text) && c == '\n') { 1551 1551 ++len; -
trunk/src/corelib/io/qfileinfo.cpp
r2 r172 171 171 break; 172 172 }; 173 #if def Q_OS_UNIX173 #if 174 174 return QT_ACCESS(QFile::encodeName(data->fileName).data(), mode) == 0; 175 175 #endif -
trunk/src/corelib/io/qfsfileengine.cpp
r2 r172 146 146 known.insert(path); 147 147 do { 148 #if def Q_OS_WIN148 #if 149 149 // UNC, skip past the first two elements 150 150 if (separatorPos == 0 && tmpPath.startsWith(QLatin1String("//"))) -
trunk/src/corelib/io/qiodevice.cpp
r2 r172 1213 1213 return qint64(-1); 1214 1214 1215 #if def Q_OS_WIN1215 #if 1216 1216 if (d->openMode & Text) { 1217 1217 const char *endOfData = data + maxSize; -
trunk/src/corelib/io/qtextstream.cpp
r2 r172 652 652 return true; 653 653 654 #if defined (Q_OS_WIN)654 #if defined) 655 655 // handle text translation and bypass the Text flag in the device. 656 656 bool textModeEnabled = device->isTextModeEnabled(); … … 685 685 return false; 686 686 687 #if defined (Q_OS_WIN)687 #if defined) 688 688 // replace the text flag 689 689 if (textModeEnabled) -
trunk/src/corelib/io/qurl.cpp
r2 r172 5926 5926 if (fileInfo.isAbsolute()) { 5927 5927 QString absPath = fileInfo.absolutePath(); 5928 #if def Q_OS_WIN5928 #if 5929 5929 if (absPath.size() > 1 && absPath.at(1) == QLatin1Char(':')) 5930 5930 absPath = absPath.mid(2); -
trunk/src/gui/dialogs/qfiledialog.cpp
r2 r172 782 782 text.remove(current); 783 783 if (text.at(0) == QDir::separator() 784 #if def Q_OS_WIN785 //On Windows both cases can happen784 #if 785 //On Windows both cases can happen 786 786 || text.at(0) == QLatin1Char('/') 787 787 #endif … … 3171 3171 QString pathCopy = QDir::toNativeSeparators(path); 3172 3172 QString sep = QDir::separator(); 3173 #if def Q_OS_WIN3173 #if 3174 3174 if (pathCopy == QLatin1String("\\") || pathCopy == QLatin1String("\\\\")) 3175 3175 return QStringList(pathCopy); … … 3183 3183 QRegExp re(QLatin1String("[") + QRegExp::escape(sep) + QLatin1String("]")); 3184 3184 3185 #if def Q_OS_WIN3185 #if 3186 3186 QStringList parts = pathCopy.split(re, QString::SkipEmptyParts); 3187 3187 if (!doubleSlash.isEmpty() && !parts.isEmpty()) … … 3195 3195 #endif 3196 3196 3197 #if def Q_OS_WIN3197 #if 3198 3198 bool startsFromRoot = !parts.isEmpty() && parts[0].endsWith(QLatin1Char(':')); 3199 3199 #else -
trunk/src/gui/dialogs/qfiledialog_p.h
r2 r172 100 100 QFSCompletor(QAbstractItemModel *model, QObject *parent = 0) : QCompleter(model, parent), proxyModel(0), sourceModel(0) 101 101 { 102 #if def Q_OS_WIN102 #if 103 103 setCaseSensitivity(Qt::CaseInsensitive); 104 104 #endif … … 196 196 return MAX_PATH; 197 197 #endif //Q_OS_WINCE 198 199 200 198 201 #else 199 202 Q_UNUSED(path); … … 296 299 bool fileNameLabelExplicitlySat; 297 300 QStringList nameFilters; 298 301 299 302 // Members for using native dialogs: 300 303 bool nativeDialogInUse; -
trunk/src/gui/dialogs/qfileinfogatherer.cpp
r2 r172 285 285 { 286 286 QString driveName = drive.absoluteFilePath(); 287 #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)287 #if ) 288 288 if (driveName.startsWith(QLatin1Char('/'))) // UNC host 289 289 return drive.fileName(); -
trunk/src/gui/dialogs/qfilesystemmodel.cpp
r2 r172 356 356 QStringList pathElements = absolutePath.split(QLatin1Char('/'), QString::SkipEmptyParts); 357 357 if ((pathElements.isEmpty()) 358 #if !defined(Q_OS_ WIN) || defined(Q_OS_WINCE)358 #if !defined(Q_OS_) 359 359 && QDir::fromNativeSeparators(longPath) != QLatin1String("/") 360 360 #endif … … 362 362 return const_cast<QFileSystemModelPrivate::QFileSystemNode*>(&root); 363 363 QModelIndex index = QModelIndex(); // start with "My Computer" 364 #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)364 #if ) 365 365 if (absolutePath.startsWith(QLatin1String("//"))) { // UNC path 366 366 QString host = QLatin1String("\\\\") + pathElements.first(); … … 401 401 for (int i = 0; i < pathElements.count(); ++i) { 402 402 QString element = pathElements.at(i); 403 #if def Q_OS_WIN404 // On Windows , "filename......." and "filename" are equivalent Task #133928403 #if 404 // On Windows, "filename......." and "filename" are equivalent Task #133928 405 405 while (element.endsWith(QLatin1Char('.'))) 406 406 element.chop(1); … … 1266 1266 } 1267 1267 QString fullPath = QDir::fromNativeSeparators(path.join(QDir::separator())); 1268 #if !defined(Q_OS_ WIN) || defined(Q_OS_WINCE)1268 #if !defined(Q_OS_) 1269 1269 if ((fullPath.length() > 2) && fullPath[0] == QLatin1Char('/') && fullPath[1] == QLatin1Char('/')) 1270 1270 fullPath = fullPath.mid(1); -
trunk/src/gui/util/qcompleter.cpp
r2 r172 135 135 To provide completions, QCompleter needs to know the path from an index. 136 136 This is provided by pathFromIndex(). The default implementation of 137 pathFromIndex(), returns the data for the \l{Qt::EditRole}{edit role} 137 pathFromIndex(), returns the data for the \l{Qt::EditRole}{edit role} 138 138 for list models and the absolute file path if the mode is a QDirModel. 139 139 … … 483 483 QString str = source->index(i, c->column).data().toString(); 484 484 if (str.startsWith(c->prefix, c->cs) 485 #if !defined(Q_OS_ WIN) || defined(Q_OS_WINCE)485 #if !defined(Q_OS_) 486 486 && (!dirModel || QDir::toNativeSeparators(str) != QDir::separator()) 487 487 #endif … … 988 988 #ifndef QT_NO_DIRMODEL 989 989 if (qobject_cast<QDirModel *>(model)) { 990 #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)990 #if ) 991 991 setCaseSensitivity(Qt::CaseInsensitive); 992 992 #else … … 1621 1621 } while (idx.isValid()); 1622 1622 1623 #if !defined(Q_OS_ WIN) || defined(Q_OS_WINCE)1623 #if !defined(Q_OS_) 1624 1624 if (list.count() == 1) // only the separator or some other text 1625 1625 return list[0]; … … 1655 1655 QString pathCopy = QDir::toNativeSeparators(path); 1656 1656 QString sep = QDir::separator(); 1657 #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)1657 #if ) 1658 1658 if (pathCopy == QLatin1String("\\") || pathCopy == QLatin1String("\\\\")) 1659 1659 return QStringList(pathCopy); … … 1668 1668 QStringList parts = pathCopy.split(re); 1669 1669 1670 #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)1670 #if ) 1671 1671 if (!doubleSlash.isEmpty()) 1672 1672 parts[0].prepend(doubleSlash);
Note:
See TracChangeset
for help on using the changeset viewer.