From bf8ffac02747a2f3c9bd4e7c1f19300f205232d1 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Tue, 3 Feb 2015 02:29:33 +0100 Subject: Got rid of warnings when including files --- src/core/resource/ResourceRequest.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'src/core') diff --git a/src/core/resource/ResourceRequest.cpp b/src/core/resource/ResourceRequest.cpp index 41aec75..1c93288 100644 --- a/src/core/resource/ResourceRequest.cpp +++ b/src/core/resource/ResourceRequest.cpp @@ -15,6 +15,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ + +#include + #include #include @@ -73,7 +76,8 @@ supportedResourceTypes(const RttiSet &supportedTypes) */ static std::string supportedResourceTypesString(const RttiSet &supportedTypes) { - return Utils::join(supportedResourceTypes(supportedTypes), ", ", "{", "}"); + return Utils::join(supportedResourceTypes(supportedTypes), "\", \"", "\"", + "\""); } /** @@ -183,14 +187,6 @@ bool ResourceRequest::deduce(Registry ®istry, Logger &logger) } } - // Limit the supportedTypes to those returned by the parser - supportedTypes = Rtti::setIntersection(parserTypes, supportedTypes); - if (supportedTypes.empty()) { - logger.error(std::string("Cannot include or link a file of type \"") + - mimetype + std::string("\" here!")); - ok = false; - } - // Try to deduce the ResourceType from the "rel" string if (!rel.empty()) { resourceType = Resource::getResourceTypeByName(rel); @@ -218,8 +214,8 @@ bool ResourceRequest::deduce(Registry ®istry, Logger &logger) std::string("\" cannot be included here")); ok = false; } - } else { - // Issue a warning if the resource type is unknown + } else if (supportedTypes.size() != 1 || + *supportedTypes.begin() != &RttiTypes::Node) { logger.warning(std::string( "Ambiguous resource relationship, consider " "specifying one of ") + -- cgit v1.2.3