Changeset 172 for trunk/src/corelib/io


Ignore:
Timestamp:
Sep 9, 2009, 1:54:31 AM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

corelib/io, gui/dialogs: Handle DOS-like filesystem details (drives, slashes) on OS/2 similarly to Win32.

Location:
trunk/src/corelib/io
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/corelib/io/qdir.cpp

    r2 r172  
    6262static QString driveSpec(const QString &path)
    6363{
    64 #ifdef Q_OS_WIN
     64#if
    6565    if (path.size() < 2)
    6666        return QString();
     
    147147        if ((path.endsWith(QLatin1Char('/')) || path.endsWith(QLatin1Char('\\')))
    148148                && path.length() > 1) {
    149 #ifdef Q_OS_WIN
     149#if
    150150            if (!(path.length() == 3 && path.at(1) == QLatin1Char(':')))
    151151#endif
     
    780780    }
    781781
    782 #ifdef Q_OS_WIN
     782#if
    783783    if (fileDrive.toLower() != dirDrive.toLower()
    784784        || (file.startsWith(QLatin1String("//"))
     
    799799    int i = 0;
    800800    while (i < dirElts.size() && i < fileElts.size() &&
    801 #ifdef Q_OS_WIN
     801#if
    802802           dirElts.at(i).toLower() == fileElts.at(i).toLower())
    803803#else
     
    20752075        if(p[i] == QLatin1Char('/')) {
    20762076            while(i < len-1 && p[i+1] == QLatin1Char('/')) {
    2077 #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) //allow unc paths
     2077#if ) //allow unc paths
    20782078                if(!i)
    20792079                    break;
     
    21352135                }
    21362136            } else if(last != -1 && iwrite - last == 1) {
    2137 #ifdef Q_OS_WIN
     2137#if
    21382138                eaten = (iwrite > 2);
    21392139#else
     
    22332233    \snippet doc/src/snippets/code/src_corelib_io_qdir.cpp 13
    22342234
    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
    22362236    (such as '-'), they have to be replaced by the underscore character ('_').
    22372237
  • trunk/src/corelib/io/qfile.cpp

    r2 r172  
    15241524    int writeBufferSize = writeBuffer.size();
    15251525    if ((openMode & QIODevice::Unbuffered) || writeBufferSize + 1 >= QFILE_WRITEBUFFER_SIZE
    1526 #ifdef Q_OS_WIN
     1526#if
    15271527        || ((openMode & QIODevice::Text) && c == '\n' && writeBufferSize + 2 >= QFILE_WRITEBUFFER_SIZE)
    15281528#endif
     
    15471547
    15481548    int len = 1;
    1549 #ifdef Q_OS_WIN
     1549#if
    15501550    if ((openMode & QIODevice::Text) && c == '\n') {
    15511551        ++len;
  • trunk/src/corelib/io/qfileinfo.cpp

    r2 r172  
    171171        break;
    172172    };
    173 #ifdef Q_OS_UNIX
     173#if
    174174    return QT_ACCESS(QFile::encodeName(data->fileName).data(), mode) == 0;
    175175#endif
  • trunk/src/corelib/io/qfsfileengine.cpp

    r2 r172  
    146146    known.insert(path);
    147147    do {
    148 #ifdef Q_OS_WIN
     148#if
    149149        // UNC, skip past the first two elements
    150150        if (separatorPos == 0 && tmpPath.startsWith(QLatin1String("//")))
  • trunk/src/corelib/io/qiodevice.cpp

    r2 r172  
    12131213        return qint64(-1);
    12141214
    1215 #ifdef Q_OS_WIN
     1215#if
    12161216    if (d->openMode & Text) {
    12171217        const char *endOfData = data + maxSize;
  • trunk/src/corelib/io/qtextstream.cpp

    r2 r172  
    652652        return true;
    653653
    654 #if defined (Q_OS_WIN)
     654#if defined)
    655655    // handle text translation and bypass the Text flag in the device.
    656656    bool textModeEnabled = device->isTextModeEnabled();
     
    685685        return false;
    686686
    687 #if defined (Q_OS_WIN)
     687#if defined)
    688688    // replace the text flag
    689689    if (textModeEnabled)
  • trunk/src/corelib/io/qurl.cpp

    r2 r172  
    59265926    if (fileInfo.isAbsolute()) {
    59275927        QString absPath = fileInfo.absolutePath();
    5928 #ifdef Q_OS_WIN
     5928#if
    59295929        if (absPath.size() > 1 && absPath.at(1) == QLatin1Char(':'))
    59305930            absPath = absPath.mid(2);
Note: See TracChangeset for help on using the changeset viewer.