diff options
author | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2024-03-07 12:30:25 +0200 |
---|---|---|
committer | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2024-03-14 13:22:43 +0200 |
commit | a4e0908df2f908f2da1401a8f11e838d124f1291 (patch) | |
tree | 6e0efc138b243b206b0fd244bf34dd28f375893a /src/libs/installer/packagemanagercore.cpp | |
parent | ce47a87dcfaaf59da8f6a927468b00dcb43d1ae4 (diff) |
Disable 'clear cache' button until new cache settings are applied
Check the cache validity and use it as the initial state for the button.
After clearing the cache, regardless of success, the cache will become
invalid so the button should stay disabled until new settings are
applied and the cache is reinitialized.
Also disable the button in case the selected cache path does not match
the one currently applied in the settings.
Task-number: QTIFW-3252
Change-Id: I1b403fbc8a6680dfd5222296479ab0821cdb4a37
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/libs/installer/packagemanagercore.cpp')
-rw-r--r-- | src/libs/installer/packagemanagercore.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp index eb344ce16..4600a1373 100644 --- a/src/libs/installer/packagemanagercore.cpp +++ b/src/libs/installer/packagemanagercore.cpp @@ -589,6 +589,14 @@ bool PackageManagerCore::clearLocalCache(QString *error) } /*! + Returns \c true if the metadata cache is initialized and valid, \c false otherwise. +*/ +bool PackageManagerCore::isValidCache() const +{ + return d->m_metadataJob.isValidCache(); +} + +/*! \internal */ template <typename T> |