Apply printer model / variant preferences when loading presets

This commit is contained in:
Vojtech Kral 2018-03-29 17:54:43 +02:00
parent 57e47a3296
commit e53949f2c8
17 changed files with 218 additions and 64 deletions

View file

@ -135,7 +135,7 @@ void AppConfig::save()
bool AppConfig::get_variant(const std::string &vendor, const std::string &model, const std::string &variant) const
{
std::cerr << "AppConfig::get_variant(" << vendor << ", " << model << ", " << variant << ") ";
// std::cerr << "AppConfig::get_variant(" << vendor << ", " << model << ", " << variant << ") " << std::endl;
const auto it_v = m_vendors.find(vendor);
if (it_v == m_vendors.end()) { return false; }
@ -161,6 +161,12 @@ void AppConfig::set_variant(const std::string &vendor, const std::string &model,
m_dirty = true;
}
void AppConfig::set_vendors(const AppConfig &from)
{
m_vendors = from.m_vendors;
m_dirty = true;
}
std::string AppConfig::get_last_dir() const
{
const auto it = m_storage.find("recent");