Changeset 848


Ignore:
Timestamp:
May 6, 2011, 5:38:32 PM (10 years ago)
Author:
Dmitry A. Kuminov
Message:

corelib/io: Fixed private member access.

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

Legend:

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

    r846 r848  
    709709
    710710    QString fn = QDir::fromNativeSeparators(fileName);
    711     if (!d->data->fileEngine)
     711    if (!d->fileEngine)
    712712        return fn;
    713713
     
    730730    }
    731731
    732     QString ret = d->data->fileEngine->fileName(QAbstractFileEngine::AbsoluteName);
     732    QString ret = d->fileEngine->fileName(QAbstractFileEngine::AbsoluteName);
    733733
    734734    if (!fn.isEmpty()) {
  • trunk/src/corelib/io/qfsfileengine_iterator_os2.cpp

    r794 r848  
    100100    static QDateTime convertFileDateTime(FDATE fdate, FTIME ftime);
    101101    void updateFileInfo(const QString &path, FILEFINDBUF3L *ffb);
    102     void resetFileInfo() { d_ptr->reset(); }
     102    void resetFileInfo() { d_ptr->clear(); }
    103103
    104104    bool done;
     
    288288        fileName.append(QLatin1Char('/'));
    289289    fileName.append(QFile::decodeName(QByteArray(ffb->achName)));
    290     d_ptr->initFileEngine(fileName);
    291 
    292     d_ptr->data->fileFlags = QAbstractFileEngine::ExistsFlag    |
    293                              QAbstractFileEngine::LocalDiskFlag |
    294                              QAbstractFileEngine::ReadOwnerPerm |
    295                              QAbstractFileEngine::ReadUserPerm  |
    296                              QAbstractFileEngine::ReadGroupPerm |
    297                              QAbstractFileEngine::ReadOtherPerm;
     290    d_ptr = new QFileInfoPrivate(fileName);
     291
     292    d_ptr->fileFlags = QAbstractFileEngine::ExistsFlag    |
     293                       QAbstractFileEngine::LocalDiskFlag |
     294                       QAbstractFileEngine::ReadOwnerPerm |
     295                       QAbstractFileEngine::ReadUserPerm  |
     296                       QAbstractFileEngine::ReadGroupPerm |
     297                       QAbstractFileEngine::ReadOtherPerm;
    298298
    299299    if ((ffb->attrFile & FILE_READONLY) == 0) {
    300         d_ptr->data->fileFlags |= QAbstractFileEngine::WriteOwnerPerm |
    301                                   QAbstractFileEngine::WriteUserPerm  |
    302                                   QAbstractFileEngine::WriteGroupPerm |
    303                                   QAbstractFileEngine::WriteOtherPerm;
     300        d_ptr->fileFlags |= QAbstractFileEngine::WriteOwnerPerm |
     301                            QAbstractFileEngine::WriteUserPerm  |
     302                            QAbstractFileEngine::WriteGroupPerm |
     303                            QAbstractFileEngine::WriteOtherPerm;
    304304    }
    305305
    306306    if (ffb->attrFile & FILE_DIRECTORY)
    307         d_ptr->data->fileFlags |= QAbstractFileEngine::DirectoryType;
     307        d_ptr->fileFlags |= QAbstractFileEngine::DirectoryType;
    308308    else
    309         d_ptr->data->fileFlags |= QAbstractFileEngine::FileType;
     309        d_ptr->fileFlags |= QAbstractFileEngine::FileType;
    310310
    311311    if (ffb->attrFile & FILE_HIDDEN)
    312         d_ptr->data->fileFlags |= QAbstractFileEngine::HiddenFlag;
    313 
    314     d_ptr->data->fileTimes[QAbstractFileEngine::CreationTime] =
     312        d_ptr->fileFlags |= QAbstractFileEngine::HiddenFlag;
     313
     314    d_ptr->fileTimes[QAbstractFileEngine::CreationTime] =
    315315            convertFileDateTime(ffb->fdateCreation, ffb->ftimeCreation);
    316316
    317     d_ptr->data->fileTimes[QAbstractFileEngine::ModificationTime] =
     317    d_ptr->fileTimes[QAbstractFileEngine::ModificationTime] =
    318318            convertFileDateTime(ffb->fdateLastWrite, ffb->ftimeLastWrite);
    319319
    320     d_ptr->data->fileTimes[QAbstractFileEngine::AccessTime] =
     320    d_ptr->fileTimes[QAbstractFileEngine::AccessTime] =
    321321            convertFileDateTime(ffb->fdateLastAccess, ffb->ftimeLastAccess);
    322322
    323     d_ptr->data->fileSize = ffb->cbFile;
     323    d_ptr->fileSize = ffb->cbFile;
    324324
    325325    // mark fields as "cached" and "present"
    326     d_ptr->data->cachedFlags  = QFileInfoPrivate::CachedSize |
    327                                 QFileInfoPrivate::CachedFileFlags |
    328                                 QFileInfoPrivate::CachedLinkTypeFlag |
    329                                 QFileInfoPrivate::CachedBundleTypeFlag |
    330                                 QFileInfoPrivate::CachedMTime |
    331                                 QFileInfoPrivate::CachedCTime |
    332                                 QFileInfoPrivate::CachedATime;
    333     d_ptr->data->cache_enabled = 1;
     326    d_ptr->cachedFlags  = QFileInfoPrivate::CachedSize |
     327                          QFileInfoPrivate::CachedFileFlags |
     328                          QFileInfoPrivate::CachedLinkTypeFlag |
     329                          QFileInfoPrivate::CachedBundleTypeFlag |
     330                          QFileInfoPrivate::CachedMTime |
     331                          QFileInfoPrivate::CachedCTime |
     332                          QFileInfoPrivate::CachedATime;
     333    d_ptr->cache_enabled = 1;
    334334}
    335335
Note: See TracChangeset for help on using the changeset viewer.