Skip to content

Commit 5ed7961

Browse files
committed
Qt: Refuse to start in known broken environments
1 parent 30df16c commit 5ed7961

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/duckstation-qt/qthost.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ static bool s_cleanup_after_update = false;
148148
EmuThread* g_emu_thread;
149149

150150
EmuThread::EmuThread()
151-
: QThread(), m_ui_thread(QThread::currentThread()), m_input_device_list_model(std::make_unique<InputDeviceListModel>())
151+
: QThread(), m_ui_thread(QThread::currentThread()),
152+
m_input_device_list_model(std::make_unique<InputDeviceListModel>())
152153
{
153154
// owned by itself
154155
moveToThread(this);
@@ -530,7 +531,13 @@ bool QtHost::SetCriticalFolders()
530531
// the resources directory should exist, bail out if not
531532
const std::string rcc_path = Path::Combine(EmuFolders::Resources, "duckstation-qt.rcc");
532533
if (!FileSystem::FileExists(rcc_path.c_str()) || !QResource::registerResource(QString::fromStdString(rcc_path)) ||
533-
!FileSystem::DirectoryExists(EmuFolders::Resources.c_str()))
534+
!FileSystem::DirectoryExists(EmuFolders::Resources.c_str())
535+
#ifdef __linux__
536+
// Broken packages that won't stop distributing my application.
537+
|| StringUtil::StartsWithNoCase(EmuFolders::AppRoot, "/usr/lib")
538+
#endif
539+
)
540+
534541
{
535542
QMessageBox::critical(nullptr, QStringLiteral("Error"),
536543
QStringLiteral("Resources are missing, your installation is incomplete."));
@@ -2224,7 +2231,7 @@ QString QtHost::FormatNumber(Host::NumberFormatType type, s64 value)
22242231
}
22252232
break;
22262233

2227-
DefaultCaseIsUnreachable();
2234+
DefaultCaseIsUnreachable();
22282235
}
22292236

22302237
ret = QDateTime::fromSecsSinceEpoch(value, QTimeZone::utc()).toLocalTime().toString(format);

0 commit comments

Comments
 (0)