Skip to content

Commit 9a24913

Browse files
committed
FullscreenUI: Remove now-unused host file selector functions
Apparently I forgot this. Should've been optimized out with LTO anyway.
1 parent c1ff163 commit 9a24913

File tree

5 files changed

+0
-95
lines changed

5 files changed

+0
-95
lines changed

src/core/fullscreenui_widgets.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3805,13 +3805,6 @@ void FullscreenUI::FileSelectorDialog::Open(std::string_view title, FileSelector
38053805
if (initial_directory.empty() || !FileSystem::DirectoryExists(initial_directory.c_str()))
38063806
initial_directory = FileSystem::GetWorkingDirectory();
38073807

3808-
if (Host::ShouldPreferHostFileSelector())
3809-
{
3810-
Host::OpenHostFileSelectorAsync(ImGuiManager::StripIconCharacters(title), select_directory, std::move(callback),
3811-
std::move(filters), initial_directory);
3812-
return;
3813-
}
3814-
38153808
SetTitleAndOpen(fmt::format("{}##file_selector_dialog", title));
38163809
m_callback = std::move(callback);
38173810
m_filters = std::move(filters);

src/core/fullscreenui_widgets.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -656,14 +656,4 @@ namespace Host {
656656
/// Returns the name of the default Big Picture theme to use based on the host theme.
657657
const char* GetDefaultFullscreenUITheme();
658658

659-
/// Returns true if native file dialogs should be preferred over Big Picture.
660-
bool ShouldPreferHostFileSelector();
661-
662-
/// Opens a file selector dialog.
663-
using FileSelectorCallback = std::function<void(const std::string& path)>;
664-
using FileSelectorFilters = std::vector<std::string>;
665-
void OpenHostFileSelectorAsync(std::string_view title, bool select_directory, FileSelectorCallback callback,
666-
FileSelectorFilters filters = FileSelectorFilters(),
667-
std::string_view initial_directory = std::string_view());
668-
669659
} // namespace Host

src/duckstation-mini/mini_host.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,24 +1368,11 @@ void Host::ConfirmMessageAsync(std::string_view title, std::string_view message,
13681368
});
13691369
}
13701370

1371-
void Host::OpenHostFileSelectorAsync(std::string_view title, bool select_directory, FileSelectorCallback callback,
1372-
FileSelectorFilters filters /* = FileSelectorFilters() */,
1373-
std::string_view initial_directory /* = std::string_view() */)
1374-
{
1375-
// TODO: Use SDL FileDialog API
1376-
callback(std::string());
1377-
}
1378-
13791371
const char* Host::GetDefaultFullscreenUITheme()
13801372
{
13811373
return "";
13821374
}
13831375

1384-
bool Host::ShouldPreferHostFileSelector()
1385-
{
1386-
return false;
1387-
}
1388-
13891376
static void SignalHandler(int signal)
13901377
{
13911378
// First try the normal (graceful) shutdown/exit.

src/duckstation-qt/qthost.cpp

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,59 +1667,6 @@ void Host::OnAchievementsHardcoreModeChanged(bool enabled)
16671667
emit g_core_thread->achievementsHardcoreModeChanged(enabled);
16681668
}
16691669

1670-
bool Host::ShouldPreferHostFileSelector()
1671-
{
1672-
#ifdef __linux__
1673-
// If running inside a flatpak, we want to use native selectors/portals.
1674-
return (std::getenv("container") != nullptr);
1675-
#else
1676-
return false;
1677-
#endif
1678-
}
1679-
1680-
void Host::OpenHostFileSelectorAsync(std::string_view title, bool select_directory, FileSelectorCallback callback,
1681-
FileSelectorFilters filters /* = FileSelectorFilters() */,
1682-
std::string_view initial_directory /* = std::string_view() */)
1683-
{
1684-
const bool from_cpu_thread = g_core_thread->isCurrentThread();
1685-
1686-
QString filters_str;
1687-
if (!filters.empty())
1688-
{
1689-
filters_str.append(QStringLiteral("All File Types (%1)")
1690-
.arg(QString::fromStdString(StringUtil::JoinString(filters.begin(), filters.end(), " "))));
1691-
for (const std::string& filter : filters)
1692-
{
1693-
filters_str.append(
1694-
QStringLiteral(";;%1 Files (%2)")
1695-
.arg(
1696-
QtUtils::StringViewToQString(std::string_view(filter).substr(filter.starts_with("*.") ? 2 : 0)).toUpper())
1697-
.arg(QString::fromStdString(filter)));
1698-
}
1699-
}
1700-
1701-
Host::RunOnUIThread([title = QtUtils::StringViewToQString(title), select_directory, callback = std::move(callback),
1702-
filters_str = std::move(filters_str),
1703-
initial_directory = QtUtils::StringViewToQString(initial_directory), from_cpu_thread]() mutable {
1704-
auto lock = g_main_window->pauseAndLockSystem();
1705-
1706-
QString path;
1707-
1708-
if (select_directory)
1709-
path = QFileDialog::getExistingDirectory(lock.getDialogParent(), title, initial_directory);
1710-
else
1711-
path = QFileDialog::getOpenFileName(lock.getDialogParent(), title, initial_directory, filters_str);
1712-
1713-
if (!path.isEmpty())
1714-
path = QDir::toNativeSeparators(path);
1715-
1716-
if (from_cpu_thread)
1717-
Host::RunOnCoreThread([callback = std::move(callback), path = path.toStdString()]() { callback(path); });
1718-
else
1719-
callback(path.toStdString());
1720-
});
1721-
}
1722-
17231670
void Host::BeginTextInput()
17241671
{
17251672
DEV_LOG("Host::BeginTextInput()");

src/duckstation-regtest/regtest_host.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -648,18 +648,6 @@ const char* Host::GetDefaultFullscreenUITheme()
648648
return "";
649649
}
650650

651-
bool Host::ShouldPreferHostFileSelector()
652-
{
653-
return false;
654-
}
655-
656-
void Host::OpenHostFileSelectorAsync(std::string_view title, bool select_directory, FileSelectorCallback callback,
657-
FileSelectorFilters filters /* = FileSelectorFilters() */,
658-
std::string_view initial_directory /* = std::string_view() */)
659-
{
660-
callback(std::string());
661-
}
662-
663651
void Host::AddFixedInputBindings(const SettingsInterface& si)
664652
{
665653
// noop

0 commit comments

Comments
 (0)