mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
Fix implicit fallthrough
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
110d1a8fcf
commit
eda4592f19
5 changed files with 18 additions and 17 deletions
|
|
@ -172,7 +172,8 @@ int inf(QFile* source, std::function<bool(const QByteArray&)> handleBlock)
|
||||||
assert(ret != Z_STREAM_ERROR); /* state not clobbered */
|
assert(ret != Z_STREAM_ERROR); /* state not clobbered */
|
||||||
switch (ret) {
|
switch (ret) {
|
||||||
case Z_NEED_DICT:
|
case Z_NEED_DICT:
|
||||||
ret = Z_DATA_ERROR; /* and fall through */
|
ret = Z_DATA_ERROR;
|
||||||
|
[[fallthrough]];
|
||||||
case Z_DATA_ERROR:
|
case Z_DATA_ERROR:
|
||||||
case Z_MEM_ERROR:
|
case Z_MEM_ERROR:
|
||||||
(void)inflateEnd(&strm);
|
(void)inflateEnd(&strm);
|
||||||
|
|
|
||||||
|
|
@ -198,9 +198,8 @@ QVariant VersionProxyModel::data(const QModelIndex& index, int role) const
|
||||||
return tr("Latest");
|
return tr("Latest");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return sourceModel()->data(parentIndex, BaseVersionList::VersionIdRole);
|
|
||||||
}
|
}
|
||||||
|
return sourceModel()->data(parentIndex, BaseVersionList::VersionIdRole);
|
||||||
}
|
}
|
||||||
case Qt::DecorationRole: {
|
case Qt::DecorationRole: {
|
||||||
if (column == Name && hasRecommended) {
|
if (column == Name && hasRecommended) {
|
||||||
|
|
|
||||||
|
|
@ -67,22 +67,22 @@ QVariant ResourcePackFolderModel::data(const QModelIndex& index, int role) const
|
||||||
switch (role) {
|
switch (role) {
|
||||||
case Qt::BackgroundRole:
|
case Qt::BackgroundRole:
|
||||||
return rowBackground(row);
|
return rowBackground(row);
|
||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole: {
|
||||||
switch (column) {
|
if (column == PackFormatColumn) {
|
||||||
case PackFormatColumn: {
|
auto& resource = at(row);
|
||||||
auto& resource = at(row);
|
auto pack_format = resource.packFormat();
|
||||||
auto pack_format = resource.packFormat();
|
if (pack_format == 0)
|
||||||
if (pack_format == 0)
|
return tr("Unrecognized");
|
||||||
return tr("Unrecognized");
|
|
||||||
|
|
||||||
auto version_bounds = resource.compatibleVersions();
|
auto version_bounds = resource.compatibleVersions();
|
||||||
if (version_bounds.first.toString().isEmpty())
|
if (version_bounds.first.toString().isEmpty())
|
||||||
return QString::number(pack_format);
|
return QString::number(pack_format);
|
||||||
|
|
||||||
return QString("%1 (%2 - %3)")
|
return QString("%1 (%2 - %3)")
|
||||||
.arg(QString::number(pack_format), version_bounds.first.toString(), version_bounds.second.toString());
|
.arg(QString::number(pack_format), version_bounds.first.toString(), version_bounds.second.toString());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case Qt::DecorationRole: {
|
case Qt::DecorationRole: {
|
||||||
if (column == ImageColumn) {
|
if (column == ImageColumn) {
|
||||||
return at(row).image({ 32, 32 }, Qt::AspectRatioMode::KeepAspectRatioByExpanding);
|
return at(row).image({ 32, 32 }, Qt::AspectRatioMode::KeepAspectRatioByExpanding);
|
||||||
|
|
|
||||||
|
|
@ -192,6 +192,7 @@ QVariant ListModel::data(const QModelIndex& index, int role) const
|
||||||
// bugged pack, currently only indicates bugged xml
|
// bugged pack, currently only indicates bugged xml
|
||||||
return QColor(244, 229, 66);
|
return QColor(244, 229, 66);
|
||||||
}
|
}
|
||||||
|
return {};
|
||||||
}
|
}
|
||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
return pack.name;
|
return pack.name;
|
||||||
|
|
|
||||||
|
|
@ -255,7 +255,7 @@ JavaWizardWidget::ValidationStatus JavaWizardWidget::validate()
|
||||||
return ValidationStatus::JavaBad;
|
return ValidationStatus::JavaBad;
|
||||||
case QMessageBox::Help:
|
case QMessageBox::Help:
|
||||||
DesktopServices::openUrl(QUrl(BuildConfig.HELP_URL.arg("java-wizard")));
|
DesktopServices::openUrl(QUrl(BuildConfig.HELP_URL.arg("java-wizard")));
|
||||||
/* fallthrough */
|
[[fallthrough]];
|
||||||
case QMessageBox::No:
|
case QMessageBox::No:
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue