@@ -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-
17231670void Host::BeginTextInput ()
17241671{
17251672 DEV_LOG (" Host::BeginTextInput()" );
0 commit comments