File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 1
1
#include " systemfiledialog.h"
2
2
3
+ #include < QFileInfo>
3
4
#include < QFileDialog>
4
5
#include < QStandardPaths>
5
6
@@ -84,7 +85,12 @@ void SystemFileDialog::onFileDialogFinished()
84
85
QUrl SystemFileDialog::standardLocationPath (StandardLocation location)
85
86
{
86
87
if (location == LastLocation) {
87
- return globalPrefs->lastFolderUrl ();
88
+ const auto lastFolderUrl = globalPrefs->lastFolderUrl ();
89
+ if (!QFileInfo::exists (lastFolderUrl.toLocalFile ())) {
90
+ return QUrl::fromLocalFile (QStandardPaths::writableLocation (QStandardPaths::HomeLocation));
91
+ } else {
92
+ return lastFolderUrl;
93
+ }
88
94
} else if (location == HomeLocation) {
89
95
return QUrl::fromLocalFile (QStandardPaths::writableLocation (QStandardPaths::HomeLocation));
90
96
} else if (location == DownloadsLocation) {
You can’t perform that action at this time.
0 commit comments