From 9625129844828754f479e795f66a2f722d33a8f9 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Wed, 27 Mar 2024 02:13:47 -0700 Subject: [PATCH] core: replace throws with qFatal --- src/wayland/session_lock/session_lock.cpp | 3 ++- src/wayland/session_lock/shell_integration.cpp | 1 - src/wayland/session_lock/surface.cpp | 3 --- src/wayland/wlr_layershell/surface.cpp | 2 +- src/wayland/wlr_layershell/window.cpp | 2 +- 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/wayland/session_lock/session_lock.cpp b/src/wayland/session_lock/session_lock.cpp index 4f5fdd5..1f2f1ce 100644 --- a/src/wayland/session_lock/session_lock.cpp +++ b/src/wayland/session_lock/session_lock.cpp @@ -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; diff --git a/src/wayland/session_lock/shell_integration.cpp b/src/wayland/session_lock/shell_integration.cpp index da0e1f1..2b5fdbf 100644 --- a/src/wayland/session_lock/shell_integration.cpp +++ b/src/wayland/session_lock/shell_integration.cpp @@ -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; diff --git a/src/wayland/session_lock/surface.cpp b/src/wayland/session_lock/surface.cpp index 31b8099..36f9eac 100644 --- a/src/wayland/session_lock/surface.cpp +++ b/src/wayland/session_lock/surface.cpp @@ -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)); diff --git a/src/wayland/wlr_layershell/surface.cpp b/src/wayland/wlr_layershell/surface.cpp index 13f0d07..c5c5c9e 100644 --- a/src/wayland/wlr_layershell/surface.cpp +++ b/src/wayland/wlr_layershell/surface.cpp @@ -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) diff --git a/src/wayland/wlr_layershell/window.cpp b/src/wayland/wlr_layershell/window.cpp index 5ef2825..035bae1 100644 --- a/src/wayland/wlr_layershell/window.cpp +++ b/src/wayland/wlr_layershell/window.cpp @@ -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);