core: replace throws with qFatal

This commit is contained in:
outfoxxed 2024-03-27 02:13:47 -07:00
parent 055b191a67
commit 9625129844
Signed by: outfoxxed
GPG Key ID: 4C88A185FB89301E
5 changed files with 4 additions and 7 deletions

View File

@ -64,7 +64,8 @@ LockWindowExtension* LockWindowExtension::get(QWindow* window) {
}
bool LockWindowExtension::attach(QWindow* window, SessionLockManager* manager) {
if (this->surface != nullptr) throw "Cannot change the attached window of a LockWindowExtension";
if (this->surface != nullptr)
qFatal() << "Cannot change the attached window of a LockWindowExtension";
auto* current = LockWindowExtension::get(window);
QtWaylandClient::QWaylandWindow* waylandWindow = nullptr;

View File

@ -13,7 +13,6 @@ QSWaylandSessionLockIntegration::createShellSurface(QtWaylandClient::QWaylandWin
if (lock == nullptr || lock->surface == nullptr || !lock->surface->isExposed()) {
qFatal() << "Visibility canary failed. A window with a LockWindowExtension MUST be set to "
"visible via LockWindowExtension::setVisible";
throw nullptr;
}
return lock->surface;

View File

@ -19,12 +19,10 @@ QSWaylandSessionLockSurface::QSWaylandSessionLockSurface(QtWaylandClient::QWayla
if (this->ext == nullptr) {
qFatal() << "QSWaylandSessionLockSurface created with null LockWindowExtension";
throw nullptr;
}
if (this->ext->lock == nullptr) {
qFatal() << "QSWaylandSessionLock for QSWaylandSessionLockSurface died";
throw nullptr;
}
wl_output* output = nullptr; // NOLINT (include)
@ -34,7 +32,6 @@ QSWaylandSessionLockSurface::QSWaylandSessionLockSurface(QtWaylandClient::QWayla
output = waylandScreen->output();
} else {
qFatal() << "Session lock screen does not corrospond to a real screen. Force closing window";
throw nullptr;
}
this->init(this->ext->lock->get_lock_surface(window->waylandSurface()->object(), output));

View File

@ -34,7 +34,7 @@ QSWaylandLayerSurface::QSWaylandLayerSurface(
this->ext = LayershellWindowExtension::get(qwindow);
if (this->ext == nullptr) {
throw "QSWaylandLayerSurface created with null LayershellWindowExtension";
qFatal() << "QSWaylandLayerSurface created with null LayershellWindowExtension";
}
wl_output* output = nullptr; // NOLINT (include)

View File

@ -25,7 +25,7 @@ LayershellWindowExtension* LayershellWindowExtension::get(QWindow* window) {
bool LayershellWindowExtension::attach(QWindow* window) {
if (this->surface != nullptr)
throw "Cannot change the attached window of a LayershellWindowExtension";
qFatal() << "Cannot change the attached window of a LayershellWindowExtension";
auto* current = LayershellWindowExtension::get(window);