Mercurial > hg > svcore
changeset 1772:57833933cc75
Be stricter - require org name as well as app name before allowing ResourceFinder to be used. This is because the application name may have a default, so we could end up with inconsistent results from using before & after these things have been set
author | Chris Cannam |
---|---|
date | Wed, 14 Aug 2019 11:50:56 +0100 |
parents | 40420fa95ffe |
children | fadd9f8aaa27 |
files | base/ResourceFinder.cpp |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/base/ResourceFinder.cpp Tue Aug 13 14:31:38 2019 +0100 +++ b/base/ResourceFinder.cpp Wed Aug 14 11:50:56 2019 +0100 @@ -130,11 +130,11 @@ static QString getNewStyleUserResourcePrefix() { - if (qApp->applicationName() == "") { - cerr << "ERROR: Can't use ResourceFinder before setting application name" << endl; - throw std::logic_error("Can't use ResourceFinder before setting application name"); + if (qApp->applicationName() == "" || qApp->organizationName() == "") { + cerr << "ERROR: Can't use ResourceFinder before setting application and organization name" << endl; + throw std::logic_error("Can't use ResourceFinder before setting application and organization name"); } - + #if QT_VERSION >= 0x050000 // This is expected to be much more reliable than