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

FolderListModel and QML FileDialog cannot browse a folder with the % symbol in the name

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.15.4
    • None
    • Linux/Wayland, Linux/Yocto, Linux/Other display system

    Description

      FolderListModel cannot browse content of a folder with the % symbol in the folder name. Even standard FileDialog cannot show the folder content.

      For example both of these classes do no show content of the /run/user/1302/media/ext3-4GB/STORE%5Cx20N%5Cx20GO/ folder in following example:

      root@amneo:~# ls -Alh /run/user/1302/media/ext3-4GB/
      total 36K
      drwxr-xr-x 2 root root 4.0K 2021-08-25 13:52 %5Cx20N%5Cx20GO
      drwx------ 2 root root  16K 2021-03-25 13:08 lost+found
      drwxr-xr-x 2 root root 4.0K 2021-08-25 16:04 öäüÖäüÄÜWß
      drwxr-xr-x 5 root root 4.0K 2021-08-25 12:37 STORE%5Cx20N%5Cx20GO
      -rw-r--r-- 1 root root    0 2021-04-08 11:32 以表示所有万国码
      drwxr-xr-x 2 root root 4.0K 2021-08-25 16:05 以表示所有万国码码
      drwxr-xr-x 3 root root 4.0K 2021-08-25 16:54 有万国äüÄÜßaàáãạДяприь
      -rw-r--r-- 1 root root    0 2021-08-25 16:53 有万国äüÄÜßaàáãạДяприь.txt
      root@amneo:~# ls -Alh /run/user/1302/media/ext3-4GB/%5Cx20N\%5Cx20GO/
      total 0
      root@amneo:~# ls -Alh /run/user/1302/media/ext3-4GB/STORE\%5Cx20N\%5Cx20GO/
      total 12K
      drwxr-xr-x 2 root root 4.0K 2021-08-25 13:52 %5Cx20N%5Cx20GO
      drwxr-xr-x 2 root root 4.0K 2021-08-25 16:04 öäüÖäüÄÜWß
      -rw-r--r-- 1 root root    0 2021-04-08 11:32 以表示所有万国码 - Copy
      drwxr-xr-x 2 root root 4.0K 2021-08-25 16:05 以表示所有万国码码
      root@amneo:~# 
      

       
      So, the following Qt example does not show the folder content:

      import QtQuick 2.12
      import QtQuick.Controls 2.12
      import QtQuick.Layouts 1.12
      import QtQuick.Dialogs 1.2
      
      Rectangle {
          id: root
      
          anchors.fill: parent
      
          FileDialog {
              id: fileDialog
              title: "Please choose a file"
              folder: "file:///run/user/1302/media/ext3-4GB"
              onAccepted: {
                  console.log("You chose: " + fileDialog.fileUrls)
              }
              onRejected: {
                  console.log("Canceled")
              }
              Component.onCompleted: visible = true
          }
      }

      Neither does FolderListModel.

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              gse Sergei Golubtsov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes