diff options
author | Katja Marttila <katja.marttila@qt.io> | 2023-03-15 14:50:47 +0200 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2023-03-21 12:23:13 +0000 |
commit | b67df147aedb967a9835766437cd63030013f27b (patch) | |
tree | 48f31106c32da5bc04c3b9ada606f368f1ee9639 /src/libs/installer/component.cpp | |
parent | e374743d93a3b4d9d7bd593ed010653c6ef72645 (diff) |
Add more detailed error messages
Once installer is started, metadata is downloaded to cache and that
cache is used later to speed the installation process. Cache should not
get invalid but sometimes that can happen. Informing user where the
cache exists and that clearing it might help when the error occurs.
Task-number: QTIFW-2998
Change-Id: Ia2c2a1209fa84070f9ad337c63a429a1afd721a7
Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Diffstat (limited to 'src/libs/installer/component.cpp')
-rw-r--r-- | src/libs/installer/component.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp index 690b4ee93..edd03a191 100644 --- a/src/libs/installer/component.cpp +++ b/src/libs/installer/component.cpp @@ -64,9 +64,6 @@ using namespace QInstaller; -static const char *scClearCacheHint = QT_TR_NOOP( - "Clearing the cache directory and restarting the application may solve this."); - /*! \enum QInstaller::Component::UnstableError @@ -692,8 +689,8 @@ void Component::loadUserInterfaces(const QDir &directory, const QStringList &uis while (it.hasNext()) { QFile file(it.next()); if (!file.open(QIODevice::ReadOnly)) { - throw Error(tr("Cannot open the requested UI file \"%1\": %2.\n\n%3").arg( - it.fileName(), file.errorString(), tr(scClearCacheHint))); + throw Error(tr("Cannot open the requested UI file \"%1\": %2.\n\n%3 \"%4\"").arg( + it.fileName(), file.errorString(), tr(scClearCacheHint), packageManagerCore()->settings().localCachePath())); } static QUiLoader loader; @@ -701,8 +698,8 @@ void Component::loadUserInterfaces(const QDir &directory, const QStringList &uis loader.setLanguageChangeEnabled(true); QWidget *const widget = loader.load(&file, 0); if (!widget) { - throw Error(tr("Cannot load the requested UI file \"%1\": %2.\n\n%3").arg( - it.fileName(), loader.errorString(), tr(scClearCacheHint))); + throw Error(tr("Cannot load the requested UI file \"%1\": %2.\n\n%3 \"%4\"").arg( + it.fileName(), loader.errorString(), tr(scClearCacheHint), packageManagerCore()->settings().localCachePath())); } d->scriptEngine()->newQObject(widget); d->m_userInterfaces.insert(widget->objectName(), widget); @@ -747,8 +744,8 @@ void Component::loadLicenses(const QString &directory, const QHash<QString, QVar QFile file(fileInfo.filePath()); if (!file.open(QIODevice::ReadOnly)) { - throw Error(tr("Cannot open the requested license file \"%1\": %2.\n\n%3").arg( - file.fileName(), file.errorString(), tr(scClearCacheHint))); + throw Error(tr("Cannot open the requested license file \"%1\": %2.\n\n%3 \"%4\"").arg( + file.fileName(), file.errorString(), tr(scClearCacheHint), packageManagerCore()->settings().localCachePath())); } QTextStream stream(&file); stream.setCodec("UTF-8"); |