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

QFileSelector returns empty path

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.2.1, 6.3.0 Feature Freeze
    • 5.15.1
    • Core: I/O
    • None
    • Linux 5.9.8 64bit
      KDE Plasma 5.20.2
      KDE Frameworks 5.75.0
      Qt 5.15.1
    • Linux/X11
    • 3
    • 7b1b1d990b5cb5cf7a10e689803f9ab6729d1e7f
    • Team 2 Foundation_Sprint 43

    Description

      QFileSelector::select(const QUrl &filepath) returns "" when QUrl("file:///") is passed into it (root directory)

      In QFileSelectorPrivate::select(const QString&)

      I see that QLatin1Char('/') is appended unconditionally, without checking whether fi.path() is already contains a slash at the end. Thus when "/" is passed, another "/" is appended, which leads to "//" string and QUrl::fromLocalFile(const QString&) chops it down, treating path as remote one, with an empty string left.

      Attachments

        1. patch
          0.8 kB
          Oleg Solovyov

        Issue Links

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

          Activity

            People

              heimrich Karsten Heimrich
              mcpain_alt Oleg Solovyov
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes