Bug 431893 - When a file is opened in 3rd-party app that uses the KDE file dialog, the "open" dialog does not display the location where the file lives
Summary: When a file is opened in 3rd-party app that uses the KDE file dialog, the "op...
Status: RESOLVED DOWNSTREAM
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: Open/save dialogs (other bugs)
Version First Reported In: git master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-21 19:45 UTC by Nate Graham
Modified: 2021-01-22 16:55 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2021-01-21 19:45:50 UTC
Everything KDE from git master on openSUSE tumbleweed.


STEPS TO REPRODUCE
4. Open a local file in LibreOffice or VLC
5. Activate the app's "Open" dialog from File -> Open


OBSERVED RESULT
The dialog shows a seemingly random location


EXPECTED RESULT
The dialog shows the folder that the files live in. This happens for KDE apps (tested Gwenview, Okular, and Kile), but does not seem to work for non-KDE apps which are using the KDE open dialog.
Comment 1 Nate Graham 2021-01-21 19:46:11 UTC
Possibly an issue in plasma-integration rather than the dialog itself, but I thought I'd start here.
Comment 2 Harald Sitter 2021-01-22 14:09:24 UTC
I really don't think that's anything under our control. For one Qt can restore the last used directory (if the app provides no directory I presume), for another the app itself can set any arbitrary directory. There is no consistency to be had here. "Current" directory is entirely context dependent and unless the app provides that context anyone's guess is as good as our's. Plus by the looks of it the Qt restoring cannot be distinguished from the app setting the dir so we also can't override Qt on this either.

#0  KDEPlatformFileDialog::setDirectory(QUrl const&) (this=0x7fffd8581ad0, directory=...) at ../src/platformtheme/kdeplatformfiledialoghelper.cpp:226
#1  0x00007ffff05091e1 in KDEPlatformFileDialogHelper::setDirectory(QUrl const&) (this=Python Exception <class 'gdb.error'> Dwarf Error: Cannot find DIE at 0x262eb referenced from DIE at 0x2f01ec9 [in module /usr/lib/debug/.build-id/3d/f8de9b92bd1a0a57bfcc49ae4939d441260cb3.debug]: 
0x7fffd8460390, directory=...) at ../src/platformtheme/kdeplatformfiledialoghelper.cpp:444
#2  0x00007ffff2eaadfe in QFileDialogPrivate::setDirectory_sys(QUrl const&) (directory=..., this=<optimized out>) at dialogs/qfiledialog_p.h:379
#3  QFileDialog::setDirectoryUrl(QUrl const&) (this=this@entry=0x7ffff455ca50, directory=...) at dialogs/qfiledialog.cpp:1019
#4  0x00007ffff2eb8223 in QFileDialogPrivate::restoreFromSettings() (this=this@entry=0x7fffd8318150) at dialogs/qfiledialog.cpp:85
#5  0x00007ffff2eb9b07 in QFileDialogPrivate::init(QFileDialogArgs const&) (this=0x7fffd8318150, args=...) at dialogs/qfiledialog.cpp:3057
#6  0x00007ffff2eba9e1 in QFileDialog::QFileDialog(QFileDialogArgs const&) (this=0x7ffff455ca50, args=...) at dialogs/qfiledialog.cpp:390
#7  0x00007ffff2ebae86 in QFileDialog::getOpenFileUrls(QWidget*, QString const&, QUrl const&, QString const&, QString*, QFlags<QFileDialog::Option>, QStringList const&) (parent=0x0, caption=..., dir=..., filter=..., selectedFilter=0x0, options=..., supportedSchemes=...) at dialogs/qfiledialog.cpp:2377
Comment 3 Nate Graham 2021-01-22 16:55:54 UTC
Darn. I guess I'll go file bug reports on those apps, then. Thanks for taking a look!