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

QFileSelector returns empty path

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: In Progress
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.15.1
    • Fix Version/s: None
    • Component/s: Core: I/O
    • Labels:
      None
    • Environment:
      Linux 5.9.8 64bit
      KDE Plasma 5.20.2
      KDE Frameworks 5.75.0
      Qt 5.15.1
    • Platform/s:
      Linux/X11
    • Story Points:
      3
    • Sprint:
      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

          Issue Links

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

            Activity

              People

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

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes