diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index fb2bebb6f..c2711bd60 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -56,14 +56,14 @@ void CppCheck::settings(const Settings ¤tSettings) _settings = currentSettings; } -void CppCheck::addFile(const std::string &path) +void CppCheck::addFile(const std::string &filepath) { - getFileLister()->recursiveAddFiles(_filenames, path.c_str()); + _filenames.push_back(Path::fromNativeSeparators(filepath)); } void CppCheck::addFile(const std::string &path, const std::string &content) { - _filenames.push_back(path); + _filenames.push_back(Path::fromNativeSeparators(path)); _fileContents[ path ] = content; } diff --git a/lib/cppcheck.h b/lib/cppcheck.h index 18a81d1db..8d8417c83 100644 --- a/lib/cppcheck.h +++ b/lib/cppcheck.h @@ -77,10 +77,8 @@ public: * @param path Relative or absolute path to the file to be checked, * e.g. "cppcheck.cpp". Note that only source files (.c, .cc or .cpp) * should be added to the list. Include files are gathered automatically. - * You can also give path, e.g. "src/" which will be scanned for source - * files recursively. */ - void addFile(const std::string &path); + void addFile(const std::string &filepath); /** * @brief Add new unreal file to be checked.