From 5b473b6866b55331b0e2c844d9a6f280b1ffbe27 Mon Sep 17 00:00:00 2001 From: Juraj Oravec Date: Thu, 25 Aug 2022 10:26:09 +0200 Subject: [PATCH] Remove Q_UNREACHABLE from my new code It is not used anywhere in Falkon code, and it seems to close program when it is reached (at least the compiled as debug version). Signed-off-by: Juraj Oravec --- src/lib/other/sitesettingsmanager.cpp | 8 ++------ src/lib/tools/html5permissions/html5permissionsdialog.cpp | 4 ++-- src/lib/tools/html5permissions/html5permissionsitem.cpp | 4 +--- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/lib/other/sitesettingsmanager.cpp b/src/lib/other/sitesettingsmanager.cpp index db19038f6..b58dd020b 100644 --- a/src/lib/other/sitesettingsmanager.cpp +++ b/src/lib/other/sitesettingsmanager.cpp @@ -217,7 +217,6 @@ QString SiteSettingsManager::optionToSqlColumn(const SiteSettingsManager::PageOp return QSL("allow_desktop_audio_video_capture"); default: - Q_UNREACHABLE(); qWarning() << "Unknown option" << option; return QLatin1String(""); } @@ -260,7 +259,6 @@ SiteSettingsManager::Permission SiteSettingsManager::getDefaultPermission(const case poZoomLevel: case poAllowCookies: default: - Q_UNREACHABLE(); qWarning() << "Unknown option" << option; return Deny; } @@ -291,8 +289,8 @@ void SiteSettingsManager::setDefaultPermission(const SiteSettingsManager::PageOp case poAllowJavascript: case poAllowImages: default: - Q_UNREACHABLE(); qWarning() << "Unknown option" << option; + break; } } @@ -317,8 +315,8 @@ void SiteSettingsManager::setDefaultPermission(const SiteSettingsManager::PageOp m_defaults[option] = permission; break; default: - Q_UNREACHABLE(); qWarning() << "Unknown option" << option; + break; } } @@ -345,7 +343,6 @@ bool SiteSettingsManager::getDefaultOptionValue(const SiteSettingsManager::PageO return false; default: - Q_UNREACHABLE(); qWarning() << "Unknown option" << option; return false; } @@ -379,7 +376,6 @@ SiteSettingsManager::PageOptions SiteSettingsManager::optionFromWebEngineFeature return poAllowDesktopAudioVideoCapture; default: - Q_UNREACHABLE(); qWarning() << "Unknown feature" << feature; return poAllowNotifications; } diff --git a/src/lib/tools/html5permissions/html5permissionsdialog.cpp b/src/lib/tools/html5permissions/html5permissionsdialog.cpp index 1b5a908e4..9766937e8 100644 --- a/src/lib/tools/html5permissions/html5permissionsdialog.cpp +++ b/src/lib/tools/html5permissions/html5permissionsdialog.cpp @@ -102,7 +102,7 @@ void HTML5PermissionsDialog::createEntry(const HTML5PermissionsDialog::SiteData& item->setText(1, tr("Ask")); break; default: - Q_UNREACHABLE(); + qWarning() << "Unknown unknown permission" << siteData.perm; item->setText(1, tr("Default")); break; } @@ -148,7 +148,7 @@ QWebEnginePage::Feature HTML5PermissionsDialog::indexToFeature(const int index) case 7: return QWebEnginePage::DesktopAudioVideoCapture; default: - Q_UNREACHABLE(); + qWarning() << "Unknown feature index" << index; return QWebEnginePage::Notifications; } } diff --git a/src/lib/tools/html5permissions/html5permissionsitem.cpp b/src/lib/tools/html5permissions/html5permissionsitem.cpp index 27fda8337..a2ba0c9c2 100644 --- a/src/lib/tools/html5permissions/html5permissionsitem.cpp +++ b/src/lib/tools/html5permissions/html5permissionsitem.cpp @@ -51,7 +51,6 @@ void HTML5PermissionsItem::permissionIndexChanged() m_permission = SiteSettingsManager::Ask; break; default: - Q_UNREACHABLE(); qWarning() << "Unknown permission index" << ui->comboBox->currentIndex(); break; } @@ -93,7 +92,6 @@ void HTML5PermissionsItem::setLabel() break; default: - Q_UNREACHABLE(); qWarning() << "Unknown feature" << m_feature; break; } @@ -113,7 +111,7 @@ void HTML5PermissionsItem::setCombo() ui->comboBox->setCurrentIndex(2); break; default: - Q_UNREACHABLE(); + ui->comboBox->setCurrentIndex(2); qWarning() << "Unknown permission" << m_permission; break; }