summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@digia.com>2014-10-30 14:49:04 +0100
committerKarsten Heimrich <karsten.heimrich@digia.com>2014-10-30 17:40:58 +0100
commit3bba22fdcc02418f3781df13c80029f853545918 (patch)
tree58672573cafba32c7482a99494d0c5cf3fca4e3b
parent43b238759898b65b5f28f544c546bc691faa8561 (diff)
Fix annoying warning printed during installation.
Make the Error class to not inherit from runtime error, there's no reason to do so. Add empty ctor to avoid dumping the error message at least once. Check if a .dat file exists and only then print warning. Change-Id: I97833947022e05ee3b14992c8ec662874fb5d343 Reviewed-by: Christoph VogtlÃĪnder <c.vogtlaender@sigma-surface-science.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Niels Weber <niels.weber@digia.com>
-rw-r--r--src/libs/installer/errors.h6
-rw-r--r--src/libs/installer/packagemanagercore_p.cpp8
2 files changed, 9 insertions, 5 deletions
diff --git a/src/libs/installer/errors.h b/src/libs/installer/errors.h
index c63b52926..bcf32f3f8 100644
--- a/src/libs/installer/errors.h
+++ b/src/libs/installer/errors.h
@@ -42,12 +42,12 @@
namespace QInstaller {
-class Error : public std::runtime_error
+class Error : public std::exception
{
public:
+ Error() {}
explicit Error(const QString &message)
- : std::runtime_error(message.toStdString())
- , m_message (message)
+ : m_message(message)
{
qDebug() << "create Error-Exception:" << message;
}
diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp
index b5c99dc87..47016dad5 100644
--- a/src/libs/installer/packagemanagercore_p.cpp
+++ b/src/libs/installer/packagemanagercore_p.cpp
@@ -1257,8 +1257,12 @@ void PackageManagerCorePrivate::writeMaintenanceTool(OperationList performedOper
+ QLatin1String(".dat");
try {
if (isInstaller()) {
- throw Error(tr("Found a binary data file, but we are the installer and we should read the "
- "binary resource from our very own binary!"));
+ if (QFile::exists(dataFile)) {
+ qWarning() << QString::fromLatin1("Found binary data file '%1' but "
+ "deliberately not used. Running as installer requires to read the "
+ "resources from the application binary.").arg(dataFile);
+ }
+ throw Error();
}
input.setFileName(dataFile);
QInstaller::openForRead(&input);