[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[xdg-desktop-portal-kde] KDE Bug 402077: SaveFile does not set the current_name



Hi,

I am here on Debian/testing AMD64.

The KDE file selection dialog when running Firefox-ESR with
"GTK_USE_PORTAL=1" does not work properly with SaveFile.

For example when I want to save a PDF from a website the original
filename is not offered/displayed in the SaveFile-Dialog-Box.

For details see KDE Bug 402077 "SaveFile does not set the current_name" in [1].

There exists a patch for xdg-desktop-portal-kde 5.14 branch in [2].
[2] applies cleany to xdg-desktop-portal-kde (5.14.5-2) sources.

Is it possible you can apply it?

Thanks in advance.

Best regards,
- Sedat .-

[1] https://bugs.kde.org/show_bug.cgi?id=402077
[2] https://phabricator.kde.org/D18378

P.S.: Details xdg-desktop-portal-kde

root# LC_ALL=C apt-cache policy xdg-desktop-portal-kde
xdg-desktop-portal-kde:
  Installed: 5.14.5-2
  Candidate: 5.14.5-2
  Version table:
 *** 5.14.5-2 100
         99 http://deb.debian.org/debian testing/main amd64 Packages
         99 http://deb.debian.org/debian unstable/main amd64 Packages
        100 /var/lib/dpkg/status
     5.14.5-1 500
        500 http://deb.debian.org/debian buster/main amd64 Packages

user$ diff -uprN /usr/share/applications/firefox-esr.desktop
~/.local/share/applications/firefox-esr.desktop | egrep 'Desktop|Exec'
+[Desktop Action new-private-window]
+Exec=GTK_USE_PORTAL=1 /usr/lib/firefox-esr/firefox-esr --private-window %u
+[Desktop Action new-window]
+Exec=GTK_USE_PORTAL=1 /usr/lib/firefox-esr/firefox-esr --new-window %u
 [Desktop Entry]
+Exec=GTK_USE_PORTAL=1 /usr/lib/firefox-esr/firefox-esr %u
-Exec=/usr/lib/firefox-esr/firefox-esr %u

- EOT -
diff --git a/src/filechooser.cpp b/src/filechooser.cpp
--- a/src/filechooser.cpp
+++ b/src/filechooser.cpp
@@ -293,7 +293,10 @@
     fileDialog->setAcceptMode(QFileDialog::AcceptSave);
 
     if (!currentFolder.isEmpty()) {
-        fileDialog->setDirectoryUrl(QUrl(currentFolder));
+        QUrl currentUrl(currentFolder);
+        if(currentUrl.scheme().isEmpty())
+            currentUrl=QUrl::fromLocalFile(currentFolder);
+        fileDialog->setDirectoryUrl(currentUrl);
     }
 
     if (!currentFile.isEmpty()) {


Reply to: