FIX: fix the vendor disappear issue after de-select the printers in newbie_guide
after the vendor profile is deselected the system files are deleted from userdata dir we should always load the other vendor's profiles from resource instead of userdata dir Change-Id: I29220d30d203ea318092430c02cfa662caf0f388
This commit is contained in:
parent
0aef20dd23
commit
c2c7a6786d
|
@ -989,6 +989,7 @@ int GuideFrame::LoadProfile()
|
||||||
//} while (_findnext(handle, &findData) == 0); // 查找目录中的下一个文件
|
//} while (_findnext(handle, &findData) == 0); // 查找目录中的下一个文件
|
||||||
|
|
||||||
|
|
||||||
|
//load BBL bundle from user data path
|
||||||
string targetPath = bbl_bundle_path.make_preferred().string();
|
string targetPath = bbl_bundle_path.make_preferred().string();
|
||||||
boost::filesystem::path myPath(targetPath);
|
boost::filesystem::path myPath(targetPath);
|
||||||
boost::filesystem::directory_iterator endIter;
|
boost::filesystem::directory_iterator endIter;
|
||||||
|
@ -1003,6 +1004,25 @@ int GuideFrame::LoadProfile()
|
||||||
strVendor = strVendor.AfterLast( '\\');
|
strVendor = strVendor.AfterLast( '\\');
|
||||||
strVendor = strVendor.AfterLast('\/');
|
strVendor = strVendor.AfterLast('\/');
|
||||||
|
|
||||||
|
if (w2s(strVendor) == PresetBundle::BBL_BUNDLE)
|
||||||
|
LoadProfileFamily(w2s(strVendor), iter->path().string());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//string others_targetPath = rsrc_vendor_dir.string();
|
||||||
|
boost::filesystem::directory_iterator others_endIter;
|
||||||
|
for (boost::filesystem::directory_iterator iter(rsrc_vendor_dir); iter != others_endIter; iter++) {
|
||||||
|
if (boost::filesystem::is_directory(*iter)) {
|
||||||
|
//cout << "is dir" << endl;
|
||||||
|
//cout << iter->path().string() << endl;
|
||||||
|
} else {
|
||||||
|
//cout << "is a file" << endl;
|
||||||
|
//cout << iter->path().string() << endl;
|
||||||
|
wxString strVendor = from_u8(iter->path().string()).BeforeLast('.');
|
||||||
|
strVendor = strVendor.AfterLast( '\\');
|
||||||
|
strVendor = strVendor.AfterLast('\/');
|
||||||
|
|
||||||
|
if (w2s(strVendor) != PresetBundle::BBL_BUNDLE)
|
||||||
LoadProfileFamily(w2s(strVendor), iter->path().string());
|
LoadProfileFamily(w2s(strVendor), iter->path().string());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -893,13 +893,15 @@ void PresetUpdater::priv::check_installed_vendor_profiles() const
|
||||||
bundles.push_back(vendor_name);
|
bundles.push_back(vendor_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else //if vendor has no file, copy it from resource
|
else if (vendor_name == PresetBundle::BBL_BUNDLE) {//if vendor has no file, copy it from resource for BBL
|
||||||
bundles.push_back(vendor_name);
|
bundles.push_back(vendor_name);
|
||||||
}
|
}
|
||||||
else //always update configs from resource to vendor
|
}
|
||||||
|
else if (vendor_name == PresetBundle::BBL_BUNDLE) {//always update configs from resource to vendor for BBL
|
||||||
bundles.push_back(vendor_name);
|
bundles.push_back(vendor_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (bundles.size() > 0)
|
if (bundles.size() > 0)
|
||||||
install_bundles_rsrc(bundles, false);
|
install_bundles_rsrc(bundles, false);
|
||||||
|
|
Loading…
Reference in New Issue