aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/tools/profile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/tools/profile.cpp')
-rw-r--r--src/lib/tools/profile.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/lib/tools/profile.cpp b/src/lib/tools/profile.cpp
index cb3186ae4..bef07eedb 100644
--- a/src/lib/tools/profile.cpp
+++ b/src/lib/tools/profile.cpp
@@ -65,9 +65,15 @@ bool Profile::exists() const
/*!
* \brief Returns the value for property \c key in this profile.
*/
-QVariant Profile::value(const QString &key, const QVariant &defaultValue) const
-{
- return possiblyInheritedValue(key, defaultValue, QStringList());
+QVariant Profile::value(const QString &key, const QVariant &defaultValue, ErrorInfo *error) const
+{
+ try {
+ return possiblyInheritedValue(key, defaultValue, QStringList());
+ } catch (const ErrorInfo &e) {
+ if (error)
+ *error = e;
+ return QVariant();
+ }
}
/*!
@@ -103,9 +109,15 @@ QString Profile::name() const
* If and only if selection is Profile::KeySelectionRecursive, this will also list keys defined
* in base profiles.
*/
-QStringList Profile::allKeys(KeySelection selection) const
-{
- return allKeysInternal(selection, QStringList());
+QStringList Profile::allKeys(KeySelection selection, ErrorInfo *error) const
+{
+ try {
+ return allKeysInternal(selection, QStringList());
+ } catch (const ErrorInfo &e) {
+ if (error)
+ *error = e;
+ return QStringList();
+ }
}
/*!