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

QDesktopServices::openUrl changes the URL

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.9.1
    • Fix Version/s: None
    • Component/s: GUI: Workspace
    • Labels:
      None
    • Environment:
      Archlinux

      Description

      Sometimes opening files does not work with QDesktopServices.

      In my code I do this
       

      qDebug() << QUrl::fromLocalFile(file_->filePath()).toString();
      QDesktopServices::openUrl(QUrl::fromLocalFile(file_->filePath()));
      

      It it prints

      [16:30:39] [DEBG] "file:///home/manuel/Dropbox/TODO.md"
      

      strace says

      [pid 19725] execve("/usr/bin/xdg-open", ["/usr/bin/xdg-open", "file:Dropbox/TODO.md"], 0x557e8afe1330 /* 50 vars */ <unfinished ...>
      

      Well and when I excute this myself in the shell:

      manuel@argon ~ $ /usr/bin/xdg-open file:Dropbox/TODO.md
      gio: file:Dropbox/TODO.md: Vorgang wird nicht unterstützt
      

      I know gio should be capable of handling relative urls, but also Qt should not change the URL if I pass it an absolute path.

      The funny thing is that when I start open this file with my program running in QtCreator it mysteriously works.

        Attachments

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

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            manuelschneid3r Manuel Schneider
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes