diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-06-07 23:31:58 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-06-15 14:40:40 -0400 |
| commit | 1897d60134e1cff31375f1c602196a99ece7fc86 (patch) | |
| tree | 3bc7391f2c7a15e500370b58a24e45756a2d411d /src/filedialogmemory.cpp | |
| parent | 7026aeaec859fd3632b1062e0cf14d2479c23076 (diff) | |
pulled java installation detection out of getFileExecutionContext() and into findJavaInstallation() because it was copy/pasted into EditExecutablesDialog
fixed FileDialogMemory::getOpenFileName() to also use the given directory correctly
handle browse binary button
Diffstat (limited to 'src/filedialogmemory.cpp')
| -rw-r--r-- | src/filedialogmemory.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/filedialogmemory.cpp b/src/filedialogmemory.cpp index 9607beb9..554a6235 100644 --- a/src/filedialogmemory.cpp +++ b/src/filedialogmemory.cpp @@ -61,14 +61,22 @@ QString FileDialogMemory::getOpenFileName( const QString &dir, const QString &filter, QString *selectedFilter,
QFileDialog::Options options)
{
- std::pair<std::map<QString, QString>::iterator, bool> currentDir =
- instance().m_Cache.insert(std::make_pair(dirID, dir));
+ QString currentDir = dir;
+
+ if (currentDir.isEmpty()) {
+ auto itor = instance().m_Cache.find(dirID);
+ if (itor != instance().m_Cache.end()) {
+ currentDir = itor->first;
+ }
+ }
+
+ QString result = QFileDialog::getOpenFileName(
+ parent, caption, currentDir, filter, selectedFilter, options);
- QString result = QFileDialog::getOpenFileName(parent, caption, currentDir.first->second,
- filter, selectedFilter, options);
if (!result.isNull()) {
instance().m_Cache[dirID] = QFileInfo(result).path();
}
+
return result;
}
|
