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

QStorageInfo valid information not reset after path is cleared on Linux

    XMLWordPrintable

Details

    • Linux/X11
    • e55d7fa1e (dev), 20bf08f01 (6.8)

    Description

      When a drive is removed on Linux the QStorageInfo should update the ‘valid’ information to 'false' for empty path. Currently this is not done and it’s not possible to detect if the drive has been removed or not.

      qstorageinfo_unix.cpp:

       

      void QStorageInfoPrivate::initRootPath()
      ...
      if (rootPath.isEmpty())
              return;
      ...
      

       

      On Windows the value is reset correctly:

      qstorageinfo_win.cpp:

       

      void QStorageInfoPrivate::initRootPath()
      ...
      if (path.isEmpty()) {
              valid = ready = false;
              return;
          }
      ...
      

       

       

      The attached example can be used to reproduce the issue. The correct path needs to be set for the media in main.cpp.

      Attachments

        For Gerrit Dashboard: QTBUG-129689
        # Subject Branch Project Status CR V

        Activity

          People

            thiago Thiago Macieira
            tiheikka Titta Heikkala
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There is 1 open Gerrit change