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

QStorageInfo cannot be use for external storage on Android

    XMLWordPrintable

Details

    • Android

    Description

      The following lines:
      QString extstorage = qgetenv("EXTERNAL_STORAGE");
      QString tmpPath = QDir::tempPath();
      QStorageInfo info1(extstorage);
      QStorageInfo info2(tmpPath);
      qWarning()<<extstorage<<info1.isValid()<<info1.bytesAvailable()<<info1.bytesFree()<<info1.bytesTotal();
      qWarning()<<tmpPath<<info2.isValid()<<info2.bytesAvailable()<<info2.bytesFree()<<info2.bytesTotal();

      give:

      "/storage/emulated/legacy" false 0 0 0
      "/data/data/org.qtproject.qtvlm/files" true 5275557888 5275557888 9929424896
      my app has "WRITE_EXTERNAL_STORAGE" permission. I am trying to check that there is enough space available before writing some data (~300Mb). There is space available and if I ignore this control it works perfectly, so I think there is a problem with QStorageInfo in that case.

      Philippe Lelong

      Attachments

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

        Activity

          People

            whoistheguilty Tapio Oksa
            maitai Philippe Lelong
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes