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

FileDialog (fileurls property) returns duplicates when multiple files are selected

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Fixed
    • Affects Version/s: 5.15.0
    • Fix Version/s: 5.15.1
    • Component/s: Core: I/O
    • Labels:
      None
    • Platform/s:
      Android
    • Commits:
      a581146ed8145912fb33efa1a58df3c668193b5f (qt/qtbase/5.15)

      Description

      Android version: Android 7.1.2

      A code sample:

      FileDialog {
          id: chatFilePickerDialog
          title: qsTr("Select a file")
          selectMultiple: true
          onAccepted: {
              for (var i = 0; i < fileUrls.length; i++) {
                  console.log(fileUrls[i])
              }
          }
      }
      

      When I select a single file, it returns:

      D libprotox_armeabi-v7a.so: qml: content://com.android.externalstorage.documents/document/2968-E4BD%3ADownload%2FALL YOUR BASE ARE BELONG TO US - Instrumental Version.opus
      

      When I select two or more files, it returns:

      D libprotox_armeabi-v7a.so: qml: content://com.android.externalstorage.documents/document/2968-E4BD%3ADownload%2FALL YOUR BASE ARE BELONG TO US - Instrumental Version.opus
      D libprotox_armeabi-v7a.so: qml: content://com.android.externalstorage.documents/document/2968-E4BD%3ADownload%2FCaramelldansen (Speedy Mixes).opus
      D libprotox_armeabi-v7a.so: qml: content://com.android.externalstorage.documents/document/2968-E4BD%3ADownload%2FALL YOUR BASE ARE BELONG TO US - Instrumental Version.opus
      D libprotox_armeabi-v7a.so: qml: content://com.android.externalstorage.documents/document/2968-E4BD%3ADownload%2FALL YOUR BASE ARE BELONG TO US - Instrumental Version.opus
      D libprotox_armeabi-v7a.so: qml: content://com.android.externalstorage.documents/document/2968-E4BD%3ADownload%2FCaramelldansen (Speedy Mixes).opus
      D libprotox_armeabi-v7a.so: qml: content://com.android.externalstorage.documents/document/2968-E4BD%3ADownload%2FALL YOUR BASE ARE BELONG TO US - Instrumental Version.opus
      
      1. onAccepted is executed two or more times but should be executed once. fileUrl is always empty if selectMultiple is true (this is okay).
      2. fileUrls is not cleared upon open()

      Epic workaround: https://pastebin.com/nszyC47D

        Attachments

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

          Activity

            People

            Assignee:
            assam Assam Boudjelthia
            Reporter:
            monsterovich monsterovich
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes