Fix of an application update situation, where the profiles were

not updated correctly if the index installed in vendor directory
was the same as the one provided with the applicaton installation.
This commit is contained in:
bubnikv 2019-12-05 11:04:18 +01:00
parent 26eaa8af1e
commit ab34ef3ceb
5 changed files with 30 additions and 13 deletions

View file

@ -286,16 +286,21 @@ Index::const_iterator Index::find(const Semver &ver) const
return (it == m_configs.end() || it->config_version == ver) ? it : m_configs.end();
}
Index::const_iterator Index::recommended() const
Index::const_iterator Index::recommended(const Semver &slic3r_version) const
{
const_iterator highest = this->end();
for (const_iterator it = this->begin(); it != this->end(); ++ it)
if (it->is_current_slic3r_supported() &&
if (it->is_slic3r_supported(slic3r_version) &&
(highest == this->end() || highest->config_version < it->config_version))
highest = it;
return highest;
}
Index::const_iterator Index::recommended() const
{
return this->recommended(Slic3r::SEMVER);
}
std::vector<Index> Index::load_db()
{
boost::filesystem::path cache_dir = boost::filesystem::path(Slic3r::data_dir()) / "cache";

View file

@ -71,6 +71,8 @@ public:
// Returns configs().end() if such version does not exist in the index. This shall never happen
// if the index is valid.
const_iterator recommended() const;
// Recommended config for a provided slic3r version. Used when checking for slic3r update (slic3r_version is the old one read out from PrusaSlicer.ini)
const_iterator recommended(const Semver &slic3r_version) const;
// Returns the filesystem path from which this index has originally been loaded
const boost::filesystem::path& path() const { return m_path; }