Changeset 1117


Ignore:
Timestamp:
Mar 5, 2013, 11:30:56 PM (12 years ago)
Author:
Dmitry A. Kuminov
Message:

corelib: Make QFileInfo returned by QDirIterator report symlinks properly.

In QT_OS2_USE_DOSFINDFIRST mode (which is ON now), we use
DosFindFirst which is unaware of symlinks and doesn't properly resolve that.
Given that in many other places kLIBC functions are used which handle symlinks
pretty well, this would completely confuse some apps like QFileDialog (see #284).

This fix removes this inconsistency.

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

Legend:

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

    r1116 r1117  
    5252#include <QtCore/qvariant.h>
    5353
     54
    5455#ifndef QT_OS2_USE_DOSFINDFIRST
    5556#include <dirent.h>
    56 #include <unistd.h>
    5757#else
    5858#include <QtCore/qdatetime.h>
     
    360360    }
    361361
     362
     363
     364
     365
     366
     367
     368
     369
     370
     371
     372
     373
     374
     375
     376
     377
     378
     379
     380
     381
     382
     383
     384
     385
     386
     387
     388
     389
     390
     391
     392
     393
     394
    362395    if (ffb->attrFile & FILE_DIRECTORY)
    363396        d_ptr->fileFlags |= QAbstractFileEngine::DirectoryType;
  • trunk/src/corelib/io/qfsfileengine_os2.cpp

    r1112 r1117  
    4242****************************************************************************/
    4343
    44 // temporary, until struct dirent in kLIBC gets creation and access time fields
    45 #define QT_OS2_USE_DOSFINDFIRST
    46 
    4744#include "qplatformdefs.h"
    4845#include "qabstractfileengine.h"
     
    677674            is_link = false;        // drive/share names are never symlinks
    678675        } else {
    679 #ifdef QT_OS2_USE_DOSFINDFIRST
    680             is_link = false;
    681 #else
    682676            QT_STATBUF st;          // don't clobber our main one
    683677            that->is_link = (QT_LSTAT(nativeFilePath.constData(), &st) == 0) ?
    684678                            S_ISLNK(st.st_mode) : false;
    685 #endif
    686679        }
    687680    }
Note: See TracChangeset for help on using the changeset viewer.