Changeset 173


Ignore:
Timestamp:
Sep 9, 2009, 2:38:34 AM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

gui/dialogs: Fixed: Duplicate file names were added to the file list in QFileDialog when an existing directory was typed directly in the filename entry field with a different case of letters than in the original (on platforms with case insensitive file systems), #65.

Location:
trunk/src/gui/dialogs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/dialogs/qfilesystemmodel.cpp

    r172 r173  
    353353        absolutePath = QDir(longPath).absolutePath();
    354354
    355     // ### TODO can we use bool QAbstractFileEngine::caseSensitive() const?
    356355    QStringList pathElements = absolutePath.split(QLatin1Char('/'), QString::SkipEmptyParts);
    357356    if ((pathElements.isEmpty())
     
    10891088
    10901089    QList<QPair<QFileSystemModelPrivate::QFileSystemNode*, int> > values;
    1091     QHash<QString, QFileSystemNode *>::const_iterator iterator;
     1090    QHash<, QFileSystemNode *>::const_iterator iterator;
    10921091    int i = 0;
    10931092    for(iterator = indexNode->children.begin() ; iterator != indexNode->children.end() ; ++iterator) {
     
    15881587    QStringList newFiles = files;
    15891588    qSort(newFiles.begin(), newFiles.end());
    1590     QHash<QString, QFileSystemNode*>::const_iterator i = parentNode->children.constBegin();
     1589    QHash<, QFileSystemNode*>::const_iterator i = parentNode->children.constBegin();
    15911590    while (i != parentNode->children.constEnd()) {
    15921591        QStringList::iterator iterator;
  • trunk/src/gui/dialogs/qfilesystemmodel_p.h

    r2 r173  
    8181
    8282public:
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
     100
     101
     102
     103
     104
     105
    83106    class QFileSystemNode
    84107    {
     
    87110            : fileName(filename), populatedChildren(false), isVisible(false), parent(p), info(0) {}
    88111        ~QFileSystemNode() {
    89             QHash<QString, QFileSystemNode*>::const_iterator i = children.constBegin();
     112            QHash<, QFileSystemNode*>::const_iterator i = children.constBegin();
    90113            while (i != children.constEnd()) {
    91114                    delete i.value();
     
    162185            if (info)
    163186                info->icon = iconProvider->icon(QFileInfo(path));
    164             QHash<QString, QFileSystemNode *>::const_iterator iterator;
     187            QHash<, QFileSystemNode *>::const_iterator iterator;
    165188            for(iterator = children.constBegin() ; iterator != children.constEnd() ; ++iterator) {
    166189                iterator.value()->updateIcon(iconProvider, path + QLatin1Char('/') + iterator.value()->fileName);
     
    171194            if (info)
    172195                info->displayType = iconProvider->type(QFileInfo(path));
    173             QHash<QString, QFileSystemNode *>::const_iterator iterator;
     196            QHash<, QFileSystemNode *>::const_iterator iterator;
    174197            for(iterator = children.constBegin() ; iterator != children.constEnd() ; ++iterator) {
    175198                 iterator.value()->retranslateStrings(iconProvider, path + QLatin1Char('/') + iterator.value()->fileName);
     
    179202        bool populatedChildren;
    180203        bool isVisible;
    181         QHash<QString,QFileSystemNode *> children;
     204        QHash<QFileSystemNode *> children;
    182205        QList<QString> visibleChildren;
    183206        QFileSystemNode *parent;
Note: See TracChangeset for help on using the changeset viewer.