mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-01 15:49:51 +08:00
UI: Fix file browser showing up when dir selected
Fixes: https://obsproject.com/mantis/view.php?id=1418
This commit is contained in:
+14
-1
@@ -18,6 +18,7 @@
|
||||
#include <QDialogButtonBox>
|
||||
#include <QMenu>
|
||||
#include <QStackedWidget>
|
||||
#include <QDir>
|
||||
#include "double-slider.hpp"
|
||||
#include "qt-wrappers.hpp"
|
||||
#include "properties-view.hpp"
|
||||
@@ -1977,9 +1978,21 @@ void WidgetInfo::EditListEdit()
|
||||
QListWidgetItem *item = selectedItems[0];
|
||||
|
||||
if (type == OBS_EDITABLE_LIST_TYPE_FILES) {
|
||||
QString path = QFileDialog::getOpenFileName(
|
||||
QDir pathDir(item->text());
|
||||
QString path;
|
||||
|
||||
if (pathDir.exists())
|
||||
path = QFileDialog::getExistingDirectory(
|
||||
App()->GetMainWindow(),
|
||||
QTStr("Browse"),
|
||||
item->text(),
|
||||
QFileDialog::ShowDirsOnly |
|
||||
QFileDialog::DontResolveSymlinks);
|
||||
else
|
||||
path = QFileDialog::getOpenFileName(
|
||||
App()->GetMainWindow(), QTStr("Browse"),
|
||||
item->text(), QT_UTF8(filter));
|
||||
|
||||
if (path.isEmpty())
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user