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

QFileSystemModel should let the QFileInfoGatherer thread do the file info gathering

    XMLWordPrintable

    Details

    • Platform/s:
      Windows

      Description

      Hello,

      QFileInfoGatherer::updates SIGNAL is connected to QFileSystemModel::QFileSystemModelPrivate::_q_fileSystemChanged SLOT.

       

      File: qfilesystemmodel.cpp

       

      q->connect(&fileInfoGatherer, SIGNAL(updates(QString,QVector<QPair<QString,QFileInfo> >)),
      q, SLOT(_q_fileSystemChanged(QString,QVector<QPair<QString,QFileInfo> >)));
      

       

      This causes IO expensive operations (i.e. checking file permission) to be executed on UI thread. In the case of network drives this causes huge UI hangs and freezes. Stack trace below shows the problem.

      Stack trace:

      [External Code]
         Qt5Cored.dll!QFileSystemEngine::fillPermissions(const QFileSystemEntry & entry, QFileSystemMetaData & data, QFlags<enumQFileSystemMetaData::MetaDataFlag> what) Line 861   C++
          Qt5Cored.dll!QFileSystemEngine::fillMetaData(const QFileSystemEntry & entry, QFileSystemMetaData & data, QFlags<enumQFileSystemMetaData::MetaDataFlag> what) Line 1048 C++
          Qt5Cored.dll!QFileInfo::permissions() Line 1265 C++
          Qt5Widgetsd.dll!QExtendedInformation::permissions() Line 87 C++
          Qt5Widgetsd.dll!QExtendedInformation::operator==(const QExtendedInformation & fileInfo) Line 75 C++
          Qt5Widgetsd.dll!QFileSystemModelPrivate::QFileSystemNode::operator==(const QExtendedInformation & fileInfo) Line 142    C++
          Qt5Widgetsd.dll!QFileSystemModelPrivate::QFileSystemNode::operator!=(const QExtendedInformation & fileInfo) Line 134    C++
          Qt5Widgetsd.dll!QFileSystemModelPrivate::_q_fileSystemChanged(const QString & path, const QVector<QPair<QString,QFileInfo> > & updates)Line 1805   C++
          Qt5Widgetsd.dll!QFileSystemModel::qt_static_metacall(QObject * _o, QMetaObject::Call _c, int _id, void * * _a) Line 121 C++
          Qt5Cored.dll!QMetaCallEvent::placeMetaCall(QObject * object) Line 495   C++
          Qt5Cored.dll!QObject::event(QEvent * e) Line 1257   C++
          Qt5Widgetsd.dll!QFileSystemModel::event(QEvent * event) Line 1617   C++
          Qt5Widgetsd.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3804    C++
          Qt5Widgetsd.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3163  C++
          Qt5Cored.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 1015    C++
          Qt5Cored.dll!QCoreApplication::sendEvent(QObject * receiver, QEvent * event) Line 225   C++
          Qt5Cored.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) Line 1650    C++
          Qt5Cored.dll!QEventDispatcherWin32::sendPostedEvents() Line 1287    C++
          qwindowsd.dll!QWindowsGuiEventDispatcher::sendPostedEvents() Line 76    C++
          Qt5Cored.dll!qt_internal_proc(HWND__ * hwnd, unsigned int message, unsigned int wp, long lp) Line 438   C++
          [External Code]
          Qt5Cored.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 838    C++
          qwindowsd.dll!QWindowsGuiEventDispatcher::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 68   C++
          Qt5Cored.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 129   C++
          Qt5Cored.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 206    C++
          Qt5Cored.dll!QCoreApplication::exec() Line 1285 C++
          Qt5Guid.dll!QGuiApplication::exec() Line 1608   C++
          Qt5Widgetsd.dll!QApplication::exec() Line 2980  C++
          [External Code]
          Documentsd.exe!main(int argc, char * * argv) Line 25    C++
          Documentsd.exe!WinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, char * __formal, int __formal) Line 113  C++
          [External Code]
      

       

      Best regards,
      Arkadiusz Szulakiewicz

        Attachments

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

          Activity

            People

            Assignee:
            thiago Thiago Macieira
            Reporter:
            szulak Arkadiusz Szulakiewicz
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes