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.
Possibly an issue in plasma-integration rather than the dialog itself, but I thought I'd start here.
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
Darn. I guess I'll go file bug reports on those apps, then. Thanks for taking a look!