Added support for "<" relations in graphical restrictions, fixed

compiler warnings.
This commit is contained in:
hiker 2014-12-10 14:18:26 +11:00
parent a8ce996047
commit e05af1cd0b

View File

@ -55,7 +55,7 @@ private:
{
std::string s = version;
std::string::iterator p = s.begin();
while(p !=s.end() && (*p<'0') || (*p>'9') )
while( (p !=s.end()) && ((*p<'0') || (*p>'9')) )
p++;
s.erase(s.begin(), p);
m_version = StringUtils::splitToUInt(s, '.');
@ -136,6 +136,14 @@ public:
if(other.m_version[i]>=m_version[i]) return false;
return true;
} // operator>
// ------------------------------------------------------------------------
bool operator<= (const Version &other) const
{
unsigned int min_n = std::min(m_version.size(), other.m_version.size());
for(unsigned int i=0; i<min_n; i++)
if(other.m_version[i]>m_version[i]) return false;
return true;
} // operator>
}; // class Version
// ============================================================================
@ -247,10 +255,13 @@ public:
break;
case VERSION_LESS_EQUAL:
if(m_driver_version < version) return false;
case VERSION_LESS:
if(m_driver_version <= version) return false;
} // switch m_version_test
return true;
// -----------------------------------------------
}
} // applies
// ------------------------------------------------------------------------
/** Returns a list of options to disable. */
const std::vector<std::string>& getRestrictions() const
@ -292,6 +303,7 @@ void init()
}
m_all_rules.push_back(new Rule(rule));
}
delete rules;
} // init
// ----------------------------------------------------------------------------