ProjectExplorer: Remove HeaderPath::isValid and related code

HeaderPath with an Null path are invalid, there is no need to
have a special type for that.

Change-Id: Ied102fbe523a8cf17e8b385ee89b099517a6d598
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Tobias Hunger
2018-09-13 11:48:36 +02:00
parent 1df553a683
commit 570fe88970
3 changed files with 2 additions and 10 deletions

View File

@@ -93,7 +93,6 @@ QString Utils::toString(ProjectExplorer::HeaderPathType type)
{
#define CASE_LANGUAGEVERSION(x) case ProjectExplorer::HeaderPathType::x: return QLatin1String(#x"Path")
switch (type) {
CASE_LANGUAGEVERSION(Invalid);
CASE_LANGUAGEVERSION(User);
CASE_LANGUAGEVERSION(System);
CASE_LANGUAGEVERSION(Framework);
@@ -470,7 +469,6 @@ static void printIncludeType(QTextStream &out, ProjectExplorer::HeaderPathType t
{
using ProjectExplorer::HeaderPathType;
switch (type) {
case HeaderPathType::Invalid: out << "(invalid include path)"; break;
case HeaderPathType::User: out << "(user include path)"; break;
case HeaderPathType::System: out << "(system include path)"; break;
case HeaderPathType::Framework: out << "(framework path)"; break;

View File

@@ -301,7 +301,7 @@ QString CppSourceProcessor::resolveFile_helper(const QString &fileName,
auto headerPathsEnd = m_headerPaths.end();
const int index = fileName.indexOf(QLatin1Char('/'));
for (; headerPathsIt != headerPathsEnd; ++headerPathsIt) {
if (headerPathsIt->isValid()) {
if (!headerPathsIt->path.isNull()) {
QString path;
if (headerPathsIt->isFrameworkPath()) {
if (index == -1)

View File

@@ -31,7 +31,6 @@
namespace ProjectExplorer {
enum class HeaderPathType {
Invalid,
User,
System,
Framework
@@ -45,11 +44,6 @@ public:
: path(path), type(type)
{ }
bool isValid() const
{
return type != HeaderPathType::Invalid;
}
bool isFrameworkPath() const
{
return type == HeaderPathType::Framework;
@@ -66,7 +60,7 @@ public:
}
QString path;
HeaderPathType type = HeaderPathType::Invalid;
HeaderPathType type = HeaderPathType::User;
};
inline uint qHash(const HeaderPath &key, uint seed = 0)