diff options
Diffstat (limited to 'src/libs')
-rw-r--r-- | src/libs/installer/getrepositoriesmetainfojob.cpp | 4 | ||||
-rw-r--r-- | src/libs/installer/productkeycheck.cpp | 7 | ||||
-rw-r--r-- | src/libs/installer/productkeycheck.h | 4 |
3 files changed, 14 insertions, 1 deletions
diff --git a/src/libs/installer/getrepositoriesmetainfojob.cpp b/src/libs/installer/getrepositoriesmetainfojob.cpp index 98840b6b0..c4564e781 100644 --- a/src/libs/installer/getrepositoriesmetainfojob.cpp +++ b/src/libs/installer/getrepositoriesmetainfojob.cpp @@ -42,6 +42,7 @@ #include "getrepositoriesmetainfojob.h" #include "getrepositorymetainfojob.h" +#include "productkeycheck.h" #include "packagemanagercore_p.h" #include <QtCore/QDebug> @@ -120,8 +121,9 @@ void GetRepositoriesMetaInfoJob::doStart() { if ((m_core->isInstaller() && !m_core->isOfflineOnly()) || (m_core->isUpdater() || m_core->isPackageManager())) { + const ProductKeyCheck *const productKeyCheck = ProductKeyCheck::instance(m_core); foreach (const Repository &repo, m_core->settings().repositories()) { - if (repo.isEnabled()) + if (repo.isEnabled() && productKeyCheck->isValidRepository(repo)) m_repositories += repo; } } diff --git a/src/libs/installer/productkeycheck.cpp b/src/libs/installer/productkeycheck.cpp index fe1fd10af..a4af2b6d3 100644 --- a/src/libs/installer/productkeycheck.cpp +++ b/src/libs/installer/productkeycheck.cpp @@ -88,3 +88,10 @@ bool ProductKeyCheck::isValidLicenseTextFile(const QString &/*fileName*/) { return true; } + + +bool ProductKeyCheck::isValidRepository(const QInstaller::Repository &repository) const +{ + Q_UNUSED(repository) + return true; +}
\ No newline at end of file diff --git a/src/libs/installer/productkeycheck.h b/src/libs/installer/productkeycheck.h index d472d9288..6d72089e2 100644 --- a/src/libs/installer/productkeycheck.h +++ b/src/libs/installer/productkeycheck.h @@ -38,6 +38,7 @@ namespace QInstaller{ class PackageManagerCore; + class Repository; } class ProductKeyCheckPrivate; @@ -60,6 +61,9 @@ public: // to filter none valid licenses bool isValidLicenseTextFile(const QString &fileName); + // to filter repositories not matching the license + bool isValidRepository(const QInstaller::Repository &repository) const; + private: ProductKeyCheck(); ProductKeyCheckPrivate *const d; |