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

QDir::tempPath returns wrong path on Android

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.5.0, 6.6.0
    • 5.6.2, 5.15.7
    • Core: I/O
    • None
    • Android
    • Android
    • b8d51001f (dev), c1c201025 (6.5)
    • 2023wk08FOQtforAndroid

    Description

      QDir::tempPath returns the /files directory on Android which should be used for persistent, not for cache (i.e. temp) files.

      Note that QStandardPaths::writableLocation returns the correct path.

      Also QTemporaryFile is affected by this bug as it uses QDir::tempPath() by default. In case an app is killed by the user when a QTemporaryFile is open, this file will never be cleaned up. If the file is correctly created in the /cache directory, a user might easily remove all those leftovers by clearing all cache (f.ex. when running out of space).

      This issue is also discussed on this StackOverflow thread: https://stackoverflow.com/questions/49563420/qdirtemppath-vs-qstandardpathswritablelocation

      Attachments

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

        Activity

          People

            assam Assam Boudjelthia
            m3197d - -
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes