diff options
Diffstat (limited to 'src/core/resource')
-rw-r--r-- | src/core/resource/ResourceLocator.cpp | 4 | ||||
-rw-r--r-- | src/core/resource/ResourceLocator.hpp | 9 | ||||
-rw-r--r-- | src/core/resource/ResourceRequest.cpp | 3 |
3 files changed, 11 insertions, 5 deletions
diff --git a/src/core/resource/ResourceLocator.cpp b/src/core/resource/ResourceLocator.cpp index da38cbd..0498577 100644 --- a/src/core/resource/ResourceLocator.cpp +++ b/src/core/resource/ResourceLocator.cpp @@ -94,8 +94,8 @@ std::vector<std::string> ResourceLocator::doAutocomplete( const std::string &path, const ResourceType type, const std::string &relativeTo) const { - // Default implementation - return std::vector<std::string>{}; + // Default implementation, just return the path again + return std::vector<std::string>{path}; } /* Class StaticResourceLocator */ diff --git a/src/core/resource/ResourceLocator.hpp b/src/core/resource/ResourceLocator.hpp index d6a2ffc..d8afcb2 100644 --- a/src/core/resource/ResourceLocator.hpp +++ b/src/core/resource/ResourceLocator.hpp @@ -71,7 +71,8 @@ protected: * the resource is looked up. * @param relativeTo is an already resolved Resource relative to which the * file should be searched. - * @return a list of matching, autocompleted file paths. + * @return a list of matching, autocompleted file paths. If autocomplete is + * not supported, simply returns the given path as a result. */ virtual std::vector<std::string> doAutocomplete( const std::string &path, const ResourceType type, @@ -108,7 +109,8 @@ public: * the resource is looked up. * @param relativeTo is an already resolved Resource relative to which the * file should be searched. - * @return a list of matching, autocompleted file paths. + * @return a list of matching, autocompleted file paths. If autocomplete is + * not supported, simply returns the given path as a result. */ std::vector<std::string> autocomplete( const std::string &path, @@ -126,7 +128,8 @@ public: * the resource is looked up. * @param relativeTo is the location of an already resolved resource * relative to which this resource should be located. - * @return a list of matching, autocompleted file paths. + * @return a list of matching, autocompleted file paths. If autocomplete is + * not supported, simply returns the given path as a result. */ std::vector<std::string> autocomplete(const std::string &path, const ResourceType type, diff --git a/src/core/resource/ResourceRequest.cpp b/src/core/resource/ResourceRequest.cpp index 79e1ff7..ed94b2d 100644 --- a/src/core/resource/ResourceRequest.cpp +++ b/src/core/resource/ResourceRequest.cpp @@ -206,6 +206,9 @@ bool ResourceRequest::deduce(Registry ®istry, Logger &logger) ok = false; } } else { + // Autocompletion already tries to determine the file path, so + // if an empty list is returned, this means that the resource + // is explicitly not found logger.error(std::string("Resource \"") + path + std::string("\" not found")); ok = false; |