1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

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 <jurajoravec@mailo.com>
This commit is contained in:
Juraj Oravec 2022-08-25 10:26:09 +02:00
parent ab0ff451c2
commit 5b473b6866
Signed by: SGOrava
GPG Key ID: 13660A3F1D9F093B
3 changed files with 5 additions and 11 deletions

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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;
}