Reduce usage of [[nodiscard]] attributes (#3952)
This commit is contained in:
commit
e043242a8e
65 changed files with 329 additions and 327 deletions
|
@ -34,13 +34,13 @@ class DataPackResourcePage : public ResourcePage {
|
|||
}
|
||||
|
||||
//: The plural version of 'data pack'
|
||||
[[nodiscard]] inline QString resourcesString() const override { return tr("data packs"); }
|
||||
inline QString resourcesString() const override { return tr("data packs"); }
|
||||
//: The singular version of 'data packs'
|
||||
[[nodiscard]] inline QString resourceString() const override { return tr("data pack"); }
|
||||
inline QString resourceString() const override { return tr("data pack"); }
|
||||
|
||||
[[nodiscard]] bool supportsFiltering() const override { return false; };
|
||||
bool supportsFiltering() const override { return false; };
|
||||
|
||||
[[nodiscard]] QMap<QString, QString> urlHandlers() const override;
|
||||
QMap<QString, QString> urlHandlers() const override;
|
||||
|
||||
protected:
|
||||
DataPackResourcePage(DataPackDownloadDialog* dialog, BaseInstance& instance);
|
||||
|
|
|
@ -43,17 +43,17 @@ class ModPage : public ResourcePage {
|
|||
}
|
||||
|
||||
//: The plural version of 'mod'
|
||||
[[nodiscard]] inline QString resourcesString() const override { return tr("mods"); }
|
||||
inline QString resourcesString() const override { return tr("mods"); }
|
||||
//: The singular version of 'mods'
|
||||
[[nodiscard]] inline QString resourceString() const override { return tr("mod"); }
|
||||
inline QString resourceString() const override { return tr("mod"); }
|
||||
|
||||
[[nodiscard]] QMap<QString, QString> urlHandlers() const override;
|
||||
QMap<QString, QString> urlHandlers() const override;
|
||||
|
||||
void addResourceToPage(ModPlatform::IndexedPack::Ptr, ModPlatform::IndexedVersion&, std::shared_ptr<ResourceFolderModel>) override;
|
||||
|
||||
virtual std::unique_ptr<ModFilterWidget> createFilterWidget() = 0;
|
||||
|
||||
[[nodiscard]] bool supportsFiltering() const override { return true; };
|
||||
bool supportsFiltering() const override { return true; };
|
||||
auto getFilter() const -> const std::shared_ptr<ModFilterWidget::Filter> { return m_filter; }
|
||||
void setFilterWidget(std::unique_ptr<ModFilterWidget>&);
|
||||
|
||||
|
|
|
@ -25,5 +25,5 @@ class ModpackProviderBasePage : public BasePage {
|
|||
/** Programatically set the term in the search bar. */
|
||||
virtual void setSearchTerm(QString) = 0;
|
||||
/** Get the current term in the search bar. */
|
||||
[[nodiscard]] virtual QString getSerachTerm() const = 0;
|
||||
virtual QString getSerachTerm() const = 0;
|
||||
};
|
|
@ -36,25 +36,25 @@ class ResourceModel : public QAbstractListModel {
|
|||
ResourceModel(ResourceAPI* api);
|
||||
~ResourceModel() override;
|
||||
|
||||
[[nodiscard]] auto data(const QModelIndex&, int role) const -> QVariant override;
|
||||
[[nodiscard]] auto roleNames() const -> QHash<int, QByteArray> override;
|
||||
auto data(const QModelIndex&, int role) const -> QVariant override;
|
||||
auto roleNames() const -> QHash<int, QByteArray> override;
|
||||
bool setData(const QModelIndex& index, const QVariant& value, int role) override;
|
||||
|
||||
[[nodiscard]] virtual auto debugName() const -> QString;
|
||||
[[nodiscard]] virtual auto metaEntryBase() const -> QString = 0;
|
||||
virtual auto debugName() const -> QString;
|
||||
virtual auto metaEntryBase() const -> QString = 0;
|
||||
|
||||
[[nodiscard]] inline int rowCount(const QModelIndex& parent) const override
|
||||
inline int rowCount(const QModelIndex& parent) const override
|
||||
{
|
||||
return parent.isValid() ? 0 : static_cast<int>(m_packs.size());
|
||||
}
|
||||
[[nodiscard]] inline int columnCount(const QModelIndex& parent) const override { return parent.isValid() ? 0 : 1; }
|
||||
[[nodiscard]] inline auto flags(const QModelIndex& index) const -> Qt::ItemFlags override { return QAbstractListModel::flags(index); }
|
||||
inline int columnCount(const QModelIndex& parent) const override { return parent.isValid() ? 0 : 1; }
|
||||
inline auto flags(const QModelIndex& index) const -> Qt::ItemFlags override { return QAbstractListModel::flags(index); }
|
||||
|
||||
[[nodiscard]] bool hasActiveSearchJob() const { return m_current_search_job && m_current_search_job->isRunning(); }
|
||||
[[nodiscard]] bool hasActiveInfoJob() const { return m_current_info_job.isRunning(); }
|
||||
[[nodiscard]] Task::Ptr activeSearchJob() { return hasActiveSearchJob() ? m_current_search_job : nullptr; }
|
||||
bool hasActiveSearchJob() const { return m_current_search_job && m_current_search_job->isRunning(); }
|
||||
bool hasActiveInfoJob() const { return m_current_info_job.isRunning(); }
|
||||
Task::Ptr activeSearchJob() { return hasActiveSearchJob() ? m_current_search_job : nullptr; }
|
||||
|
||||
[[nodiscard]] auto getSortingMethods() const { return m_api->getSortingMethods(); }
|
||||
auto getSortingMethods() const { return m_api->getSortingMethods(); }
|
||||
|
||||
virtual QVariant getInstalledPackVersion(ModPlatform::IndexedPack::Ptr) const { return {}; }
|
||||
/** Whether the version is opted out or not. Currently only makes sense in CF. */
|
||||
|
@ -69,7 +69,6 @@ class ResourceModel : public QAbstractListModel {
|
|||
|
||||
public slots:
|
||||
void fetchMore(const QModelIndex& parent) override;
|
||||
// NOTE: Can't use [[nodiscard]] here because of https://bugreports.qt.io/browse/QTBUG-58628 on Qt 5.12
|
||||
inline bool canFetchMore(const QModelIndex& parent) const override
|
||||
{
|
||||
return parent.isValid() ? false : m_search_state == SearchState::CanFetchMore;
|
||||
|
@ -113,14 +112,14 @@ class ResourceModel : public QAbstractListModel {
|
|||
void runSearchJob(Task::Ptr);
|
||||
void runInfoJob(Task::Ptr);
|
||||
|
||||
[[nodiscard]] auto getCurrentSortingMethodByIndex() const -> std::optional<ResourceAPI::SortingMethod>;
|
||||
auto getCurrentSortingMethodByIndex() const -> std::optional<ResourceAPI::SortingMethod>;
|
||||
|
||||
/** Converts a JSON document to a common array format.
|
||||
*
|
||||
* This is needed so that different providers, with different JSON structures, can be parsed
|
||||
* uniformally. You NEED to re-implement this if you intend on using the default callbacks.
|
||||
*/
|
||||
[[nodiscard]] virtual auto documentToArray(QJsonDocument&) const -> QJsonArray;
|
||||
virtual auto documentToArray(QJsonDocument&) const -> QJsonArray;
|
||||
|
||||
/** Functions to load data into a pack.
|
||||
*
|
||||
|
|
|
@ -33,15 +33,15 @@ class ResourcePackResourcePage : public ResourcePage {
|
|||
}
|
||||
|
||||
//: The plural version of 'resource pack'
|
||||
[[nodiscard]] inline QString resourcesString() const override { return tr("resource packs"); }
|
||||
inline QString resourcesString() const override { return tr("resource packs"); }
|
||||
//: The singular version of 'resource packs'
|
||||
[[nodiscard]] inline QString resourceString() const override { return tr("resource pack"); }
|
||||
inline QString resourceString() const override { return tr("resource pack"); }
|
||||
|
||||
[[nodiscard]] bool supportsFiltering() const override { return false; };
|
||||
bool supportsFiltering() const override { return false; };
|
||||
|
||||
[[nodiscard]] QMap<QString, QString> urlHandlers() const override;
|
||||
QMap<QString, QString> urlHandlers() const override;
|
||||
|
||||
[[nodiscard]] inline auto helpPage() const -> QString override { return "resourcepack-platform"; }
|
||||
inline auto helpPage() const -> QString override { return "resourcepack-platform"; }
|
||||
|
||||
protected:
|
||||
ResourcePackResourcePage(ResourceDownloadDialog* dialog, BaseInstance& instance);
|
||||
|
|
|
@ -33,37 +33,37 @@ class ResourcePage : public QWidget, public BasePage {
|
|||
~ResourcePage() override;
|
||||
|
||||
/* Affects what the user sees */
|
||||
[[nodiscard]] auto displayName() const -> QString override = 0;
|
||||
[[nodiscard]] auto icon() const -> QIcon override = 0;
|
||||
[[nodiscard]] auto id() const -> QString override = 0;
|
||||
[[nodiscard]] auto helpPage() const -> QString override = 0;
|
||||
[[nodiscard]] bool shouldDisplay() const override = 0;
|
||||
auto displayName() const -> QString override = 0;
|
||||
auto icon() const -> QIcon override = 0;
|
||||
auto id() const -> QString override = 0;
|
||||
auto helpPage() const -> QString override = 0;
|
||||
bool shouldDisplay() const override = 0;
|
||||
|
||||
/* Used internally */
|
||||
[[nodiscard]] virtual auto metaEntryBase() const -> QString = 0;
|
||||
[[nodiscard]] virtual auto debugName() const -> QString = 0;
|
||||
virtual auto metaEntryBase() const -> QString = 0;
|
||||
virtual auto debugName() const -> QString = 0;
|
||||
|
||||
//: The plural version of 'resource'
|
||||
[[nodiscard]] virtual inline QString resourcesString() const { return tr("resources"); }
|
||||
virtual inline QString resourcesString() const { return tr("resources"); }
|
||||
//: The singular version of 'resources'
|
||||
[[nodiscard]] virtual inline QString resourceString() const { return tr("resource"); }
|
||||
virtual inline QString resourceString() const { return tr("resource"); }
|
||||
|
||||
/* Features this resource's page supports */
|
||||
[[nodiscard]] virtual bool supportsFiltering() const = 0;
|
||||
virtual bool supportsFiltering() const = 0;
|
||||
|
||||
void retranslate() override;
|
||||
void openedImpl() override;
|
||||
auto eventFilter(QObject* watched, QEvent* event) -> bool override;
|
||||
|
||||
/** Get the current term in the search bar. */
|
||||
[[nodiscard]] auto getSearchTerm() const -> QString;
|
||||
auto getSearchTerm() const -> QString;
|
||||
/** Programatically set the term in the search bar. */
|
||||
void setSearchTerm(QString);
|
||||
|
||||
[[nodiscard]] bool setCurrentPack(ModPlatform::IndexedPack::Ptr);
|
||||
[[nodiscard]] auto getCurrentPack() const -> ModPlatform::IndexedPack::Ptr;
|
||||
[[nodiscard]] auto getDialog() const -> const ResourceDownloadDialog* { return m_parentDialog; }
|
||||
[[nodiscard]] auto getModel() const -> ResourceModel* { return m_model; }
|
||||
bool setCurrentPack(ModPlatform::IndexedPack::Ptr);
|
||||
auto getCurrentPack() const -> ModPlatform::IndexedPack::Ptr;
|
||||
auto getDialog() const -> const ResourceDownloadDialog* { return m_parentDialog; }
|
||||
auto getModel() const -> ResourceModel* { return m_model; }
|
||||
|
||||
protected:
|
||||
ResourcePage(ResourceDownloadDialog* parent, BaseInstance&);
|
||||
|
@ -95,8 +95,6 @@ class ResourcePage : public QWidget, public BasePage {
|
|||
void onResourceSelected();
|
||||
void onResourceToggle(const QModelIndex& index);
|
||||
|
||||
// NOTE: Can't use [[nodiscard]] here because of https://bugreports.qt.io/browse/QTBUG-58628 on Qt 5.12
|
||||
|
||||
/** Associates regex expressions to pages in the order they're given in the map. */
|
||||
virtual QMap<QString, QString> urlHandlers() const = 0;
|
||||
virtual void openUrl(const QUrl&);
|
||||
|
|
|
@ -33,17 +33,17 @@ class ShaderPackResourcePage : public ResourcePage {
|
|||
}
|
||||
|
||||
//: The plural version of 'shader pack'
|
||||
[[nodiscard]] inline QString resourcesString() const override { return tr("shader packs"); }
|
||||
inline QString resourcesString() const override { return tr("shader packs"); }
|
||||
//: The singular version of 'shader packs'
|
||||
[[nodiscard]] inline QString resourceString() const override { return tr("shader pack"); }
|
||||
inline QString resourceString() const override { return tr("shader pack"); }
|
||||
|
||||
[[nodiscard]] bool supportsFiltering() const override { return false; };
|
||||
bool supportsFiltering() const override { return false; };
|
||||
|
||||
void addResourceToPage(ModPlatform::IndexedPack::Ptr, ModPlatform::IndexedVersion&, std::shared_ptr<ResourceFolderModel>) override;
|
||||
|
||||
[[nodiscard]] QMap<QString, QString> urlHandlers() const override;
|
||||
QMap<QString, QString> urlHandlers() const override;
|
||||
|
||||
[[nodiscard]] inline auto helpPage() const -> QString override { return "shaderpack-platform"; }
|
||||
inline auto helpPage() const -> QString override { return "shaderpack-platform"; }
|
||||
|
||||
protected:
|
||||
ShaderPackResourcePage(ShaderPackDownloadDialog* dialog, BaseInstance& instance);
|
||||
|
|
|
@ -15,7 +15,7 @@ class TexturePackResourceModel : public ResourcePackResourceModel {
|
|||
public:
|
||||
TexturePackResourceModel(BaseInstance const& inst, ResourceAPI* api);
|
||||
|
||||
[[nodiscard]] inline ::Version maximumTexturePackVersion() const { return { "1.6" }; }
|
||||
inline ::Version maximumTexturePackVersion() const { return { "1.6" }; }
|
||||
|
||||
ResourceAPI::SearchArgs createSearchArguments() override;
|
||||
ResourceAPI::VersionSearchArgs createVersionsArguments(const QModelIndex&) override;
|
||||
|
|
|
@ -35,9 +35,9 @@ class TexturePackResourcePage : public ResourcePackResourcePage {
|
|||
}
|
||||
|
||||
//: The plural version of 'texture pack'
|
||||
[[nodiscard]] inline QString resourcesString() const override { return tr("texture packs"); }
|
||||
inline QString resourcesString() const override { return tr("texture packs"); }
|
||||
//: The singular version of 'texture packs'
|
||||
[[nodiscard]] inline QString resourceString() const override { return tr("texture pack"); }
|
||||
inline QString resourceString() const override { return tr("texture pack"); }
|
||||
|
||||
protected:
|
||||
TexturePackResourcePage(TexturePackDownloadDialog* dialog, BaseInstance& instance) : ResourcePackResourcePage(dialog, instance) {}
|
||||
|
|
|
@ -68,7 +68,7 @@ class AtlPage : public QWidget, public ModpackProviderBasePage {
|
|||
/** Programatically set the term in the search bar. */
|
||||
virtual void setSearchTerm(QString) override;
|
||||
/** Get the current term in the search bar. */
|
||||
[[nodiscard]] virtual QString getSerachTerm() const override;
|
||||
virtual QString getSerachTerm() const override;
|
||||
|
||||
private:
|
||||
void suggestCurrent();
|
||||
|
|
|
@ -41,8 +41,8 @@ class ListModel : public QAbstractListModel {
|
|||
void getLogo(const QString& logo, const QString& logoUrl, LogoCallback callback);
|
||||
void searchWithTerm(const QString& term, int sort, std::shared_ptr<ModFilterWidget::Filter> filter, bool filterChanged);
|
||||
|
||||
[[nodiscard]] bool hasActiveSearchJob() const { return jobPtr && jobPtr->isRunning(); }
|
||||
[[nodiscard]] Task::Ptr activeSearchJob() { return hasActiveSearchJob() ? jobPtr : nullptr; }
|
||||
bool hasActiveSearchJob() const { return jobPtr && jobPtr->isRunning(); }
|
||||
Task::Ptr activeSearchJob() { return hasActiveSearchJob() ? jobPtr : nullptr; }
|
||||
|
||||
private slots:
|
||||
void performPaginatedSearch();
|
||||
|
|
|
@ -76,7 +76,7 @@ class FlamePage : public QWidget, public ModpackProviderBasePage {
|
|||
/** Programatically set the term in the search bar. */
|
||||
virtual void setSearchTerm(QString) override;
|
||||
/** Get the current term in the search bar. */
|
||||
[[nodiscard]] virtual QString getSerachTerm() const override;
|
||||
virtual QString getSerachTerm() const override;
|
||||
|
||||
private:
|
||||
void suggestCurrent();
|
||||
|
|
|
@ -20,8 +20,8 @@ class FlameModModel : public ModModel {
|
|||
bool optedOut(const ModPlatform::IndexedVersion& ver) const override;
|
||||
|
||||
private:
|
||||
[[nodiscard]] QString debugName() const override { return Flame::debugName() + " (Model)"; }
|
||||
[[nodiscard]] QString metaEntryBase() const override { return Flame::metaEntryBase(); }
|
||||
QString debugName() const override { return Flame::debugName() + " (Model)"; }
|
||||
QString metaEntryBase() const override { return Flame::metaEntryBase(); }
|
||||
|
||||
void loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
||||
void loadExtraPackInfo(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
||||
|
@ -41,8 +41,8 @@ class FlameResourcePackModel : public ResourcePackResourceModel {
|
|||
bool optedOut(const ModPlatform::IndexedVersion& ver) const override;
|
||||
|
||||
private:
|
||||
[[nodiscard]] QString debugName() const override { return Flame::debugName() + " (Model)"; }
|
||||
[[nodiscard]] QString metaEntryBase() const override { return Flame::metaEntryBase(); }
|
||||
QString debugName() const override { return Flame::debugName() + " (Model)"; }
|
||||
QString metaEntryBase() const override { return Flame::metaEntryBase(); }
|
||||
|
||||
void loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
||||
void loadExtraPackInfo(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
||||
|
@ -61,8 +61,8 @@ class FlameTexturePackModel : public TexturePackResourceModel {
|
|||
bool optedOut(const ModPlatform::IndexedVersion& ver) const override;
|
||||
|
||||
private:
|
||||
[[nodiscard]] QString debugName() const override { return Flame::debugName() + " (Model)"; }
|
||||
[[nodiscard]] QString metaEntryBase() const override { return Flame::metaEntryBase(); }
|
||||
QString debugName() const override { return Flame::debugName() + " (Model)"; }
|
||||
QString metaEntryBase() const override { return Flame::metaEntryBase(); }
|
||||
|
||||
void loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
||||
void loadExtraPackInfo(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
||||
|
@ -84,8 +84,8 @@ class FlameShaderPackModel : public ShaderPackResourceModel {
|
|||
bool optedOut(const ModPlatform::IndexedVersion& ver) const override;
|
||||
|
||||
private:
|
||||
[[nodiscard]] QString debugName() const override { return Flame::debugName() + " (Model)"; }
|
||||
[[nodiscard]] QString metaEntryBase() const override { return Flame::metaEntryBase(); }
|
||||
QString debugName() const override { return Flame::debugName() + " (Model)"; }
|
||||
QString metaEntryBase() const override { return Flame::metaEntryBase(); }
|
||||
|
||||
void loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
||||
void loadExtraPackInfo(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
||||
|
@ -103,8 +103,8 @@ class FlameDataPackModel : public DataPackResourceModel {
|
|||
bool optedOut(const ModPlatform::IndexedVersion& ver) const override;
|
||||
|
||||
private:
|
||||
[[nodiscard]] QString debugName() const override { return Flame::debugName() + " (Model)"; }
|
||||
[[nodiscard]] QString metaEntryBase() const override { return Flame::metaEntryBase(); }
|
||||
QString debugName() const override { return Flame::debugName() + " (Model)"; }
|
||||
QString metaEntryBase() const override { return Flame::metaEntryBase(); }
|
||||
|
||||
void loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
||||
void loadExtraPackInfo(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
||||
|
|
|
@ -86,15 +86,15 @@ class FlameModPage : public ModPage {
|
|||
FlameModPage(ModDownloadDialog* dialog, BaseInstance& instance);
|
||||
~FlameModPage() override = default;
|
||||
|
||||
[[nodiscard]] bool shouldDisplay() const override;
|
||||
bool shouldDisplay() const override;
|
||||
|
||||
[[nodiscard]] inline auto displayName() const -> QString override { return Flame::displayName(); }
|
||||
[[nodiscard]] inline auto icon() const -> QIcon override { return Flame::icon(); }
|
||||
[[nodiscard]] inline auto id() const -> QString override { return Flame::id(); }
|
||||
[[nodiscard]] inline auto debugName() const -> QString override { return Flame::debugName(); }
|
||||
[[nodiscard]] inline auto metaEntryBase() const -> QString override { return Flame::metaEntryBase(); }
|
||||
inline auto displayName() const -> QString override { return Flame::displayName(); }
|
||||
inline auto icon() const -> QIcon override { return Flame::icon(); }
|
||||
inline auto id() const -> QString override { return Flame::id(); }
|
||||
inline auto debugName() const -> QString override { return Flame::debugName(); }
|
||||
inline auto metaEntryBase() const -> QString override { return Flame::metaEntryBase(); }
|
||||
|
||||
[[nodiscard]] inline auto helpPage() const -> QString override { return "Mod-platform"; }
|
||||
inline auto helpPage() const -> QString override { return "Mod-platform"; }
|
||||
|
||||
void openUrl(const QUrl& url) override;
|
||||
std::unique_ptr<ModFilterWidget> createFilterWidget() override;
|
||||
|
@ -118,15 +118,15 @@ class FlameResourcePackPage : public ResourcePackResourcePage {
|
|||
FlameResourcePackPage(ResourcePackDownloadDialog* dialog, BaseInstance& instance);
|
||||
~FlameResourcePackPage() override = default;
|
||||
|
||||
[[nodiscard]] bool shouldDisplay() const override;
|
||||
bool shouldDisplay() const override;
|
||||
|
||||
[[nodiscard]] inline auto displayName() const -> QString override { return Flame::displayName(); }
|
||||
[[nodiscard]] inline auto icon() const -> QIcon override { return Flame::icon(); }
|
||||
[[nodiscard]] inline auto id() const -> QString override { return Flame::id(); }
|
||||
[[nodiscard]] inline auto debugName() const -> QString override { return Flame::debugName(); }
|
||||
[[nodiscard]] inline auto metaEntryBase() const -> QString override { return Flame::metaEntryBase(); }
|
||||
inline auto displayName() const -> QString override { return Flame::displayName(); }
|
||||
inline auto icon() const -> QIcon override { return Flame::icon(); }
|
||||
inline auto id() const -> QString override { return Flame::id(); }
|
||||
inline auto debugName() const -> QString override { return Flame::debugName(); }
|
||||
inline auto metaEntryBase() const -> QString override { return Flame::metaEntryBase(); }
|
||||
|
||||
[[nodiscard]] inline auto helpPage() const -> QString override { return ""; }
|
||||
inline auto helpPage() const -> QString override { return ""; }
|
||||
|
||||
void openUrl(const QUrl& url) override;
|
||||
};
|
||||
|
@ -143,15 +143,15 @@ class FlameTexturePackPage : public TexturePackResourcePage {
|
|||
FlameTexturePackPage(TexturePackDownloadDialog* dialog, BaseInstance& instance);
|
||||
~FlameTexturePackPage() override = default;
|
||||
|
||||
[[nodiscard]] bool shouldDisplay() const override;
|
||||
bool shouldDisplay() const override;
|
||||
|
||||
[[nodiscard]] inline auto displayName() const -> QString override { return Flame::displayName(); }
|
||||
[[nodiscard]] inline auto icon() const -> QIcon override { return Flame::icon(); }
|
||||
[[nodiscard]] inline auto id() const -> QString override { return Flame::id(); }
|
||||
[[nodiscard]] inline auto debugName() const -> QString override { return Flame::debugName(); }
|
||||
[[nodiscard]] inline auto metaEntryBase() const -> QString override { return Flame::metaEntryBase(); }
|
||||
inline auto displayName() const -> QString override { return Flame::displayName(); }
|
||||
inline auto icon() const -> QIcon override { return Flame::icon(); }
|
||||
inline auto id() const -> QString override { return Flame::id(); }
|
||||
inline auto debugName() const -> QString override { return Flame::debugName(); }
|
||||
inline auto metaEntryBase() const -> QString override { return Flame::metaEntryBase(); }
|
||||
|
||||
[[nodiscard]] inline auto helpPage() const -> QString override { return ""; }
|
||||
inline auto helpPage() const -> QString override { return ""; }
|
||||
|
||||
void openUrl(const QUrl& url) override;
|
||||
};
|
||||
|
@ -168,15 +168,15 @@ class FlameShaderPackPage : public ShaderPackResourcePage {
|
|||
FlameShaderPackPage(ShaderPackDownloadDialog* dialog, BaseInstance& instance);
|
||||
~FlameShaderPackPage() override = default;
|
||||
|
||||
[[nodiscard]] bool shouldDisplay() const override;
|
||||
bool shouldDisplay() const override;
|
||||
|
||||
[[nodiscard]] inline auto displayName() const -> QString override { return Flame::displayName(); }
|
||||
[[nodiscard]] inline auto icon() const -> QIcon override { return Flame::icon(); }
|
||||
[[nodiscard]] inline auto id() const -> QString override { return Flame::id(); }
|
||||
[[nodiscard]] inline auto debugName() const -> QString override { return Flame::debugName(); }
|
||||
[[nodiscard]] inline auto metaEntryBase() const -> QString override { return Flame::metaEntryBase(); }
|
||||
inline auto displayName() const -> QString override { return Flame::displayName(); }
|
||||
inline auto icon() const -> QIcon override { return Flame::icon(); }
|
||||
inline auto id() const -> QString override { return Flame::id(); }
|
||||
inline auto debugName() const -> QString override { return Flame::debugName(); }
|
||||
inline auto metaEntryBase() const -> QString override { return Flame::metaEntryBase(); }
|
||||
|
||||
[[nodiscard]] inline auto helpPage() const -> QString override { return ""; }
|
||||
inline auto helpPage() const -> QString override { return ""; }
|
||||
|
||||
void openUrl(const QUrl& url) override;
|
||||
};
|
||||
|
@ -195,15 +195,15 @@ class FlameDataPackPage : public DataPackResourcePage {
|
|||
FlameDataPackPage(DataPackDownloadDialog* dialog, BaseInstance& instance);
|
||||
~FlameDataPackPage() override = default;
|
||||
|
||||
[[nodiscard]] bool shouldDisplay() const override;
|
||||
bool shouldDisplay() const override;
|
||||
|
||||
[[nodiscard]] inline auto displayName() const -> QString override { return Flame::displayName(); }
|
||||
[[nodiscard]] inline auto icon() const -> QIcon override { return Flame::icon(); }
|
||||
[[nodiscard]] inline auto id() const -> QString override { return Flame::id(); }
|
||||
[[nodiscard]] inline auto debugName() const -> QString override { return Flame::debugName(); }
|
||||
[[nodiscard]] inline auto metaEntryBase() const -> QString override { return Flame::metaEntryBase(); }
|
||||
inline auto displayName() const -> QString override { return Flame::displayName(); }
|
||||
inline auto icon() const -> QIcon override { return Flame::icon(); }
|
||||
inline auto id() const -> QString override { return Flame::id(); }
|
||||
inline auto debugName() const -> QString override { return Flame::debugName(); }
|
||||
inline auto metaEntryBase() const -> QString override { return Flame::metaEntryBase(); }
|
||||
|
||||
[[nodiscard]] inline auto helpPage() const -> QString override { return ""; }
|
||||
inline auto helpPage() const -> QString override { return ""; }
|
||||
|
||||
void openUrl(const QUrl& url) override;
|
||||
};
|
||||
|
|
|
@ -52,7 +52,7 @@ class ImportFTBPage : public QWidget, public ModpackProviderBasePage {
|
|||
/** Programatically set the term in the search bar. */
|
||||
virtual void setSearchTerm(QString) override;
|
||||
/** Get the current term in the search bar. */
|
||||
[[nodiscard]] virtual QString getSerachTerm() const override;
|
||||
virtual QString getSerachTerm() const override;
|
||||
|
||||
private:
|
||||
void suggestCurrent();
|
||||
|
|
|
@ -74,7 +74,7 @@ class Page : public QWidget, public ModpackProviderBasePage {
|
|||
/** Programatically set the term in the search bar. */
|
||||
virtual void setSearchTerm(QString) override;
|
||||
/** Get the current term in the search bar. */
|
||||
[[nodiscard]] virtual QString getSerachTerm() const override;
|
||||
virtual QString getSerachTerm() const override;
|
||||
|
||||
private:
|
||||
void suggestCurrent();
|
||||
|
|
|
@ -73,8 +73,8 @@ class ModpackListModel : public QAbstractListModel {
|
|||
void refresh();
|
||||
void searchWithTerm(const QString& term, int sort, std::shared_ptr<ModFilterWidget::Filter> filter, bool filterChanged);
|
||||
|
||||
[[nodiscard]] bool hasActiveSearchJob() const { return jobPtr && jobPtr->isRunning(); }
|
||||
[[nodiscard]] Task::Ptr activeSearchJob() { return hasActiveSearchJob() ? jobPtr : nullptr; }
|
||||
bool hasActiveSearchJob() const { return jobPtr && jobPtr->isRunning(); }
|
||||
Task::Ptr activeSearchJob() { return hasActiveSearchJob() ? jobPtr : nullptr; }
|
||||
|
||||
void getLogo(const QString& logo, const QString& logoUrl, LogoCallback callback);
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ class ModrinthPage : public QWidget, public ModpackProviderBasePage {
|
|||
/** Programatically set the term in the search bar. */
|
||||
virtual void setSearchTerm(QString) override;
|
||||
/** Get the current term in the search bar. */
|
||||
[[nodiscard]] virtual QString getSerachTerm() const override;
|
||||
virtual QString getSerachTerm() const override;
|
||||
|
||||
private slots:
|
||||
void onSelectionChanged(QModelIndex first, QModelIndex second);
|
||||
|
|
|
@ -35,8 +35,8 @@ class ModrinthModModel : public ModModel {
|
|||
~ModrinthModModel() override = default;
|
||||
|
||||
private:
|
||||
[[nodiscard]] QString debugName() const override { return Modrinth::debugName() + " (Model)"; }
|
||||
[[nodiscard]] QString metaEntryBase() const override { return Modrinth::metaEntryBase(); }
|
||||
QString debugName() const override { return Modrinth::debugName() + " (Model)"; }
|
||||
QString metaEntryBase() const override { return Modrinth::metaEntryBase(); }
|
||||
|
||||
void loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
||||
void loadExtraPackInfo(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
||||
|
@ -54,8 +54,8 @@ class ModrinthResourcePackModel : public ResourcePackResourceModel {
|
|||
~ModrinthResourcePackModel() override = default;
|
||||
|
||||
private:
|
||||
[[nodiscard]] QString debugName() const override { return Modrinth::debugName() + " (Model)"; }
|
||||
[[nodiscard]] QString metaEntryBase() const override { return Modrinth::metaEntryBase(); }
|
||||
QString debugName() const override { return Modrinth::debugName() + " (Model)"; }
|
||||
QString metaEntryBase() const override { return Modrinth::metaEntryBase(); }
|
||||
|
||||
void loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
||||
void loadExtraPackInfo(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
||||
|
@ -72,8 +72,8 @@ class ModrinthTexturePackModel : public TexturePackResourceModel {
|
|||
~ModrinthTexturePackModel() override = default;
|
||||
|
||||
private:
|
||||
[[nodiscard]] QString debugName() const override { return Modrinth::debugName() + " (Model)"; }
|
||||
[[nodiscard]] QString metaEntryBase() const override { return Modrinth::metaEntryBase(); }
|
||||
QString debugName() const override { return Modrinth::debugName() + " (Model)"; }
|
||||
QString metaEntryBase() const override { return Modrinth::metaEntryBase(); }
|
||||
|
||||
void loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
||||
void loadExtraPackInfo(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
||||
|
@ -90,8 +90,8 @@ class ModrinthShaderPackModel : public ShaderPackResourceModel {
|
|||
~ModrinthShaderPackModel() override = default;
|
||||
|
||||
private:
|
||||
[[nodiscard]] QString debugName() const override { return Modrinth::debugName() + " (Model)"; }
|
||||
[[nodiscard]] QString metaEntryBase() const override { return Modrinth::metaEntryBase(); }
|
||||
QString debugName() const override { return Modrinth::debugName() + " (Model)"; }
|
||||
QString metaEntryBase() const override { return Modrinth::metaEntryBase(); }
|
||||
|
||||
void loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
||||
void loadExtraPackInfo(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
||||
|
@ -108,8 +108,8 @@ class ModrinthDataPackModel : public DataPackResourceModel {
|
|||
~ModrinthDataPackModel() override = default;
|
||||
|
||||
private:
|
||||
[[nodiscard]] QString debugName() const override { return Modrinth::debugName() + " (Model)"; }
|
||||
[[nodiscard]] QString metaEntryBase() const override { return Modrinth::metaEntryBase(); }
|
||||
QString debugName() const override { return Modrinth::debugName() + " (Model)"; }
|
||||
QString metaEntryBase() const override { return Modrinth::metaEntryBase(); }
|
||||
|
||||
void loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
||||
void loadExtraPackInfo(ModPlatform::IndexedPack& m, QJsonObject& obj) override;
|
||||
|
|
|
@ -85,15 +85,15 @@ class ModrinthModPage : public ModPage {
|
|||
ModrinthModPage(ModDownloadDialog* dialog, BaseInstance& instance);
|
||||
~ModrinthModPage() override = default;
|
||||
|
||||
[[nodiscard]] bool shouldDisplay() const override;
|
||||
bool shouldDisplay() const override;
|
||||
|
||||
[[nodiscard]] inline auto displayName() const -> QString override { return Modrinth::displayName(); }
|
||||
[[nodiscard]] inline auto icon() const -> QIcon override { return Modrinth::icon(); }
|
||||
[[nodiscard]] inline auto id() const -> QString override { return Modrinth::id(); }
|
||||
[[nodiscard]] inline auto debugName() const -> QString override { return Modrinth::debugName(); }
|
||||
[[nodiscard]] inline auto metaEntryBase() const -> QString override { return Modrinth::metaEntryBase(); }
|
||||
inline auto displayName() const -> QString override { return Modrinth::displayName(); }
|
||||
inline auto icon() const -> QIcon override { return Modrinth::icon(); }
|
||||
inline auto id() const -> QString override { return Modrinth::id(); }
|
||||
inline auto debugName() const -> QString override { return Modrinth::debugName(); }
|
||||
inline auto metaEntryBase() const -> QString override { return Modrinth::metaEntryBase(); }
|
||||
|
||||
[[nodiscard]] inline auto helpPage() const -> QString override { return "Mod-platform"; }
|
||||
inline auto helpPage() const -> QString override { return "Mod-platform"; }
|
||||
|
||||
std::unique_ptr<ModFilterWidget> createFilterWidget() override;
|
||||
|
||||
|
@ -114,15 +114,15 @@ class ModrinthResourcePackPage : public ResourcePackResourcePage {
|
|||
ModrinthResourcePackPage(ResourcePackDownloadDialog* dialog, BaseInstance& instance);
|
||||
~ModrinthResourcePackPage() override = default;
|
||||
|
||||
[[nodiscard]] bool shouldDisplay() const override;
|
||||
bool shouldDisplay() const override;
|
||||
|
||||
[[nodiscard]] inline auto displayName() const -> QString override { return Modrinth::displayName(); }
|
||||
[[nodiscard]] inline auto icon() const -> QIcon override { return Modrinth::icon(); }
|
||||
[[nodiscard]] inline auto id() const -> QString override { return Modrinth::id(); }
|
||||
[[nodiscard]] inline auto debugName() const -> QString override { return Modrinth::debugName(); }
|
||||
[[nodiscard]] inline auto metaEntryBase() const -> QString override { return Modrinth::metaEntryBase(); }
|
||||
inline auto displayName() const -> QString override { return Modrinth::displayName(); }
|
||||
inline auto icon() const -> QIcon override { return Modrinth::icon(); }
|
||||
inline auto id() const -> QString override { return Modrinth::id(); }
|
||||
inline auto debugName() const -> QString override { return Modrinth::debugName(); }
|
||||
inline auto metaEntryBase() const -> QString override { return Modrinth::metaEntryBase(); }
|
||||
|
||||
[[nodiscard]] inline auto helpPage() const -> QString override { return ""; }
|
||||
inline auto helpPage() const -> QString override { return ""; }
|
||||
};
|
||||
|
||||
class ModrinthTexturePackPage : public TexturePackResourcePage {
|
||||
|
@ -137,15 +137,15 @@ class ModrinthTexturePackPage : public TexturePackResourcePage {
|
|||
ModrinthTexturePackPage(TexturePackDownloadDialog* dialog, BaseInstance& instance);
|
||||
~ModrinthTexturePackPage() override = default;
|
||||
|
||||
[[nodiscard]] bool shouldDisplay() const override;
|
||||
bool shouldDisplay() const override;
|
||||
|
||||
[[nodiscard]] inline auto displayName() const -> QString override { return Modrinth::displayName(); }
|
||||
[[nodiscard]] inline auto icon() const -> QIcon override { return Modrinth::icon(); }
|
||||
[[nodiscard]] inline auto id() const -> QString override { return Modrinth::id(); }
|
||||
[[nodiscard]] inline auto debugName() const -> QString override { return Modrinth::debugName(); }
|
||||
[[nodiscard]] inline auto metaEntryBase() const -> QString override { return Modrinth::metaEntryBase(); }
|
||||
inline auto displayName() const -> QString override { return Modrinth::displayName(); }
|
||||
inline auto icon() const -> QIcon override { return Modrinth::icon(); }
|
||||
inline auto id() const -> QString override { return Modrinth::id(); }
|
||||
inline auto debugName() const -> QString override { return Modrinth::debugName(); }
|
||||
inline auto metaEntryBase() const -> QString override { return Modrinth::metaEntryBase(); }
|
||||
|
||||
[[nodiscard]] inline auto helpPage() const -> QString override { return ""; }
|
||||
inline auto helpPage() const -> QString override { return ""; }
|
||||
};
|
||||
|
||||
class ModrinthShaderPackPage : public ShaderPackResourcePage {
|
||||
|
@ -160,15 +160,15 @@ class ModrinthShaderPackPage : public ShaderPackResourcePage {
|
|||
ModrinthShaderPackPage(ShaderPackDownloadDialog* dialog, BaseInstance& instance);
|
||||
~ModrinthShaderPackPage() override = default;
|
||||
|
||||
[[nodiscard]] bool shouldDisplay() const override;
|
||||
bool shouldDisplay() const override;
|
||||
|
||||
[[nodiscard]] inline auto displayName() const -> QString override { return Modrinth::displayName(); }
|
||||
[[nodiscard]] inline auto icon() const -> QIcon override { return Modrinth::icon(); }
|
||||
[[nodiscard]] inline auto id() const -> QString override { return Modrinth::id(); }
|
||||
[[nodiscard]] inline auto debugName() const -> QString override { return Modrinth::debugName(); }
|
||||
[[nodiscard]] inline auto metaEntryBase() const -> QString override { return Modrinth::metaEntryBase(); }
|
||||
inline auto displayName() const -> QString override { return Modrinth::displayName(); }
|
||||
inline auto icon() const -> QIcon override { return Modrinth::icon(); }
|
||||
inline auto id() const -> QString override { return Modrinth::id(); }
|
||||
inline auto debugName() const -> QString override { return Modrinth::debugName(); }
|
||||
inline auto metaEntryBase() const -> QString override { return Modrinth::metaEntryBase(); }
|
||||
|
||||
[[nodiscard]] inline auto helpPage() const -> QString override { return ""; }
|
||||
inline auto helpPage() const -> QString override { return ""; }
|
||||
};
|
||||
|
||||
class ModrinthDataPackPage : public DataPackResourcePage {
|
||||
|
@ -183,15 +183,15 @@ class ModrinthDataPackPage : public DataPackResourcePage {
|
|||
ModrinthDataPackPage(DataPackDownloadDialog* dialog, BaseInstance& instance);
|
||||
~ModrinthDataPackPage() override = default;
|
||||
|
||||
[[nodiscard]] bool shouldDisplay() const override;
|
||||
bool shouldDisplay() const override;
|
||||
|
||||
[[nodiscard]] inline auto displayName() const -> QString override { return Modrinth::displayName(); }
|
||||
[[nodiscard]] inline auto icon() const -> QIcon override { return Modrinth::icon(); }
|
||||
[[nodiscard]] inline auto id() const -> QString override { return Modrinth::id(); }
|
||||
[[nodiscard]] inline auto debugName() const -> QString override { return Modrinth::debugName(); }
|
||||
[[nodiscard]] inline auto metaEntryBase() const -> QString override { return Modrinth::metaEntryBase(); }
|
||||
inline auto displayName() const -> QString override { return Modrinth::displayName(); }
|
||||
inline auto icon() const -> QIcon override { return Modrinth::icon(); }
|
||||
inline auto id() const -> QString override { return Modrinth::id(); }
|
||||
inline auto debugName() const -> QString override { return Modrinth::debugName(); }
|
||||
inline auto metaEntryBase() const -> QString override { return Modrinth::metaEntryBase(); }
|
||||
|
||||
[[nodiscard]] inline auto helpPage() const -> QString override { return ""; }
|
||||
inline auto helpPage() const -> QString override { return ""; }
|
||||
};
|
||||
|
||||
} // namespace ResourceDownload
|
||||
|
|
|
@ -58,8 +58,8 @@ class ListModel : public QAbstractListModel {
|
|||
void getLogo(const QString& logo, const QString& logoUrl, LogoCallback callback);
|
||||
void searchWithTerm(const QString& term);
|
||||
|
||||
[[nodiscard]] bool hasActiveSearchJob() const { return jobPtr && jobPtr->isRunning(); }
|
||||
[[nodiscard]] Task::Ptr activeSearchJob() { return hasActiveSearchJob() ? jobPtr : nullptr; }
|
||||
bool hasActiveSearchJob() const { return jobPtr && jobPtr->isRunning(); }
|
||||
Task::Ptr activeSearchJob() { return hasActiveSearchJob() ? jobPtr : nullptr; }
|
||||
|
||||
private slots:
|
||||
void searchRequestFinished();
|
||||
|
|
|
@ -74,7 +74,7 @@ class TechnicPage : public QWidget, public ModpackProviderBasePage {
|
|||
/** Programatically set the term in the search bar. */
|
||||
virtual void setSearchTerm(QString) override;
|
||||
/** Get the current term in the search bar. */
|
||||
[[nodiscard]] virtual QString getSerachTerm() const override;
|
||||
virtual QString getSerachTerm() const override;
|
||||
|
||||
private:
|
||||
void suggestCurrent();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue