Mercurial > hg > svcore
comparison base/ResourceFinder.cpp @ 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 | 5ac102155409 |
children |
comparison
equal
deleted
inserted
replaced
1771:40420fa95ffe | 1772:57833933cc75 |
---|---|
128 } | 128 } |
129 | 129 |
130 static QString | 130 static QString |
131 getNewStyleUserResourcePrefix() | 131 getNewStyleUserResourcePrefix() |
132 { | 132 { |
133 if (qApp->applicationName() == "") { | 133 if (qApp->applicationName() == "" || qApp->organizationName() == "") { |
134 cerr << "ERROR: Can't use ResourceFinder before setting application name" << endl; | 134 cerr << "ERROR: Can't use ResourceFinder before setting application and organization name" << endl; |
135 throw std::logic_error("Can't use ResourceFinder before setting application name"); | 135 throw std::logic_error("Can't use ResourceFinder before setting application and organization name"); |
136 } | 136 } |
137 | 137 |
138 #if QT_VERSION >= 0x050000 | 138 #if QT_VERSION >= 0x050000 |
139 | 139 |
140 // This is expected to be much more reliable than | 140 // This is expected to be much more reliable than |
141 // getOldStyleUserResourcePrefix(), but it returns a different | 141 // getOldStyleUserResourcePrefix(), but it returns a different |
142 // directory because it includes the organisation name (which is | 142 // directory because it includes the organisation name (which is |