Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.4.3
-
-
03cbcba7b (dev), 43cd15131 (6.5)
Description
This bug seems related to QTBUG-83939 , but concerns flatpak, (QTBUG-83939 concerns snaps).
When I try to open a html file that resides within the flatpak with QDesktopServices::openUrl(), it fails silently. As a workaround I call /usr/bin/xdg-open <url>, which works.
I confirmed that xdgDesktopPortalOpenFile(const QUrl &url) gets called with a expected but fails to open the file. It seems no error is generated.
My code, including the workaround, looks like this (the complete cpp file of the project can be found here: https://github.com/ChrisHal/PMbrowser/blob/db2bc698cae45e25b19b6795cef4b73fe0e40c84/QtPMbrowser/pmbrowserwindow.cpp#L1080):
void PMbrowserWindow::openHelp()
{
#ifdef _linux_
if (help_url.isLocalFile() && QFile::exists("/.flatpak-info"))
#endif
if (!QDesktopServices::openUrl(help_url) && help_url.isLocalFile()) {
// we should only get here when trying to
// open a local file from within a flatpak sandbox
auto res = QMessageBox::question(this, "Error",
"Could not open local help url.\nDo you want to try the online help instead?");
if (res == QMessageBox::Yes)
}
}
A fix for this bug would be appreciated.
Attachments
Issue Links
- relates to
-
QTBUG-83939 QGenericUnixServices::openDocument / xdgDesktopPortalOpenFile uses wrong fd mode, breaking snaps
- Closed
For Gerrit Dashboard: QTBUG-113143 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
475631,1 | OpenFile portal: do not use O_PATH fds | tqtc/lts-5.15 | qt/tqtc-qtbase | Status: NEW | 0 | 0 |
475425,2 | OpenFile portal: do not use O_PATH fds | dev | qt/qtbase | Status: MERGED | +2 | 0 |
475629,2 | OpenFile portal: do not use O_PATH fds | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |