Renamed editor’s config, because on Android xml files should be compressed in apk, but our reader does not read it correctly at the moment.

This commit is contained in:
Alex Zolotarev 2016-03-04 17:09:11 +03:00 committed by Sergey Yershov
parent 437fecc65a
commit 36eb8d547d
10 changed files with 16 additions and 17 deletions

View file

@ -0,0 +1 @@
../../data/editor.config

View file

@ -1 +0,0 @@
../../data/editor.xml

View file

@ -253,9 +253,10 @@ android {
}
}
// We don't compress these extensions in assets/ because our random FileReader can't read zip-compressed files from apk
// We don't compress these extensions in assets/ because our random FileReader can't read zip-compressed files from apk.
// TODO: Load all minor files via separate call to ReadAsString which can correctly handle compressed files in zip containers.
aaptOptions {
noCompress 'txt', 'bin', 'html', 'png', 'json', 'mwm', 'ttf', 'sdf', 'ui'
noCompress 'txt', 'bin', 'html', 'png', 'json', 'mwm', 'ttf', 'sdf', 'ui', 'config'
ignoreAssetsPattern "!.svn:!.git:!.DS_Store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"
}

View file

@ -14,7 +14,7 @@ namespace
{
using EType = feature::Metadata::EType;
// TODO(mgsergio): It would be nice to have this map generated from editor.xml.
// TODO(mgsergio): It would be nice to have this map generated from editor.config.
static unordered_map<string, EType> const kNamesToFMD= {
{"cuisine", feature::Metadata::FMD_CUISINE},
{"opening_hours", feature::Metadata::FMD_OPEN_HOURS},

View file

@ -58,7 +58,7 @@ DECLARE_EXCEPTION(ConfigLoadError, RootException);
class EditorConfig
{
public:
EditorConfig(string const & fileName);
EditorConfig(string const & fileName = "editor.config");
TypeAggregatedDescription GetTypeDescription(vector<string> const & classificatorTypes) const;
vector<string> GetTypesThatCanBeAdded() const;

View file

@ -17,7 +17,7 @@ UNIT_TEST(EditorConfig_TypeDescription)
feature::Metadata::FMD_EMAIL
};
EditorConfig config("editor.xml");
EditorConfig config;
{
auto const desc = config.GetTypeDescription({"amenity-hunting_stand"});
@ -42,12 +42,12 @@ UNIT_TEST(EditorConfig_TypeDescription)
fields.insert(EType::FMD_OPERATOR);
TEST_EQUAL(desc.GetEditableFields(), fields, ());
}
// TODO(mgsergio): Test case with priority="high" when there is one on editor.xml.
// TODO(mgsergio): Test case with priority="high" when there is one on editor.config.
}
UNIT_TEST(EditorConfig_GetTypesThatGenBeAdded)
{
EditorConfig config("editor.xml");
EditorConfig config;
auto const types = config.GetTypesThatCanBeAdded();
TEST(find(begin(types), end(types), "amenity-cafe") != end(types), ());

View file

@ -127,8 +127,6 @@ namespace osm
// TODO(AlexZ): Normalize osm multivalue strings for correct merging
// (e.g. insert/remove spaces after ';' delimeter);
Editor::Editor() : m_config("editor.xml") { }
Editor & Editor::Instance()
{
static Editor instance;

View file

@ -23,7 +23,7 @@ namespace osm
{
class Editor final
{
Editor();
Editor() = default;
public:
using TFeatureTypeFn = function<void(FeatureType &)>; // Mimics Framework::TFeatureTypeFn.

View file

@ -578,8 +578,8 @@
677A2DE21C0DD50900635A00 /* resources-default in Resources */ = {isa = PBXBuildFile; fileRef = A367C93A1B17334800E2B6E7 /* resources-default */; };
6B653B941C7F2DE4007BEFC5 /* cuisine-strings in Resources */ = {isa = PBXBuildFile; fileRef = 6B653B931C7F2DE4007BEFC5 /* cuisine-strings */; };
6B653B951C7F2DE4007BEFC5 /* cuisine-strings in Resources */ = {isa = PBXBuildFile; fileRef = 6B653B931C7F2DE4007BEFC5 /* cuisine-strings */; };
6B9978351C89A316003B8AA0 /* editor.xml in Resources */ = {isa = PBXBuildFile; fileRef = 6B9978341C89A316003B8AA0 /* editor.xml */; };
6B9978361C89A316003B8AA0 /* editor.xml in Resources */ = {isa = PBXBuildFile; fileRef = 6B9978341C89A316003B8AA0 /* editor.xml */; };
6B9978351C89A316003B8AA0 /* editor.config in Resources */ = {isa = PBXBuildFile; fileRef = 6B9978341C89A316003B8AA0 /* editor.config */; };
6B9978361C89A316003B8AA0 /* editor.config in Resources */ = {isa = PBXBuildFile; fileRef = 6B9978341C89A316003B8AA0 /* editor.config */; };
6BA0BCD11B74DDBA00CC9969 /* MWMCustomFacebookEvents.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6BA0BCD01B74DDBA00CC9969 /* MWMCustomFacebookEvents.mm */; };
845C891F1C78748000940D7F /* me.maps.enterprise.entitlements in Resources */ = {isa = PBXBuildFile; fileRef = 845C891E1C78748000940D7F /* me.maps.enterprise.entitlements */; };
845C892C1C8981CE00940D7F /* HockeySDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 845C89291C8981CE00940D7F /* HockeySDK.framework */; };
@ -1186,7 +1186,7 @@
674A7E221C0DA55E003D48E1 /* libsdf_image.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libsdf_image.a; path = "../../../omim-xcode-build/Debug/libsdf_image.a"; sourceTree = "<group>"; };
674A7E231C0DA55E003D48E1 /* libstb_image.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libstb_image.a; path = "../../../omim-xcode-build/Debug/libstb_image.a"; sourceTree = "<group>"; };
6B653B931C7F2DE4007BEFC5 /* cuisine-strings */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "cuisine-strings"; path = "../../data/cuisine-strings"; sourceTree = "<group>"; };
6B9978341C89A316003B8AA0 /* editor.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = editor.xml; path = ../../data/editor.xml; sourceTree = "<group>"; };
6B9978341C89A316003B8AA0 /* editor.config */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = editor.config; path = ../../data/editor.config; sourceTree = "<group>"; };
6BA0BCCF1B74DDBA00CC9969 /* MWMCustomFacebookEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMCustomFacebookEvents.h; sourceTree = "<group>"; };
6BA0BCD01B74DDBA00CC9969 /* MWMCustomFacebookEvents.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMCustomFacebookEvents.mm; sourceTree = "<group>"; };
772923C9184E0440008C1EDC /* hu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hu; path = hu.lproj/Localizable.strings; sourceTree = "<group>"; };
@ -2851,7 +2851,7 @@
FA065FC61286143F00FEA989 /* External Resources */ = {
isa = PBXGroup;
children = (
6B9978341C89A316003B8AA0 /* editor.xml */,
6B9978341C89A316003B8AA0 /* editor.config */,
671182DE1C7F0DD400CB8177 /* countries_obsolete.txt */,
671182DF1C7F0DD400CB8177 /* packed_polygons_obsolete.bin */,
671182E01C7F0DD400CB8177 /* WorldCoasts_obsolete.mwm */,
@ -3178,7 +3178,7 @@
3401CD711C3C0C420028C6F8 /* MWMEditorNameTableViewCell.xib in Resources */,
347FD8751C60B2CE002FB65E /* MWMOpeningHoursClosedSpanTableViewCell.xib in Resources */,
34F9FB891C438ADB00F71201 /* MWMStreetEditorCommonTableViewCell.xib in Resources */,
6B9978351C89A316003B8AA0 /* editor.xml in Resources */,
6B9978351C89A316003B8AA0 /* editor.config in Resources */,
F6588E381B15D87A00EE1E58 /* MWMBookmarkColorCell.xib in Resources */,
3401CD691C3C03A80028C6F8 /* MWMEditorTextTableViewCell.xib in Resources */,
FAAEA7D1161BD26600CCD661 /* synonyms.txt in Resources */,
@ -3285,7 +3285,7 @@
6741A9631BF340DE002C974C /* Images.xcassets in Resources */,
6741A9641BF340DE002C974C /* MWMSearchDownloadViewController.xib in Resources */,
347FD8881C60B2CE002FB65E /* MWMOpeningHoursTimeSelectorTableViewCell.xib in Resources */,
6B9978361C89A316003B8AA0 /* editor.xml in Resources */,
6B9978361C89A316003B8AA0 /* editor.config in Resources */,
9DA46A151C47E95700EF52BA /* resources-6plus_legacy in Resources */,
347FD8721C60B2CE002FB65E /* MWMOpeningHoursAllDayTableViewCell.xib in Resources */,
34F9FB931C43AF2400F71201 /* MWMStreetEditorEditTableViewCell.xib in Resources */,