From 9d7d55918c065d5d7f615cbd89e20ab7227f54ff Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Fri, 9 Oct 2020 20:32:26 +0200 Subject: Add IModInterface::setUrl and remove IInstallationManager::setURL. --- src/installationmanager.cpp | 12 ------------ src/installationmanager.h | 4 ---- src/modinfo.h | 13 +++++++++++++ 3 files changed, 13 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/installationmanager.cpp b/src/installationmanager.cpp index a755b0cb..e4937ed9 100644 --- a/src/installationmanager.cpp +++ b/src/installationmanager.cpp @@ -122,11 +122,6 @@ void InstallationManager::setParentWidget(QWidget *widget) } } -void InstallationManager::setURL(QString const &url) -{ - m_URL = url; -} - void InstallationManager::queryPassword() { m_Password = QInputDialog::getText(m_ParentWidget, tr("Password required"), tr("Password"), QLineEdit::Password); @@ -534,13 +529,6 @@ IPluginInstaller::EInstallResult InstallationManager::doInstall(GuessedValue, QString> m_CreatedFiles; std::set m_TempFilesToDelete; - - QString m_URL; }; diff --git a/src/modinfo.h b/src/modinfo.h index 0533d9fe..7223cece 100644 --- a/src/modinfo.h +++ b/src/modinfo.h @@ -789,6 +789,19 @@ public: // Methods after this do not come from IModInterface: */ virtual void setCustomURL(QString const&) {} + /** + * @brief Sets the URL for this mod. + * + * In practice, this is a shortcut for setHasCustomURL followed by + * setCustomURL. + * + * @param url The new URL. + */ + void setUrl(QString const& url) override { + setHasCustomURL(true); + setCustomURL(url); + } + /** * If hasCustomURL() is true and getCustomURL() is not empty, tries to parse * the url using QUrl::fromUserInput() and returns it. Otherwise, returns an -- cgit v1.3.1