Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-122117

FolderListModel has a conditional endModelReset

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.6
    • Quick: Other
    • None

    Description

      The "setFolder" method of FolderListModel in Qt.labs.folderlistmodel has a conditional endResetModel:

      void QQuickFolderListModel::setFolder(const QUrl &folder)
      {
          Q_D(QQuickFolderListModel);    
          if (folder == d->currentDir)
              return;    
          
          QString resolvedPath = QQuickFolderListModelPrivate::resolvePath(folder);
      
          qCDebug(lcFolderListModel) << "about to emit beginResetModel since our folder was set to" << folder;
          beginResetModel();    //Remove the old path for the file system watcher
      
          if (!d->currentDir.isEmpty())
              d->fileInfoThread.removePath(d->currentDir.path());
      
          d->currentDir = folder;
          QFileInfo info(resolvedPath);
      
          if (!info.exists() || !info.isDir()) {
              d->data.clear();
              endResetModel();
              emit rowCountChanged();
              if (d->status != QQuickFolderListModel::Null) {
                  d->status = QQuickFolderListModel::Null;
                  emit statusChanged();
              }
              return;
          }
      
          d->fileInfoThread.setPath(resolvedPath);
      } 

      Not sure if this is intentional or not, but looked weird.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            r.vitanov Rosen Vitanov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes