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

Invalid QStorageInfo for internal storage on Android

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4: Low
    • 5.11
    • 5.4.2
    • Core: I/O
    • None
    • Android 4.4
    • Android
    • 23870b3cad0463c9a98005a3c661188d0f7b7b2c

    Description

      If mounted only internal storage on device, QStorageInfo for this storage is invalid and rootPath is empty.
      Example internal storage mounted to /storage/sdcard0:

             QStorageInfo storage = QStorageInfo("/storage/sdcard0");
             qDebug() << "rootPath:" << storage.rootPath();
             qDebug() << "name:" << storage.name();
             qDebug() << "fileSystemType:" << storage.fileSystemType();
             qDebug() << "size:" << storage.bytesTotal()/1000/1000 << "MB";
             qDebug() << "availableSize:" << storage.bytesAvailable()/1000/1000 << "MB";
      

      Output:
      rootPath: ""
      name: ""
      fileSystemType: ""
      size: 0 MB
      availableSize: 0 MB

      If we insert external sdcard it works correctly:
      Output:
      rootPath: "/storage/sdcard0"
      name: ""
      fileSystemType: "fuse"
      size: 2205 MB
      availableSize: 1538 MB

      Attachments

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

        Activity

          People

            srutledg Shawn Rutledge
            eledemidova Elena
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes